Skip to content

Commit

Permalink
feat: add esm version
Browse files Browse the repository at this point in the history
  • Loading branch information
akitaSummer committed Apr 22, 2024
1 parent 68c1a9c commit 6710289
Show file tree
Hide file tree
Showing 105 changed files with 779 additions and 145 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ plugin/*/test/fixtures/**/run
plugin/*/test/fixtures/**/oneapi
plugin/*/test/fixtures/**/logs
benchmark
scripts
!plugin/tegg-compatible/typings/index.d.ts
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ yarn.lock
*clinic-doctor*
.nyc_output/
dist
esm

**/*.js
**/*.d.ts
Expand All @@ -44,4 +45,5 @@ plugin/tegg/test/fixtures/apps/**/*.js
!standalone/standalone/test/fixtures/**/node_modules/**/*.js
!plugin/tegg/test/fixtures/**/node_modules
!plugin/config/test/fixtures/**/node_modules
!scripts/**/*.js
.node
12 changes: 8 additions & 4 deletions core/ajv-decorator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@
"main": "dist/index.js",
"files": [
"dist/**/*.js",
"dist/**/*.d.ts"
"dist/**/*.d.ts",
"esm/**/*.js",
"esm/**/*.d.ts"
],
"typings": "dist/index.d.ts",
"scripts": {
"test": "cross-env NODE_ENV=test NODE_OPTIONS='--no-deprecation' mocha",
"clean": "tsc -b --clean",
"clean": "tsc -b --clean && npm run clean:esm",
"clean:esm": "node ../../scripts/clean-esm.js",
"tsc": "npm run clean && tsc -p ./tsconfig.json",
"tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json",
"tsc:esm": "npm run clean:esm && node ../../scripts/build-esm.js &&tsc -p ./tsconfig.esm.json",
"tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && npm run tsc:esm",
"prepublishOnly": "npm run tsc:pub"
},
"license": "MIT",
Expand Down Expand Up @@ -50,4 +54,4 @@
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
}
}
}
16 changes: 16 additions & 0 deletions core/ajv-decorator/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"moduleResolution": "node",
"module": "ESNext",
"target": "ESNext",
"outDir": "esm",
"baseUrl": "./"
},
"exclude": [
"dist",
"node_modules",
"test",
"esm"
]
}
3 changes: 2 additions & 1 deletion core/ajv-decorator/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"exclude": [
"dist",
"node_modules",
"test"
"test",
"esm"
]
}
3 changes: 2 additions & 1 deletion core/ajv-decorator/tsconfig.pub.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"exclude": [
"dist",
"node_modules",
"test"
"test",
"esm"
]
}
12 changes: 8 additions & 4 deletions core/aop-decorator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
},
"scripts": {
"test": "cross-env NODE_ENV=test NODE_OPTIONS='--no-deprecation' mocha",
"clean": "tsc -b --clean",
"clean": "tsc -b --clean && npm run clean:esm",
"clean:esm": "node ../../scripts/clean-esm.js",
"tsc": "npm run clean && tsc -p ./tsconfig.json",
"tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json",
"tsc:esm": "npm run clean:esm && node ../../scripts/build-esm.js &&tsc -p ./tsconfig.esm.json",
"tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && npm run tsc:esm",
"prepublishOnly": "npm run tsc:pub"
},
"publishConfig": {
Expand All @@ -38,7 +40,9 @@
"main": "dist/index.js",
"files": [
"dist/**/*.js",
"dist/**/*.d.ts"
"dist/**/*.d.ts",
"esm/**/*.js",
"esm/**/*.d.ts"
],
"bugs": {
"url": "https://github.com/eggjs/tegg/issues"
Expand All @@ -51,4 +55,4 @@
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
}
}
}
16 changes: 16 additions & 0 deletions core/aop-decorator/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"moduleResolution": "node",
"module": "ESNext",
"target": "ESNext",
"outDir": "esm",
"baseUrl": "./"
},
"exclude": [
"dist",
"node_modules",
"test",
"esm"
]
}
3 changes: 2 additions & 1 deletion core/aop-decorator/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"exclude": [
"dist",
"node_modules",
"test"
"test",
"esm"
]
}
3 changes: 2 additions & 1 deletion core/aop-decorator/tsconfig.pub.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"exclude": [
"dist",
"node_modules",
"test"
"test",
"esm"
]
}
12 changes: 8 additions & 4 deletions core/aop-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
},
"files": [
"dist/**/*.js",
"dist/**/*.d.ts"
"dist/**/*.d.ts",
"esm/**/*.js",
"esm/**/*.d.ts"
],
"typings": "dist/index.d.ts",
"keywords": [
Expand All @@ -20,9 +22,11 @@
],
"scripts": {
"test": "cross-env NODE_ENV=test NODE_OPTIONS='--no-deprecation' mocha",
"clean": "tsc -b --clean && rm -rf dist",
"clean": "tsc -b --clean && rm -rf dist && npm run clean:esm",
"clean:esm": "node ../../scripts/clean-esm.js",
"tsc": "npm run clean && tsc -p ./tsconfig.json",
"tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json",
"tsc:esm": "npm run clean:esm && node ../../scripts/build-esm.js &&tsc -p ./tsconfig.esm.json",
"tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && npm run tsc:esm",
"prepublishOnly": "npm run tsc:pub"
},
"author": "killagu <[email protected]>",
Expand Down Expand Up @@ -63,4 +67,4 @@
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
}
}
}
16 changes: 16 additions & 0 deletions core/aop-runtime/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"moduleResolution": "node",
"module": "ESNext",
"target": "ESNext",
"outDir": "esm",
"baseUrl": "./"
},
"exclude": [
"dist",
"node_modules",
"test",
"esm"
]
}
3 changes: 2 additions & 1 deletion core/aop-runtime/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"exclude": [
"dist",
"node_modules",
"test"
"test",
"esm"
]
}
3 changes: 2 additions & 1 deletion core/aop-runtime/tsconfig.pub.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"exclude": [
"dist",
"node_modules",
"test"
"test",
"esm"
]
}
12 changes: 8 additions & 4 deletions core/background-task/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@
"main": "dist/index.js",
"files": [
"dist/**/*.js",
"dist/**/*.d.ts"
"dist/**/*.d.ts",
"esm/**/*.js",
"esm/**/*.d.ts"
],
"typings": "dist/index.d.ts",
"scripts": {
"test": "cross-env NODE_ENV=test NODE_OPTIONS='--no-deprecation' mocha",
"clean": "tsc -b --clean",
"clean": "tsc -b --clean && npm run clean:esm",
"clean:esm": "node ../../scripts/clean-esm.js",
"tsc": "npm run clean && tsc -p ./tsconfig.json",
"tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json",
"tsc:esm": "npm run clean:esm && node ../../scripts/build-esm.js &&tsc -p ./tsconfig.esm.json",
"tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && npm run tsc:esm",
"prepublishOnly": "npm run tsc:pub"
},
"homepage": "https://github.com/eggjs/tegg",
Expand Down Expand Up @@ -55,4 +59,4 @@
"publishConfig": {
"access": "public"
}
}
}
16 changes: 16 additions & 0 deletions core/background-task/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"moduleResolution": "node",
"module": "ESNext",
"target": "ESNext",
"outDir": "esm",
"baseUrl": "./"
},
"exclude": [
"dist",
"node_modules",
"test",
"esm"
]
}
3 changes: 2 additions & 1 deletion core/background-task/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"exclude": [
"dist",
"node_modules",
"test"
"test",
"esm"
]
}
3 changes: 2 additions & 1 deletion core/background-task/tsconfig.pub.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"exclude": [
"dist",
"node_modules",
"test"
"test",
"esm"
]
}
12 changes: 8 additions & 4 deletions core/common-util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@
"main": "dist/index.js",
"files": [
"dist/**/*.js",
"dist/**/*.d.ts"
"dist/**/*.d.ts",
"esm/**/*.js",
"esm/**/*.d.ts"
],
"typings": "dist/index.d.ts",
"scripts": {
"test": "cross-env NODE_ENV=test NODE_OPTIONS='--no-deprecation' mocha",
"clean": "tsc -b --clean",
"clean": "tsc -b --clean && npm run clean:esm",
"clean:esm": "node ../../scripts/clean-esm.js",
"tsc": "npm run clean && tsc -p ./tsconfig.json",
"tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json",
"tsc:esm": "npm run clean:esm && node ../../scripts/build-esm.js &&tsc -p ./tsconfig.esm.json",
"tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && npm run tsc:esm",
"prepublishOnly": "npm run tsc:pub"
},
"author": "killagu <[email protected]>",
Expand Down Expand Up @@ -52,4 +56,4 @@
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
}
}
}
16 changes: 16 additions & 0 deletions core/common-util/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"moduleResolution": "node",
"module": "ESNext",
"target": "ESNext",
"outDir": "esm",
"baseUrl": "./"
},
"exclude": [
"dist",
"node_modules",
"test",
"esm"
]
}
3 changes: 2 additions & 1 deletion core/common-util/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"exclude": [
"dist",
"node_modules",
"test"
"test",
"esm"
]
}
3 changes: 2 additions & 1 deletion core/common-util/tsconfig.pub.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"exclude": [
"dist",
"node_modules",
"test"
"test",
"esm"
]
}
12 changes: 8 additions & 4 deletions core/controller-decorator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@
"main": "dist/index.js",
"files": [
"dist/**/*.js",
"dist/**/*.d.ts"
"dist/**/*.d.ts",
"esm/**/*.js",
"esm/**/*.d.ts"
],
"typings": "dist/index.d.ts",
"scripts": {
"test": "cross-env NODE_ENV=test NODE_OPTIONS='--no-deprecation' mocha",
"clean": "tsc -b --clean",
"clean": "tsc -b --clean && npm run clean:esm",
"clean:esm": "node ../../scripts/clean-esm.js",
"tsc": "npm run clean && tsc -p ./tsconfig.json",
"tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json",
"tsc:esm": "npm run clean:esm && node ../../scripts/build-esm.js &&tsc -p ./tsconfig.esm.json",
"tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && npm run tsc:esm",
"prepublishOnly": "npm run tsc:pub"
},
"author": "killagu <[email protected]>",
Expand Down Expand Up @@ -57,4 +61,4 @@
"publishConfig": {
"access": "public"
}
}
}
16 changes: 16 additions & 0 deletions core/controller-decorator/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"moduleResolution": "node",
"module": "ESNext",
"target": "ESNext",
"outDir": "esm",
"baseUrl": "./"
},
"exclude": [
"dist",
"node_modules",
"test",
"esm"
]
}
Loading

0 comments on commit 6710289

Please sign in to comment.