Skip to content

Commit

Permalink
feat: add ts:nodenext support
Browse files Browse the repository at this point in the history
  • Loading branch information
ruicsh committed Apr 11, 2023
1 parent 493ca72 commit ea10db5
Show file tree
Hide file tree
Showing 5 changed files with 685 additions and 771 deletions.
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
19.6.0
18.15.0
36 changes: 21 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@
"exports": {
".": [
{
"import": "./dist/index.mjs",
"require": "./dist/index.cjs",
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.cjs"
},
"default": "./dist/index.mjs"
},
"./dist/index.mjs"
Expand All @@ -41,23 +47,23 @@
},
"devDependencies": {
"@types/debug": "4.1.7",
"@types/node": "18.14.0",
"@typescript-eslint/eslint-plugin": "5.52.0",
"@typescript-eslint/parser": "5.52.0",
"@vitest/coverage-c8": "0.28.5",
"esbuild": "0.17.8",
"eslint": "8.34.0",
"@types/node": "18.15.11",
"@typescript-eslint/eslint-plugin": "5.58.0",
"@typescript-eslint/parser": "5.58.0",
"@vitest/coverage-c8": "0.30.1",
"esbuild": "0.17.16",
"eslint": "8.38.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-airbnb-typescript": "17.0.0",
"eslint-config-prettier": "8.6.0",
"eslint-config-prettier": "8.8.0",
"eslint-plugin-import": "2.27.5",
"msw": "1.0.1",
"msw": "1.2.1",
"nyc": "15.1.0",
"prettier": "2.8.4",
"tsx": "3.12.3",
"typescript": "4.9.5",
"vitest": "0.28.5",
"zx": "7.1.1"
"prettier": "2.8.7",
"tsx": "3.12.6",
"typescript": "5.0.4",
"vitest": "0.30.1",
"zx": "7.2.1"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion sh/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ async function main() {

const flags = ["--bundle", "--platform=node", "--minify"];

await $`esbuild src/index.ts --outfile=dist/index.cjs ${flags}`;
await $`esbuild src/cjs/index.cjs --outfile=dist/index.cjs ${flags}`;
await $`esbuild src/index.ts --format=esm --outfile=dist/index.mjs ${flags}`;

await $`cp src/fetch.d.ts dist/fetch.d.ts`;
Expand Down
3 changes: 3 additions & 0 deletions src/cjs/index.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import fetch from "../index";

module.exports = fetch;
Loading

0 comments on commit ea10db5

Please sign in to comment.