diff --git a/core/ajv-decorator/esm/package.json b/core/ajv-decorator/esm/package.json new file mode 100644 index 00000000..96ae6e57 --- /dev/null +++ b/core/ajv-decorator/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/core/ajv-decorator/package.json b/core/ajv-decorator/package.json index 157a5924..18bfb94e 100644 --- a/core/ajv-decorator/package.json +++ b/core/ajv-decorator/package.json @@ -10,16 +10,19 @@ "ajv" ], "main": "dist/index.js", + "module": "esm/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", "tsc": "npm run clean && tsc -p ./tsconfig.json", - "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json", + "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && tsc -p ./tsconfig.esm.json", "prepublishOnly": "npm run tsc:pub" }, "license": "MIT", @@ -49,5 +52,17 @@ "mocha": "^10.2.0", "ts-node": "^10.9.1", "typescript": "^5.0.4" + }, + "exports": { + ".": { + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } } } diff --git a/core/ajv-decorator/tsconfig.esm.json b/core/ajv-decorator/tsconfig.esm.json new file mode 100644 index 00000000..a4d72b92 --- /dev/null +++ b/core/ajv-decorator/tsconfig.esm.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "outDir": "esm", + "baseUrl": "./" + }, + "exclude": [ + "dist", + "node_modules", + "test", + "esm" + ] +} diff --git a/core/ajv-decorator/tsconfig.json b/core/ajv-decorator/tsconfig.json index 64b22405..360cb192 100644 --- a/core/ajv-decorator/tsconfig.json +++ b/core/ajv-decorator/tsconfig.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/ajv-decorator/tsconfig.pub.json b/core/ajv-decorator/tsconfig.pub.json index 64b22405..360cb192 100644 --- a/core/ajv-decorator/tsconfig.pub.json +++ b/core/ajv-decorator/tsconfig.pub.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/aop-decorator/esm/package.json b/core/aop-decorator/esm/package.json new file mode 100644 index 00000000..96ae6e57 --- /dev/null +++ b/core/aop-decorator/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/core/aop-decorator/package.json b/core/aop-decorator/package.json index 2fd23a4b..c9e4a71f 100644 --- a/core/aop-decorator/package.json +++ b/core/aop-decorator/package.json @@ -25,7 +25,7 @@ "test": "cross-env NODE_ENV=test NODE_OPTIONS='--no-deprecation' mocha", "clean": "tsc -b --clean", "tsc": "npm run clean && tsc -p ./tsconfig.json", - "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json", + "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && tsc -p ./tsconfig.esm.json", "prepublishOnly": "npm run tsc:pub" }, "publishConfig": { @@ -36,9 +36,12 @@ }, "license": "MIT", "main": "dist/index.js", + "module": "esm/index.js", "files": [ "dist/**/*.js", - "dist/**/*.d.ts" + "dist/**/*.d.ts", + "esm/**/*.js", + "esm/**/*.d.ts" ], "bugs": { "url": "https://github.com/eggjs/tegg/issues" @@ -50,5 +53,17 @@ "mocha": "^10.2.0", "ts-node": "^10.9.1", "typescript": "^5.0.4" + }, + "exports": { + ".": { + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } } } diff --git a/core/aop-decorator/tsconfig.esm.json b/core/aop-decorator/tsconfig.esm.json new file mode 100644 index 00000000..a4d72b92 --- /dev/null +++ b/core/aop-decorator/tsconfig.esm.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "outDir": "esm", + "baseUrl": "./" + }, + "exclude": [ + "dist", + "node_modules", + "test", + "esm" + ] +} diff --git a/core/aop-decorator/tsconfig.json b/core/aop-decorator/tsconfig.json index 64b22405..360cb192 100644 --- a/core/aop-decorator/tsconfig.json +++ b/core/aop-decorator/tsconfig.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/aop-decorator/tsconfig.pub.json b/core/aop-decorator/tsconfig.pub.json index 64b22405..360cb192 100644 --- a/core/aop-decorator/tsconfig.pub.json +++ b/core/aop-decorator/tsconfig.pub.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/aop-runtime/esm/package.json b/core/aop-runtime/esm/package.json new file mode 100644 index 00000000..96ae6e57 --- /dev/null +++ b/core/aop-runtime/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/core/aop-runtime/package.json b/core/aop-runtime/package.json index 4a563572..6d3cd012 100644 --- a/core/aop-runtime/package.json +++ b/core/aop-runtime/package.json @@ -8,9 +8,12 @@ }, "files": [ "dist/**/*.js", - "dist/**/*.d.ts" + "dist/**/*.d.ts", + "esm/**/*.js", + "esm/**/*.d.ts" ], "typings": "dist/index.d.ts", + "module": "esm/index.js", "keywords": [ "egg", "typescript", @@ -22,7 +25,7 @@ "test": "cross-env NODE_ENV=test NODE_OPTIONS='--no-deprecation' mocha", "clean": "tsc -b --clean && rm -rf dist", "tsc": "npm run clean && tsc -p ./tsconfig.json", - "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json", + "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && tsc -p ./tsconfig.esm.json", "prepublishOnly": "npm run tsc:pub" }, "author": "killagu ", @@ -62,5 +65,17 @@ "mocha": "^10.2.0", "ts-node": "^10.9.1", "typescript": "^5.0.4" + }, + "exports": { + ".": { + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } } } diff --git a/core/aop-runtime/tsconfig.esm.json b/core/aop-runtime/tsconfig.esm.json new file mode 100644 index 00000000..a4d72b92 --- /dev/null +++ b/core/aop-runtime/tsconfig.esm.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "outDir": "esm", + "baseUrl": "./" + }, + "exclude": [ + "dist", + "node_modules", + "test", + "esm" + ] +} diff --git a/core/aop-runtime/tsconfig.json b/core/aop-runtime/tsconfig.json index 64b22405..360cb192 100644 --- a/core/aop-runtime/tsconfig.json +++ b/core/aop-runtime/tsconfig.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/aop-runtime/tsconfig.pub.json b/core/aop-runtime/tsconfig.pub.json index 64b22405..360cb192 100644 --- a/core/aop-runtime/tsconfig.pub.json +++ b/core/aop-runtime/tsconfig.pub.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/background-task/esm/package.json b/core/background-task/esm/package.json new file mode 100644 index 00000000..96ae6e57 --- /dev/null +++ b/core/background-task/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/core/background-task/package.json b/core/background-task/package.json index e4737387..abc5e729 100644 --- a/core/background-task/package.json +++ b/core/background-task/package.json @@ -10,16 +10,19 @@ "tegg" ], "main": "dist/index.js", + "module": "esm/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", "tsc": "npm run clean && tsc -p ./tsconfig.json", - "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json", + "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && tsc -p ./tsconfig.esm.json", "prepublishOnly": "npm run tsc:pub" }, "homepage": "https://github.com/eggjs/tegg", @@ -54,5 +57,17 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } } } diff --git a/core/background-task/tsconfig.esm.json b/core/background-task/tsconfig.esm.json new file mode 100644 index 00000000..a4d72b92 --- /dev/null +++ b/core/background-task/tsconfig.esm.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "outDir": "esm", + "baseUrl": "./" + }, + "exclude": [ + "dist", + "node_modules", + "test", + "esm" + ] +} diff --git a/core/background-task/tsconfig.json b/core/background-task/tsconfig.json index 64b22405..360cb192 100644 --- a/core/background-task/tsconfig.json +++ b/core/background-task/tsconfig.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/background-task/tsconfig.pub.json b/core/background-task/tsconfig.pub.json index 64b22405..360cb192 100644 --- a/core/background-task/tsconfig.pub.json +++ b/core/background-task/tsconfig.pub.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/common-util/esm/package.json b/core/common-util/esm/package.json new file mode 100644 index 00000000..96ae6e57 --- /dev/null +++ b/core/common-util/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/core/common-util/package.json b/core/common-util/package.json index 4849d1e4..358019d1 100644 --- a/core/common-util/package.json +++ b/core/common-util/package.json @@ -9,16 +9,19 @@ "tegg" ], "main": "dist/index.js", + "module": "esm/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", "tsc": "npm run clean && tsc -p ./tsconfig.json", - "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json", + "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && tsc -p ./tsconfig.esm.json", "prepublishOnly": "npm run tsc:pub" }, "author": "killagu ", @@ -51,5 +54,17 @@ "mocha": "^10.2.0", "ts-node": "^10.9.1", "typescript": "^5.0.4" + }, + "exports": { + ".": { + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } } } diff --git a/core/common-util/tsconfig.esm.json b/core/common-util/tsconfig.esm.json new file mode 100644 index 00000000..a4d72b92 --- /dev/null +++ b/core/common-util/tsconfig.esm.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "outDir": "esm", + "baseUrl": "./" + }, + "exclude": [ + "dist", + "node_modules", + "test", + "esm" + ] +} diff --git a/core/common-util/tsconfig.json b/core/common-util/tsconfig.json index 64b22405..360cb192 100644 --- a/core/common-util/tsconfig.json +++ b/core/common-util/tsconfig.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/common-util/tsconfig.pub.json b/core/common-util/tsconfig.pub.json index 64b22405..360cb192 100644 --- a/core/common-util/tsconfig.pub.json +++ b/core/common-util/tsconfig.pub.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/controller-decorator/esm/package.json b/core/controller-decorator/esm/package.json new file mode 100644 index 00000000..96ae6e57 --- /dev/null +++ b/core/controller-decorator/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/core/controller-decorator/package.json b/core/controller-decorator/package.json index 05840be0..42254658 100644 --- a/core/controller-decorator/package.json +++ b/core/controller-decorator/package.json @@ -10,16 +10,19 @@ "tegg" ], "main": "dist/index.js", + "module": "esm/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", "tsc": "npm run clean && tsc -p ./tsconfig.json", - "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json", + "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && tsc -p ./tsconfig.esm.json", "prepublishOnly": "npm run tsc:pub" }, "author": "killagu ", @@ -56,5 +59,17 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } } } diff --git a/core/controller-decorator/tsconfig.esm.json b/core/controller-decorator/tsconfig.esm.json new file mode 100644 index 00000000..a4d72b92 --- /dev/null +++ b/core/controller-decorator/tsconfig.esm.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "outDir": "esm", + "baseUrl": "./" + }, + "exclude": [ + "dist", + "node_modules", + "test", + "esm" + ] +} diff --git a/core/controller-decorator/tsconfig.json b/core/controller-decorator/tsconfig.json index 64b22405..360cb192 100644 --- a/core/controller-decorator/tsconfig.json +++ b/core/controller-decorator/tsconfig.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/controller-decorator/tsconfig.pub.json b/core/controller-decorator/tsconfig.pub.json index 64b22405..360cb192 100644 --- a/core/controller-decorator/tsconfig.pub.json +++ b/core/controller-decorator/tsconfig.pub.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/core-decorator/esm/package.json b/core/core-decorator/esm/package.json new file mode 100644 index 00000000..96ae6e57 --- /dev/null +++ b/core/core-decorator/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/core/core-decorator/package.json b/core/core-decorator/package.json index c26213b6..2eb6b8fa 100644 --- a/core/core-decorator/package.json +++ b/core/core-decorator/package.json @@ -9,16 +9,19 @@ "tegg" ], "main": "dist/index.js", + "module": "esm/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", "tsc": "npm run clean && tsc -p ./tsconfig.json", - "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json", + "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && tsc -p ./tsconfig.esm.json", "prepublishOnly": "npm run tsc:pub" }, "author": "killagu ", @@ -50,5 +53,17 @@ "mocha": "^10.2.0", "ts-node": "^10.9.1", "typescript": "^5.0.4" + }, + "exports": { + ".": { + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } } } diff --git a/core/core-decorator/tsconfig.esm.json b/core/core-decorator/tsconfig.esm.json new file mode 100644 index 00000000..a4d72b92 --- /dev/null +++ b/core/core-decorator/tsconfig.esm.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "outDir": "esm", + "baseUrl": "./" + }, + "exclude": [ + "dist", + "node_modules", + "test", + "esm" + ] +} diff --git a/core/core-decorator/tsconfig.json b/core/core-decorator/tsconfig.json index 64b22405..360cb192 100644 --- a/core/core-decorator/tsconfig.json +++ b/core/core-decorator/tsconfig.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/core-decorator/tsconfig.pub.json b/core/core-decorator/tsconfig.pub.json index 64b22405..360cb192 100644 --- a/core/core-decorator/tsconfig.pub.json +++ b/core/core-decorator/tsconfig.pub.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/dal-decorator/esm/package.json b/core/dal-decorator/esm/package.json new file mode 100644 index 00000000..96ae6e57 --- /dev/null +++ b/core/dal-decorator/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/core/dal-decorator/package.json b/core/dal-decorator/package.json index 0a3dc5db..353df3a3 100644 --- a/core/dal-decorator/package.json +++ b/core/dal-decorator/package.json @@ -10,16 +10,19 @@ "dal" ], "main": "dist/index.js", + "module": "esm/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", "tsc": "npm run clean && tsc -p ./tsconfig.json", - "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json", + "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && tsc -p ./tsconfig.esm.json", "prepublishOnly": "npm run tsc:pub" }, "author": "killagu ", @@ -53,5 +56,17 @@ "mocha": "^10.2.0", "ts-node": "^10.9.1", "typescript": "^5.0.4" + }, + "exports": { + ".": { + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } } } diff --git a/core/dal-decorator/tsconfig.esm.json b/core/dal-decorator/tsconfig.esm.json new file mode 100644 index 00000000..a4d72b92 --- /dev/null +++ b/core/dal-decorator/tsconfig.esm.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "outDir": "esm", + "baseUrl": "./" + }, + "exclude": [ + "dist", + "node_modules", + "test", + "esm" + ] +} diff --git a/core/dal-decorator/tsconfig.json b/core/dal-decorator/tsconfig.json index 64b22405..360cb192 100644 --- a/core/dal-decorator/tsconfig.json +++ b/core/dal-decorator/tsconfig.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/dal-decorator/tsconfig.pub.json b/core/dal-decorator/tsconfig.pub.json index 64b22405..360cb192 100644 --- a/core/dal-decorator/tsconfig.pub.json +++ b/core/dal-decorator/tsconfig.pub.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/dal-runtime/esm/package.json b/core/dal-runtime/esm/package.json new file mode 100644 index 00000000..96ae6e57 --- /dev/null +++ b/core/dal-runtime/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/core/dal-runtime/package.json b/core/dal-runtime/package.json index 74714abc..08a9539a 100644 --- a/core/dal-runtime/package.json +++ b/core/dal-runtime/package.json @@ -10,18 +10,22 @@ "dal" ], "main": "dist/index.js", + "module": "esm/index.js", "files": [ "dist/**/*.js", "dist/**/*.d.ts", - "dist/**/*.njk" + "dist/**/*.njk", + "esm/**/*.js", + "esm/**/*.d.ts", + "esm/**/*.njk" ], "typings": "dist/index.d.ts", "scripts": { "test": "cross-env NODE_ENV=test NODE_OPTIONS='--no-deprecation' mocha", "clean": "tsc -b --clean", "tsc": "npm run clean && tsc -p ./tsconfig.json", - "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && npm run cp:template", - "cp:template": "rm -rf dist/src/templates && cp -r src/templates dist/src/templates", + "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && tsc -p ./tsconfig.esm.json && npm run cp:template", + "cp:template": "rm -rf dist/src/templates && cp -r src/templates dist/src/templates && rm -rf esm/src/templates && cp -r src/templates esm/src/templates", "prepublishOnly": "npm run tsc:pub" }, "author": "killagu ", diff --git a/core/dal-runtime/tsconfig.esm.json b/core/dal-runtime/tsconfig.esm.json new file mode 100644 index 00000000..a4d72b92 --- /dev/null +++ b/core/dal-runtime/tsconfig.esm.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "outDir": "esm", + "baseUrl": "./" + }, + "exclude": [ + "dist", + "node_modules", + "test", + "esm" + ] +} diff --git a/core/dal-runtime/tsconfig.json b/core/dal-runtime/tsconfig.json index 00f8bd8e..ad984214 100644 --- a/core/dal-runtime/tsconfig.json +++ b/core/dal-runtime/tsconfig.json @@ -8,6 +8,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/dal-runtime/tsconfig.pub.json b/core/dal-runtime/tsconfig.pub.json index 00f8bd8e..ad984214 100644 --- a/core/dal-runtime/tsconfig.pub.json +++ b/core/dal-runtime/tsconfig.pub.json @@ -8,6 +8,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/dynamic-inject-runtime/esm/package.json b/core/dynamic-inject-runtime/esm/package.json new file mode 100644 index 00000000..96ae6e57 --- /dev/null +++ b/core/dynamic-inject-runtime/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/core/dynamic-inject-runtime/package.json b/core/dynamic-inject-runtime/package.json index d91d752f..74ca5fbe 100644 --- a/core/dynamic-inject-runtime/package.json +++ b/core/dynamic-inject-runtime/package.json @@ -3,12 +3,15 @@ "version": "3.39.0", "description": "tegg dyniamic inject", "main": "dist/index.js", + "module": "esm/index.js", "eggModule": { "name": "teggDyniamicInjectRuntime" }, "files": [ "dist/**/*.js", - "dist/**/*.d.ts" + "dist/**/*.d.ts", + "esm/**/*.js", + "esm/**/*.d.ts" ], "typings": "dist/index.d.ts", "keywords": [ @@ -21,7 +24,7 @@ "test": "cross-env NODE_ENV=test NODE_OPTIONS='--no-deprecation' mocha", "clean": "tsc -b --clean && rm -rf dist", "tsc": "npm run clean && tsc -p ./tsconfig.json", - "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json", + "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && tsc -p ./tsconfig.esm.json", "prepublishOnly": "npm run tsc:pub" }, "author": "killagu ", @@ -59,5 +62,17 @@ "mocha": "^10.2.0", "ts-node": "^10.9.1", "typescript": "^5.0.4" + }, + "exports": { + ".": { + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } } } diff --git a/core/dynamic-inject-runtime/tsconfig.esm.json b/core/dynamic-inject-runtime/tsconfig.esm.json new file mode 100644 index 00000000..a4d72b92 --- /dev/null +++ b/core/dynamic-inject-runtime/tsconfig.esm.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "outDir": "esm", + "baseUrl": "./" + }, + "exclude": [ + "dist", + "node_modules", + "test", + "esm" + ] +} diff --git a/core/dynamic-inject-runtime/tsconfig.json b/core/dynamic-inject-runtime/tsconfig.json index 64b22405..360cb192 100644 --- a/core/dynamic-inject-runtime/tsconfig.json +++ b/core/dynamic-inject-runtime/tsconfig.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/dynamic-inject-runtime/tsconfig.pub.json b/core/dynamic-inject-runtime/tsconfig.pub.json index 64b22405..360cb192 100644 --- a/core/dynamic-inject-runtime/tsconfig.pub.json +++ b/core/dynamic-inject-runtime/tsconfig.pub.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/dynamic-inject/esm/package.json b/core/dynamic-inject/esm/package.json new file mode 100644 index 00000000..96ae6e57 --- /dev/null +++ b/core/dynamic-inject/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/core/dynamic-inject/package.json b/core/dynamic-inject/package.json index 07d67219..1429496a 100644 --- a/core/dynamic-inject/package.json +++ b/core/dynamic-inject/package.json @@ -3,9 +3,12 @@ "version": "3.39.0", "description": "tegg dyniamic inject", "main": "dist/index.js", + "module": "esm/index.js", "files": [ "dist/**/*.js", - "dist/**/*.d.ts" + "dist/**/*.d.ts", + "esm/**/*.js", + "esm/**/*.d.ts" ], "typings": "dist/index.d.ts", "keywords": [ @@ -18,7 +21,7 @@ "test": "cross-env NODE_ENV=test NODE_OPTIONS='--no-deprecation' mocha", "clean": "tsc -b --clean", "tsc": "npm run clean && tsc -p ./tsconfig.json", - "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json", + "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && tsc -p ./tsconfig.esm.json", "prepublishOnly": "npm run tsc:pub" }, "author": "killagu ", @@ -50,5 +53,17 @@ "mocha": "^10.2.0", "ts-node": "^10.9.1", "typescript": "^5.0.4" + }, + "exports": { + ".": { + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } } } diff --git a/core/dynamic-inject/tsconfig.esm.json b/core/dynamic-inject/tsconfig.esm.json new file mode 100644 index 00000000..a4d72b92 --- /dev/null +++ b/core/dynamic-inject/tsconfig.esm.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "outDir": "esm", + "baseUrl": "./" + }, + "exclude": [ + "dist", + "node_modules", + "test", + "esm" + ] +} diff --git a/core/dynamic-inject/tsconfig.json b/core/dynamic-inject/tsconfig.json index 64b22405..360cb192 100644 --- a/core/dynamic-inject/tsconfig.json +++ b/core/dynamic-inject/tsconfig.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/dynamic-inject/tsconfig.pub.json b/core/dynamic-inject/tsconfig.pub.json index 64b22405..360cb192 100644 --- a/core/dynamic-inject/tsconfig.pub.json +++ b/core/dynamic-inject/tsconfig.pub.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/eventbus-decorator/esm/package.json b/core/eventbus-decorator/esm/package.json new file mode 100644 index 00000000..96ae6e57 --- /dev/null +++ b/core/eventbus-decorator/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/core/eventbus-decorator/package.json b/core/eventbus-decorator/package.json index cfb3bed4..50c36713 100644 --- a/core/eventbus-decorator/package.json +++ b/core/eventbus-decorator/package.json @@ -10,9 +10,12 @@ "tegg" ], "main": "dist/index.js", + "module": "esm/index.js", "files": [ "dist/**/*.js", - "dist/**/*.d.ts" + "dist/**/*.d.ts", + "esm/**/*.js", + "esm/**/*.d.ts" ], "typings": "dist/index.d.ts", "scripts": { @@ -53,5 +56,17 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } } } diff --git a/core/eventbus-decorator/tsconfig.esm.json b/core/eventbus-decorator/tsconfig.esm.json new file mode 100644 index 00000000..a4d72b92 --- /dev/null +++ b/core/eventbus-decorator/tsconfig.esm.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "outDir": "esm", + "baseUrl": "./" + }, + "exclude": [ + "dist", + "node_modules", + "test", + "esm" + ] +} diff --git a/core/eventbus-decorator/tsconfig.json b/core/eventbus-decorator/tsconfig.json index 64b22405..360cb192 100644 --- a/core/eventbus-decorator/tsconfig.json +++ b/core/eventbus-decorator/tsconfig.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/eventbus-decorator/tsconfig.pub.json b/core/eventbus-decorator/tsconfig.pub.json index 64b22405..360cb192 100644 --- a/core/eventbus-decorator/tsconfig.pub.json +++ b/core/eventbus-decorator/tsconfig.pub.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/eventbus-runtime/esm/package.json b/core/eventbus-runtime/esm/package.json new file mode 100644 index 00000000..96ae6e57 --- /dev/null +++ b/core/eventbus-runtime/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/core/eventbus-runtime/package.json b/core/eventbus-runtime/package.json index a4bab88c..0bec999c 100644 --- a/core/eventbus-runtime/package.json +++ b/core/eventbus-runtime/package.json @@ -13,16 +13,19 @@ "name": "eventbusRuntime" }, "main": "dist/index.js", + "module": "esm/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 && rm -rf dist", "tsc": "npm run clean && tsc -p ./tsconfig.json", - "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json", + "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && tsc -p ./tsconfig.esm.json", "prepublishOnly": "npm run tsc:pub" }, "author": "killagu ", @@ -63,5 +66,17 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } } } diff --git a/core/eventbus-runtime/tsconfig.esm.json b/core/eventbus-runtime/tsconfig.esm.json new file mode 100644 index 00000000..a4d72b92 --- /dev/null +++ b/core/eventbus-runtime/tsconfig.esm.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "outDir": "esm", + "baseUrl": "./" + }, + "exclude": [ + "dist", + "node_modules", + "test", + "esm" + ] +} diff --git a/core/eventbus-runtime/tsconfig.json b/core/eventbus-runtime/tsconfig.json index 64b22405..360cb192 100644 --- a/core/eventbus-runtime/tsconfig.json +++ b/core/eventbus-runtime/tsconfig.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/eventbus-runtime/tsconfig.pub.json b/core/eventbus-runtime/tsconfig.pub.json index 64b22405..360cb192 100644 --- a/core/eventbus-runtime/tsconfig.pub.json +++ b/core/eventbus-runtime/tsconfig.pub.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/lifecycle/esm/package.json b/core/lifecycle/esm/package.json new file mode 100644 index 00000000..96ae6e57 --- /dev/null +++ b/core/lifecycle/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/core/lifecycle/package.json b/core/lifecycle/package.json index 62bcba96..c7af7d8e 100644 --- a/core/lifecycle/package.json +++ b/core/lifecycle/package.json @@ -9,16 +9,19 @@ "tegg" ], "main": "dist/index.js", + "module": "esm/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", "tsc": "npm run clean && tsc -p ./tsconfig.json", - "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json", + "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && tsc -p ./tsconfig.esm.json", "prepublishOnly": "npm run tsc:pub" }, "author": "killagu ", @@ -51,5 +54,17 @@ "mocha": "^10.2.0", "ts-node": "^10.9.1", "typescript": "^5.0.4" + }, + "exports": { + ".": { + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } } } diff --git a/core/lifecycle/tsconfig.esm.json b/core/lifecycle/tsconfig.esm.json new file mode 100644 index 00000000..a4d72b92 --- /dev/null +++ b/core/lifecycle/tsconfig.esm.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "outDir": "esm", + "baseUrl": "./" + }, + "exclude": [ + "dist", + "node_modules", + "test", + "esm" + ] +} diff --git a/core/lifecycle/tsconfig.json b/core/lifecycle/tsconfig.json index ed206ac6..360cb192 100644 --- a/core/lifecycle/tsconfig.json +++ b/core/lifecycle/tsconfig.json @@ -6,6 +6,8 @@ }, "exclude": [ "dist", - "node_modules" + "node_modules", + "test", + "esm" ] } diff --git a/core/lifecycle/tsconfig.pub.json b/core/lifecycle/tsconfig.pub.json index 64b22405..360cb192 100644 --- a/core/lifecycle/tsconfig.pub.json +++ b/core/lifecycle/tsconfig.pub.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/loader/esm/package.json b/core/loader/esm/package.json new file mode 100644 index 00000000..96ae6e57 --- /dev/null +++ b/core/loader/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/core/loader/package.json b/core/loader/package.json index 1e963354..c34967c5 100644 --- a/core/loader/package.json +++ b/core/loader/package.json @@ -9,16 +9,19 @@ "tegg" ], "main": "dist/index.js", + "module": "esm/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", "tsc": "npm run clean && tsc -p ./tsconfig.json", - "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json", + "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && tsc -p ./tsconfig.esm.json", "prepublishOnly": "npm run tsc:pub" }, "author": "killagu ", @@ -53,5 +56,17 @@ "mocha": "^10.2.0", "ts-node": "^10.9.1", "typescript": "^5.0.4" + }, + "exports": { + ".": { + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } } } diff --git a/core/loader/tsconfig.esm.json b/core/loader/tsconfig.esm.json new file mode 100644 index 00000000..a4d72b92 --- /dev/null +++ b/core/loader/tsconfig.esm.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "outDir": "esm", + "baseUrl": "./" + }, + "exclude": [ + "dist", + "node_modules", + "test", + "esm" + ] +} diff --git a/core/loader/tsconfig.json b/core/loader/tsconfig.json index 64b22405..360cb192 100644 --- a/core/loader/tsconfig.json +++ b/core/loader/tsconfig.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/loader/tsconfig.pub.json b/core/loader/tsconfig.pub.json index 64b22405..360cb192 100644 --- a/core/loader/tsconfig.pub.json +++ b/core/loader/tsconfig.pub.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/metadata/esm/package.json b/core/metadata/esm/package.json new file mode 100644 index 00000000..96ae6e57 --- /dev/null +++ b/core/metadata/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/core/metadata/package.json b/core/metadata/package.json index 7d1d4077..398ca435 100644 --- a/core/metadata/package.json +++ b/core/metadata/package.json @@ -9,15 +9,18 @@ "tegg" ], "main": "dist/index.js", + "module": "esm/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", - "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json", + "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && tsc -p ./tsconfig.esm.json", "prepublishOnly": "npm run tsc:pub" }, "author": "killagu ", @@ -53,5 +56,17 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } } } diff --git a/core/metadata/tsconfig.esm.json b/core/metadata/tsconfig.esm.json new file mode 100644 index 00000000..a4d72b92 --- /dev/null +++ b/core/metadata/tsconfig.esm.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "outDir": "esm", + "baseUrl": "./" + }, + "exclude": [ + "dist", + "node_modules", + "test", + "esm" + ] +} diff --git a/core/metadata/tsconfig.json b/core/metadata/tsconfig.json index 64b22405..360cb192 100644 --- a/core/metadata/tsconfig.json +++ b/core/metadata/tsconfig.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/metadata/tsconfig.pub.json b/core/metadata/tsconfig.pub.json index 64b22405..360cb192 100644 --- a/core/metadata/tsconfig.pub.json +++ b/core/metadata/tsconfig.pub.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/orm-decorator/esm/package.json b/core/orm-decorator/esm/package.json new file mode 100644 index 00000000..96ae6e57 --- /dev/null +++ b/core/orm-decorator/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/core/orm-decorator/package.json b/core/orm-decorator/package.json index c7482460..8bc08896 100644 --- a/core/orm-decorator/package.json +++ b/core/orm-decorator/package.json @@ -3,9 +3,12 @@ "version": "3.39.0", "description": "tegg orm decorator", "main": "dist/index.js", + "module": "esm/index.js", "files": [ "dist/**/*.js", - "dist/**/*.d.ts" + "dist/**/*.d.ts", + "esm/**/*.js", + "esm/**/*.d.ts" ], "typings": "dist/index.d.ts", "keywords": [ @@ -18,7 +21,7 @@ "test": "cross-env NODE_ENV=test NODE_OPTIONS='--no-deprecation' mocha", "clean": "tsc -b --clean", "tsc": "npm run clean && tsc -p ./tsconfig.json", - "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json", + "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && tsc -p ./tsconfig.esm.json", "prepublishOnly": "npm run tsc:pub" }, "author": "killagu ", @@ -56,5 +59,17 @@ "mocha": "^10.2.0", "ts-node": "^10.9.1", "typescript": "^5.0.4" + }, + "exports": { + ".": { + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } } } diff --git a/core/orm-decorator/tsconfig.esm.json b/core/orm-decorator/tsconfig.esm.json new file mode 100644 index 00000000..a4d72b92 --- /dev/null +++ b/core/orm-decorator/tsconfig.esm.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "outDir": "esm", + "baseUrl": "./" + }, + "exclude": [ + "dist", + "node_modules", + "test", + "esm" + ] +} diff --git a/core/orm-decorator/tsconfig.json b/core/orm-decorator/tsconfig.json index 64b22405..360cb192 100644 --- a/core/orm-decorator/tsconfig.json +++ b/core/orm-decorator/tsconfig.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/orm-decorator/tsconfig.pub.json b/core/orm-decorator/tsconfig.pub.json index 64b22405..360cb192 100644 --- a/core/orm-decorator/tsconfig.pub.json +++ b/core/orm-decorator/tsconfig.pub.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/runtime/esm/package.json b/core/runtime/esm/package.json new file mode 100644 index 00000000..96ae6e57 --- /dev/null +++ b/core/runtime/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/core/runtime/package.json b/core/runtime/package.json index 324644a4..2718c325 100644 --- a/core/runtime/package.json +++ b/core/runtime/package.json @@ -3,9 +3,12 @@ "version": "3.39.0", "description": "tegg runtime", "main": "dist/index.js", + "module": "esm/index.js", "files": [ "dist/**/*.js", - "dist/**/*.d.ts" + "dist/**/*.d.ts", + "esm/**/*.js", + "esm/**/*.d.ts" ], "typings": "dist/index.d.ts", "keywords": [ @@ -18,7 +21,7 @@ "test": "cross-env NODE_ENV=test NODE_OPTIONS='--no-deprecation' mocha", "clean": "tsc -b --clean", "tsc": "npm run clean && tsc -p ./tsconfig.json", - "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json", + "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && tsc -p ./tsconfig.esm.json", "prepublishOnly": "npm run tsc:pub" }, "author": "killagu ", @@ -54,5 +57,17 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } } } diff --git a/core/runtime/tsconfig.esm.json b/core/runtime/tsconfig.esm.json new file mode 100644 index 00000000..a4d72b92 --- /dev/null +++ b/core/runtime/tsconfig.esm.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "outDir": "esm", + "baseUrl": "./" + }, + "exclude": [ + "dist", + "node_modules", + "test", + "esm" + ] +} diff --git a/core/runtime/tsconfig.json b/core/runtime/tsconfig.json index 64b22405..360cb192 100644 --- a/core/runtime/tsconfig.json +++ b/core/runtime/tsconfig.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/runtime/tsconfig.pub.json b/core/runtime/tsconfig.pub.json index 64b22405..360cb192 100644 --- a/core/runtime/tsconfig.pub.json +++ b/core/runtime/tsconfig.pub.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/schedule-decorator/esm/package.json b/core/schedule-decorator/esm/package.json new file mode 100644 index 00000000..96ae6e57 --- /dev/null +++ b/core/schedule-decorator/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/core/schedule-decorator/package.json b/core/schedule-decorator/package.json index 196db030..0e4dd668 100644 --- a/core/schedule-decorator/package.json +++ b/core/schedule-decorator/package.json @@ -3,9 +3,12 @@ "version": "3.39.0", "description": "tegg schedule decorator", "main": "dist/index.js", + "module": "esm/index.js", "files": [ "dist/**/*.js", - "dist/**/*.d.ts" + "dist/**/*.d.ts", + "esm/**/*.js", + "esm/**/*.d.ts" ], "typings": "dist/index.d.ts", "keywords": [ @@ -17,7 +20,7 @@ "scripts": { "clean": "tsc -b --clean", "tsc": "npm run clean && tsc -p ./tsconfig.json", - "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json", + "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && tsc -p ./tsconfig.esm.json", "prepublishOnly": "npm run tsc:pub" }, "author": "killagu ", @@ -52,5 +55,17 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } } } diff --git a/core/schedule-decorator/tsconfig.esm.json b/core/schedule-decorator/tsconfig.esm.json new file mode 100644 index 00000000..a4d72b92 --- /dev/null +++ b/core/schedule-decorator/tsconfig.esm.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "outDir": "esm", + "baseUrl": "./" + }, + "exclude": [ + "dist", + "node_modules", + "test", + "esm" + ] +} diff --git a/core/schedule-decorator/tsconfig.json b/core/schedule-decorator/tsconfig.json index 64b22405..360cb192 100644 --- a/core/schedule-decorator/tsconfig.json +++ b/core/schedule-decorator/tsconfig.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/schedule-decorator/tsconfig.pub.json b/core/schedule-decorator/tsconfig.pub.json index 64b22405..360cb192 100644 --- a/core/schedule-decorator/tsconfig.pub.json +++ b/core/schedule-decorator/tsconfig.pub.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/standalone-decorator/esm/package.json b/core/standalone-decorator/esm/package.json new file mode 100644 index 00000000..96ae6e57 --- /dev/null +++ b/core/standalone-decorator/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/core/standalone-decorator/package.json b/core/standalone-decorator/package.json index 8d9466ad..67b7b2d0 100644 --- a/core/standalone-decorator/package.json +++ b/core/standalone-decorator/package.json @@ -10,15 +10,18 @@ "standalone" ], "main": "dist/index.js", + "module": "esm/index.js", "files": [ "dist/**/*.js", - "dist/**/*.d.ts" + "dist/**/*.d.ts", + "esm/**/*.js", + "esm/**/*.d.ts" ], "typings": "dist/index.d.ts", "scripts": { "clean": "tsc -b --clean", "tsc": "npm run clean && tsc -p ./tsconfig.json", - "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json", + "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && tsc -p ./tsconfig.esm.json", "prepublishOnly": "npm run tsc:pub" }, "author": "killagu ", @@ -49,5 +52,17 @@ "mocha": "^10.2.0", "ts-node": "^10.9.1", "typescript": "^5.0.4" + }, + "exports": { + ".": { + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } } } diff --git a/core/standalone-decorator/tsconfig.esm.json b/core/standalone-decorator/tsconfig.esm.json new file mode 100644 index 00000000..a4d72b92 --- /dev/null +++ b/core/standalone-decorator/tsconfig.esm.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "outDir": "esm", + "baseUrl": "./" + }, + "exclude": [ + "dist", + "node_modules", + "test", + "esm" + ] +} diff --git a/core/standalone-decorator/tsconfig.json b/core/standalone-decorator/tsconfig.json index 64b22405..360cb192 100644 --- a/core/standalone-decorator/tsconfig.json +++ b/core/standalone-decorator/tsconfig.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/standalone-decorator/tsconfig.pub.json b/core/standalone-decorator/tsconfig.pub.json index 64b22405..360cb192 100644 --- a/core/standalone-decorator/tsconfig.pub.json +++ b/core/standalone-decorator/tsconfig.pub.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/tegg/esm/package.json b/core/tegg/esm/package.json new file mode 100644 index 00000000..96ae6e57 --- /dev/null +++ b/core/tegg/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/core/tegg/package.json b/core/tegg/package.json index 800e441d..eae28d83 100644 --- a/core/tegg/package.json +++ b/core/tegg/package.json @@ -9,15 +9,18 @@ "tegg" ], "main": "./index.js", + "module": "esm/index.js", "files": [ "*.js", - "*.d.ts" + "*.d.ts", + "esm/**/*.js", + "esm/**/*.d.ts" ], "typings": "index.d.ts", "scripts": { "test": "cross-env NODE_ENV=test NODE_OPTIONS='--no-deprecation' mocha", "clean": "tsc -b --clean", - "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json", + "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && tsc -p ./tsconfig.esm.json", "prepublishOnly": "npm run tsc:pub" }, "author": "killagu ", @@ -64,5 +67,17 @@ "mocha": "^10.2.0", "ts-node": "^10.9.1", "typescript": "^5.0.4" + }, + "exports": { + ".": { + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.js" + }, + "require": { + "types": "./index.d.ts", + "default": "./index.js" + } + } } } diff --git a/core/tegg/tsconfig.esm.json b/core/tegg/tsconfig.esm.json new file mode 100644 index 00000000..a4d72b92 --- /dev/null +++ b/core/tegg/tsconfig.esm.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "outDir": "esm", + "baseUrl": "./" + }, + "exclude": [ + "dist", + "node_modules", + "test", + "esm" + ] +} diff --git a/core/tegg/tsconfig.json b/core/tegg/tsconfig.json index 49122286..0f12f4fe 100644 --- a/core/tegg/tsconfig.json +++ b/core/tegg/tsconfig.json @@ -6,6 +6,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/tegg/tsconfig.pub.json b/core/tegg/tsconfig.pub.json index 49122286..0f12f4fe 100644 --- a/core/tegg/tsconfig.pub.json +++ b/core/tegg/tsconfig.pub.json @@ -6,6 +6,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/core/transaction-decorator/esm/package.json b/core/transaction-decorator/esm/package.json new file mode 100644 index 00000000..96ae6e57 --- /dev/null +++ b/core/transaction-decorator/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/core/transaction-decorator/package.json b/core/transaction-decorator/package.json index c03d5997..8d30f164 100644 --- a/core/transaction-decorator/package.json +++ b/core/transaction-decorator/package.json @@ -26,7 +26,7 @@ "test": "cross-env NODE_ENV=test NODE_OPTIONS='--no-deprecation' mocha", "clean": "tsc -b --clean", "tsc": "npm run clean && tsc -p ./tsconfig.json", - "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json", + "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && tsc -p ./tsconfig.esm.json", "prepublishOnly": "npm run tsc:pub" }, "publishConfig": { @@ -37,9 +37,12 @@ }, "license": "MIT", "main": "dist/index.js", + "module": "esm/index.js", "files": [ "dist/**/*.js", - "dist/**/*.d.ts" + "dist/**/*.d.ts", + "esm/**/*.js", + "esm/**/*.d.ts" ], "bugs": { "url": "https://github.com/eggjs/tegg/issues" @@ -51,5 +54,17 @@ "mocha": "^10.2.0", "ts-node": "^10.9.1", "typescript": "^5.0.4" + }, + "exports": { + ".": { + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } } } diff --git a/core/transaction-decorator/tsconfig.esm.json b/core/transaction-decorator/tsconfig.esm.json new file mode 100644 index 00000000..a4d72b92 --- /dev/null +++ b/core/transaction-decorator/tsconfig.esm.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "outDir": "esm", + "baseUrl": "./" + }, + "exclude": [ + "dist", + "node_modules", + "test", + "esm" + ] +} diff --git a/core/transaction-decorator/tsconfig.json b/core/transaction-decorator/tsconfig.json index ed206ac6..360cb192 100644 --- a/core/transaction-decorator/tsconfig.json +++ b/core/transaction-decorator/tsconfig.json @@ -6,6 +6,8 @@ }, "exclude": [ "dist", - "node_modules" + "node_modules", + "test", + "esm" ] } diff --git a/core/transaction-decorator/tsconfig.pub.json b/core/transaction-decorator/tsconfig.pub.json index 64b22405..360cb192 100644 --- a/core/transaction-decorator/tsconfig.pub.json +++ b/core/transaction-decorator/tsconfig.pub.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/plugin/dal/esm/package.json b/plugin/dal/esm/package.json new file mode 100644 index 00000000..96ae6e57 --- /dev/null +++ b/plugin/dal/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/plugin/dal/package.json b/plugin/dal/package.json index b24d03f0..d55e17c4 100644 --- a/plugin/dal/package.json +++ b/plugin/dal/package.json @@ -27,14 +27,16 @@ "lib/**/*.d.ts", "app/**/*.js", "app/**/*.d.ts", - "typings/*.d.ts" + "typings/*.d.ts", + "esm/**/*.js", + "esm/**/*.d.ts" ], "types": "typings/index.d.ts", "scripts": { "test": "cross-env NODE_ENV=test NODE_OPTIONS='--no-deprecation' mocha", "clean": "tsc -b --clean", "tsc": "npm run clean && tsc -p ./tsconfig.json", - "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json", + "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && tsc -p ./tsconfig.esm.json", "prepublishOnly": "npm run tsc:pub" }, "homepage": "https://github.com/eggjs/tegg", diff --git a/plugin/dal/tsconfig.esm.json b/plugin/dal/tsconfig.esm.json new file mode 100644 index 00000000..20434faf --- /dev/null +++ b/plugin/dal/tsconfig.esm.json @@ -0,0 +1,15 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "outDir": "esm", + "baseUrl": "./" + }, + "exclude": [ + "node_modules", + "test", + "esm" + ] +} diff --git a/plugin/dal/tsconfig.json b/plugin/dal/tsconfig.json index 74935f4b..210dc2ad 100644 --- a/plugin/dal/tsconfig.json +++ b/plugin/dal/tsconfig.json @@ -4,6 +4,7 @@ "baseUrl": "./" }, "exclude": [ - "node_modules" + "node_modules", + "esm" ] } diff --git a/plugin/dal/tsconfig.pub.json b/plugin/dal/tsconfig.pub.json index 8205bd19..74018e7f 100644 --- a/plugin/dal/tsconfig.pub.json +++ b/plugin/dal/tsconfig.pub.json @@ -5,6 +5,7 @@ }, "exclude": [ "node_modules", - "test" + "test", + "esm" ] } diff --git a/standalone/standalone/esm/package.json b/standalone/standalone/esm/package.json new file mode 100644 index 00000000..96ae6e57 --- /dev/null +++ b/standalone/standalone/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/standalone/standalone/package.json b/standalone/standalone/package.json index 65fffe73..3f050080 100644 --- a/standalone/standalone/package.json +++ b/standalone/standalone/package.json @@ -11,16 +11,19 @@ "standalone" ], "main": "dist/index.js", + "module": "esm/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", "tsc": "npm run clean && tsc -p ./tsconfig.json", - "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json", + "tsc:pub": "npm run clean && tsc -p ./tsconfig.pub.json && tsc -p ./tsconfig.esm.json", "prepublishOnly": "npm run tsc:pub" }, "homepage": "https://github.com/eggjs/tegg", @@ -61,5 +64,17 @@ "mocha": "^10.2.0", "ts-node": "^10.9.1", "typescript": "^5.0.4" + }, + "exports": { + ".": { + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } } } diff --git a/standalone/standalone/tsconfig.esm.json b/standalone/standalone/tsconfig.esm.json new file mode 100644 index 00000000..a4d72b92 --- /dev/null +++ b/standalone/standalone/tsconfig.esm.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "moduleResolution": "Bundler", + "module": "ESNext", + "target": "ESNext", + "outDir": "esm", + "baseUrl": "./" + }, + "exclude": [ + "dist", + "node_modules", + "test", + "esm" + ] +} diff --git a/standalone/standalone/tsconfig.json b/standalone/standalone/tsconfig.json index 64b22405..360cb192 100644 --- a/standalone/standalone/tsconfig.json +++ b/standalone/standalone/tsconfig.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] } diff --git a/standalone/standalone/tsconfig.pub.json b/standalone/standalone/tsconfig.pub.json index 64b22405..360cb192 100644 --- a/standalone/standalone/tsconfig.pub.json +++ b/standalone/standalone/tsconfig.pub.json @@ -7,6 +7,7 @@ "exclude": [ "dist", "node_modules", - "test" + "test", + "esm" ] }