From f338d89c8ef1d923bbe9c98ddb7d9cd240f7faf5 Mon Sep 17 00:00:00 2001 From: Zhiyuan Liang Date: Sun, 9 Nov 2025 14:41:57 +0800 Subject: [PATCH 1/3] fix rollup --- package.json | 6 +++--- rollup.config.mjs | 18 ++---------------- tsconfig.json | 13 +++++++++++-- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index f3b21a75..7c1493a5 100644 --- a/package.json +++ b/package.json @@ -12,11 +12,11 @@ "./package.json": "./package.json", ".": { "import": { - "types": "./types/index.d.ts", + "types": "./dist/types/index.d.ts", "default": "./dist/esm/index.js" }, "require": { - "types": "./types/index.d.ts", + "types": "./dist/types/index.d.ts", "default": "./dist/commonjs/index.js" } } @@ -26,7 +26,7 @@ "build-test": "npm run build-test-esm && npm run build-test-cjs", "build-test-esm": "tsc -p ./tsconfig.test.esm.json && cpy esm-package.json out/esm --rename=package.json", "build-test-cjs": "tsc -p ./tsconfig.test.cjs.json && cpy cjs-package.json out/commonjs --rename=package.json", - "clean": "rimraf dist dist-esm out types", + "clean": "rimraf dist out", "dev": "rollup --config --watch", "lint": "eslint src/ test/ examples/ --ext .js,.ts,.mjs", "fix-lint": "eslint src/ test/ examples/ --fix --ext .js,.ts,.mjs", diff --git a/rollup.config.mjs b/rollup.config.mjs index b7c3f495..b9c547c4 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -31,27 +31,13 @@ export default [ ], plugins: [ typescript({ - compilerOptions: { - "lib": [ - "DOM", - "WebWorker", - "ESNext" - ], - "skipDefaultLibCheck": true, - "module": "NodeNext", - "moduleResolution": "NodeNext", - "target": "ES2022", - "strictNullChecks": true, - "strictFunctionTypes": true, - "sourceMap": true, - "inlineSources": true - } + tsconfig: "./tsconfig.json", }) ], }, { input: "src/index.ts", - output: [{ file: "types/index.d.ts", format: "esm" }], + output: [{ file: "dist/types/index.d.ts", format: "esm" }], plugins: [dts()], }, ]; diff --git a/tsconfig.json b/tsconfig.json index 837eaf61..a41d6846 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,18 +1,27 @@ { "compilerOptions": { + // Include ES2022 (modern JS), ESNext (future features), DOM and web worker APIs for browser support. "lib": [ "DOM", "WebWorker", "ESNext", "ES2022" ], - "skipDefaultLibCheck": true, - "moduleResolution": "Node", + // Generate modern JavaScript syntax compatible with Node 18+ and modern browsers. "target": "ES2022", + + // Use Node-style resolution to locate imports + "moduleResolution": "Node", + + // Ensure strict type-checking "strictNullChecks": true, "strictFunctionTypes": true, + "skipDefaultLibCheck": true, + + // Generate source maps and inline original TypeScript sources for debugging. "sourceMap": true, "inlineSources": true, + "allowSyntheticDefaultImports": true, "esModuleInterop": true }, From 8a4b58aae3e0fffd3f6219fd78acdb03eced3244 Mon Sep 17 00:00:00 2001 From: Zhiyuan Liang Date: Sun, 9 Nov 2025 14:53:26 +0800 Subject: [PATCH 2/3] update comment --- tsconfig.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index a41d6846..e2538401 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,6 +13,10 @@ // Use Node-style resolution to locate imports "moduleResolution": "Node", + // Allow default imports from CommonJS modules. + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + // Ensure strict type-checking "strictNullChecks": true, "strictFunctionTypes": true, @@ -21,9 +25,6 @@ // Generate source maps and inline original TypeScript sources for debugging. "sourceMap": true, "inlineSources": true, - - "allowSyntheticDefaultImports": true, - "esModuleInterop": true }, "exclude": [ "node_modules", From 7d3fa362efbd5a093cc2dd7d1977d351cf161ca8 Mon Sep 17 00:00:00 2001 From: Zhiyuan Liang Date: Sun, 9 Nov 2025 15:07:12 +0800 Subject: [PATCH 3/3] update --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 7c1493a5..b61d93b3 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,6 @@ "description": "The JavaScript configuration provider for Azure App Configuration", "files": [ "dist/", - "types/", "LICENSE", "README.md" ],