Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure System is ESM #91

Merged
merged 4 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading