Skip to content

Commit

Permalink
build: adapt for ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfy1339 committed Feb 24, 2024
1 parent 174b0b6 commit ef1f6be
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"description": "GitHub App authentication for JavaScript",
"scripts": {
"build": "node scripts/build.mjs && tsc -p tsconfig.json",
"lint": "prettier --check '{src,test}/**/*.{ts,md}' README.md *.json",
"lint:fix": "prettier --write '{src,test}/**/*.{ts,md}' README.md *.json",
"lint": "prettier --check '{src,test,scripts}/**/*.{ts,md}' README.md *.json",
"lint:fix": "prettier --write '{src,test,scripts}/**/*.{ts,md}' README.md *.json",
"pretest": "npm run -s lint",
"test": "jest --coverage",
"test:typescript": "npx tsc --noEmit --declaration --noUnusedLocals --esModuleInterop --strict --target es2018 --moduleResolution node test/typescript-validate.ts"
Expand All @@ -34,7 +34,7 @@
"universal-user-agent": "^7.0.0"
},
"devDependencies": {
"@octokit/tsconfig": "^2.0.0",
"@octokit/tsconfig": "^3.0.0",
"@sinonjs/fake-timers": "^8.0.0",
"@types/fetch-mock": "^7.3.1",
"@types/jest": "^29.0.0",
Expand Down
13 changes: 8 additions & 5 deletions scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ async function main() {
outdir: "pkg/dist-node",
bundle: true,
platform: "node",
target: "node14",
format: "cjs",
target: "node18",
format: "esm",
...sharedOptions,
});

Expand All @@ -67,9 +67,12 @@ async function main() {
{
...pkg,
files: ["dist-*/**", "bin/**"],
main: "dist-node/index.js",
types: "dist-types/index.d.ts",
source: "dist-src/index.js",
exports: {
".": {
types: "./dist-types/index.d.ts",
import: "./dist-node/index.js",
},
},
sideEffects: false,
},
null,
Expand Down

0 comments on commit ef1f6be

Please sign in to comment.