Skip to content

Commit

Permalink
Merge pull request #91 from sellersindustry/82-ensure-core-modules-ar…
Browse files Browse the repository at this point in the history
…e-esm

Ensure System is ESM
  • Loading branch information
SellersEvan authored Apr 22, 2024
2 parents 8007296 + 7b5128d commit 4f8c696
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 8 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Linting

on:
pull_request:
branches: ["*"]

jobs:
test:
name: Run Linting
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install dependencies
run: npm install

- name: Run linting
run: npm run lint
File renamed without changes.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
"author": "Sellers Industries",
"version": "0.0.0",
"description": "Module and Reusable Microservice Platform. Build and modularize custom API endpoints, inspired by NextJS APIs. Export to Vercel and ExpressJS.",
"main": "./dist/index.js",
"exports": "./dist/index.js",
"type": "module",
"bin": {
"sherpa": "./dist/src/cli/index.js"
},
"engines": {
"node": ">=16"
},
"scripts": {
"build": "tsc --build --force tsconfig.json",
"prepare": "npm run build",
Expand Down
1 change: 0 additions & 1 deletion src/compiler/bundler/platforms/vercel/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@


import fs from "fs";
import path from "path";
import { Bundler } from "../abstract.js";
import { Endpoint, Segment } from "../../../models.js";
import { Path } from "../../../utilities/path/index.js";
Expand Down
3 changes: 2 additions & 1 deletion src/compiler/utilities/tooling/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { ExportLoaderModule, getExportedLoader } from "./exported-loader/index.j

export type { ExportLoaderModule };
export const DEFAULT_ESBUILD_TARGET:Partial<ESBuildOptions> = {
format: "cjs",
format: "esm",
target: "es2022",
platform: "node",
bundle: true,
Expand Down Expand Up @@ -60,6 +60,7 @@ export class Tooling {
static async getDefaultExport(filepath:string):Promise<unknown> {
let result = await build({
...DEFAULT_ESBUILD_TARGET,
format: "cjs",
entryPoints: [filepath],
write: false
});
Expand Down
2 changes: 1 addition & 1 deletion src/environment/handler/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import { Context, Method } from "../../compiler/models.js";
import { IResponse } from "../io/response/interface.js";
import { IRequest } from "../io/request/interface";
import { IRequest } from "../io/request/interface.js";
import { Response } from "../io/response/index.js";


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Request, Response } from "../../../../../../../../../../src/environment/index";

export function GET(request:Request, context:any) {
export function GET(request:Request, context:unknown) {
return Response.JSON({
request: request,
context: context
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Response, Request } from "../../../../../../../../src/environment/index";


export function GET(request:Request, context:any) {
export function GET(request:Request, context:unknown) {
return Response.JSON({
request,
context
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"target": "es2022",
"module": "es2022",
"moduleResolution": "Node",
"module": "Node16",
"moduleResolution": "Node16",
"esModuleInterop": true,
"sourceMap": true,
"outDir": "dist",
Expand Down

0 comments on commit 4f8c696

Please sign in to comment.