From a780ec41c9a6f4d06d217b89528003d6aa1371ce Mon Sep 17 00:00:00 2001 From: geylnu Date: Thu, 7 Sep 2023 10:50:00 +0800 Subject: [PATCH] refactor(repo): modify the declaration file to be a self-contained --- packages/alias/package.json | 4 ---- packages/auto-install/package.json | 4 ---- packages/babel/package.json | 4 ---- packages/buble/package.json | 4 ---- packages/commonjs/package.json | 4 ---- packages/data-uri/package.json | 4 ---- packages/dsv/package.json | 4 ---- packages/dynamic-import-vars/package.json | 4 ---- packages/eslint/package.json | 4 ---- packages/esm-shim/package.json | 6 +----- packages/graphql/package.json | 4 ---- packages/html/package.json | 4 ---- packages/image/package.json | 4 ---- packages/inject/package.json | 4 ---- packages/json/package.json | 4 ---- packages/legacy/package.json | 4 ---- packages/multi-entry/package.json | 4 ---- packages/node-resolve/package.json | 4 ---- packages/pluginutils/package.json | 4 ---- packages/replace/package.json | 4 ---- packages/run/package.json | 4 ---- packages/strip/package.json | 4 ---- packages/sucrase/package.json | 4 ---- packages/swc/package.json | 6 +----- packages/terser/package.json | 6 +----- packages/typescript/package.json | 6 +----- packages/url/package.json | 4 ---- packages/virtual/package.json | 4 ---- packages/wasm/package.json | 4 ---- packages/yaml/package.json | 4 ---- shared/rollup.config.mjs | 1 + 31 files changed, 5 insertions(+), 124 deletions(-) diff --git a/packages/alias/package.json b/packages/alias/package.json index 0f1a8d09e..602d87eb9 100755 --- a/packages/alias/package.json +++ b/packages/alias/package.json @@ -16,9 +16,6 @@ "main": "./dist/cjs/index.js", "module": "./dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -70,7 +67,6 @@ "rollup": "^4.0.0-24", "typescript": "^4.8.3" }, - "types": "./types/index.d.ts", "ava": { "files": [ "!**/fixtures/**", diff --git a/packages/auto-install/package.json b/packages/auto-install/package.json index 927ab15fe..a54979d5b 100755 --- a/packages/auto-install/package.json +++ b/packages/auto-install/package.json @@ -16,9 +16,6 @@ "main": "./dist/cjs/index.js", "module": "./dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -70,7 +67,6 @@ "rollup": "^4.0.0-24", "typescript": "^4.8.3" }, - "types": "./types/index.d.ts", "ava": { "workerThreads": false, "files": [ diff --git a/packages/babel/package.json b/packages/babel/package.json index 1da4c0e61..74d04477f 100644 --- a/packages/babel/package.json +++ b/packages/babel/package.json @@ -16,9 +16,6 @@ "main": "./dist/cjs/index.js", "module": "./dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -84,7 +81,6 @@ "rollup": "^4.0.0-24", "source-map": "^0.7.4" }, - "types": "./types/index.d.ts", "ava": { "files": [ "!**/fixtures/**", diff --git a/packages/buble/package.json b/packages/buble/package.json index d89338600..9470b0634 100644 --- a/packages/buble/package.json +++ b/packages/buble/package.json @@ -16,9 +16,6 @@ "main": "./dist/cjs/index.js", "module": "./dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -74,7 +71,6 @@ "source-map": "^0.7.4", "typescript": "^4.8.3" }, - "types": "./types/index.d.ts", "ava": { "workerThreads": false, "files": [ diff --git a/packages/commonjs/package.json b/packages/commonjs/package.json index a944d7400..d951f48f0 100644 --- a/packages/commonjs/package.json +++ b/packages/commonjs/package.json @@ -16,9 +16,6 @@ "main": "./dist/cjs/index.js", "module": "./dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -81,7 +78,6 @@ "source-map-support": "^0.5.21", "typescript": "^4.8.3" }, - "types": "./types/index.d.ts", "ava": { "workerThreads": false, "files": [ diff --git a/packages/data-uri/package.json b/packages/data-uri/package.json index e684ae0f8..3e1fd62f1 100644 --- a/packages/data-uri/package.json +++ b/packages/data-uri/package.json @@ -16,9 +16,6 @@ "main": "./dist/cjs/index.js", "module": "./dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -71,7 +68,6 @@ "rollup": "^4.0.0-24", "typescript": "^4.8.3" }, - "types": "./types/index.d.ts", "ava": { "workerThreads": false, "files": [ diff --git a/packages/dsv/package.json b/packages/dsv/package.json index 7b180fbdb..575a638aa 100755 --- a/packages/dsv/package.json +++ b/packages/dsv/package.json @@ -16,9 +16,6 @@ "main": "./dist/cjs/index.js", "module": "./dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -60,7 +57,6 @@ "del-cli": "^5.0.0", "rollup": "^4.0.0-24" }, - "types": "./types/index.d.ts", "ava": { "workerThreads": false, "files": [ diff --git a/packages/dynamic-import-vars/package.json b/packages/dynamic-import-vars/package.json index bc794796c..3674a5955 100644 --- a/packages/dynamic-import-vars/package.json +++ b/packages/dynamic-import-vars/package.json @@ -16,9 +16,6 @@ "main": "./dist/cjs/index.js", "module": "./dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -76,7 +73,6 @@ "prettier": "^2.7.1", "rollup": "^4.0.0-24" }, - "types": "./types/index.d.ts", "ava": { "workerThreads": false, "files": [ diff --git a/packages/eslint/package.json b/packages/eslint/package.json index bdd49e461..0a367bf9c 100755 --- a/packages/eslint/package.json +++ b/packages/eslint/package.json @@ -16,9 +16,6 @@ "main": "./dist/cjs/index.js", "module": "./dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -74,7 +71,6 @@ "rollup": "^4.0.0-24", "typescript": "^4.8.3" }, - "types": "./types/index.d.ts", "ava": { "files": [ "!**/fixtures/**", diff --git a/packages/esm-shim/package.json b/packages/esm-shim/package.json index e8d9cadb0..efb04a0f2 100644 --- a/packages/esm-shim/package.json +++ b/packages/esm-shim/package.json @@ -16,9 +16,6 @@ "main": "dist/cjs/index.js", "module": "dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -67,6 +64,5 @@ "devDependencies": { "rollup": "^4.0.0-24", "typescript": "^4.8.3" - }, - "types": "./types/index.d.ts" + } } diff --git a/packages/graphql/package.json b/packages/graphql/package.json index be5daaba1..5cbbacd84 100644 --- a/packages/graphql/package.json +++ b/packages/graphql/package.json @@ -16,9 +16,6 @@ "main": "./dist/cjs/index.js", "module": "./dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -73,7 +70,6 @@ "graphql": "^16.6.0", "rollup": "^4.0.0-24" }, - "types": "./types/index.d.ts", "ava": { "workerThreads": false, "files": [ diff --git a/packages/html/package.json b/packages/html/package.json index b6a0d56a4..6e962c297 100644 --- a/packages/html/package.json +++ b/packages/html/package.json @@ -16,9 +16,6 @@ "main": "./dist/cjs/index.js", "module": "./dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -67,7 +64,6 @@ "rollup-plugin-postcss": "^4.0.2", "typescript": "^4.8.3" }, - "types": "./types/index.d.ts", "ava": { "workerThreads": false, "files": [ diff --git a/packages/image/package.json b/packages/image/package.json index 87c57669d..a5f20f69e 100644 --- a/packages/image/package.json +++ b/packages/image/package.json @@ -16,9 +16,6 @@ "main": "./dist/cjs/index.js", "module": "./dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -67,7 +64,6 @@ "@rollup/plugin-buble": "^1.0.0", "rollup": "^4.0.0-24" }, - "types": "./types/index.d.ts", "ava": { "workerThreads": false, "files": [ diff --git a/packages/inject/package.json b/packages/inject/package.json index 8d437ad17..8b6569c5c 100644 --- a/packages/inject/package.json +++ b/packages/inject/package.json @@ -16,9 +16,6 @@ "main": "./dist/cjs/index.js", "module": "./dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -75,7 +72,6 @@ "source-map": "^0.7.4", "typescript": "^4.8.3" }, - "types": "./types/index.d.ts", "ava": { "files": [ "!**/fixtures/**", diff --git a/packages/json/package.json b/packages/json/package.json index 64b30dd91..007f14be0 100755 --- a/packages/json/package.json +++ b/packages/json/package.json @@ -16,9 +16,6 @@ "main": "./dist/cjs/index.js", "module": "./dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -71,7 +68,6 @@ "rollup": "^4.0.0-24", "source-map-support": "^0.5.21" }, - "types": "./types/index.d.ts", "ava": { "workerThreads": false, "files": [ diff --git a/packages/legacy/package.json b/packages/legacy/package.json index ee515da0f..ba5ce47b3 100644 --- a/packages/legacy/package.json +++ b/packages/legacy/package.json @@ -16,9 +16,6 @@ "main": "./dist/cjs/index.js", "module": "./dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -65,7 +62,6 @@ "del-cli": "^5.0.0", "rollup": "^4.0.0-24" }, - "types": "./types/index.d.ts", "ava": { "workerThreads": false, "files": [ diff --git a/packages/multi-entry/package.json b/packages/multi-entry/package.json index 1225e207f..f6208349b 100755 --- a/packages/multi-entry/package.json +++ b/packages/multi-entry/package.json @@ -16,9 +16,6 @@ "main": "./dist/cjs/index.js", "module": "./dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -68,7 +65,6 @@ "devDependencies": { "rollup": "^4.0.0-24" }, - "types": "./types/index.d.ts", "ava": { "files": [ "!**/fixtures/**", diff --git a/packages/node-resolve/package.json b/packages/node-resolve/package.json index 9f9455ab6..30522183e 100644 --- a/packages/node-resolve/package.json +++ b/packages/node-resolve/package.json @@ -16,9 +16,6 @@ "main": "./dist/cjs/index.js", "module": "./dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -81,7 +78,6 @@ "source-map": "^0.7.4", "string-capitalize": "^1.0.1" }, - "types": "./types/index.d.ts", "ava": { "workerThreads": false, "files": [ diff --git a/packages/pluginutils/package.json b/packages/pluginutils/package.json index 488a572f4..7cb1b9f0c 100644 --- a/packages/pluginutils/package.json +++ b/packages/pluginutils/package.json @@ -19,9 +19,6 @@ "module": "./dist/es/index.js", "type": "commonjs", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -77,7 +74,6 @@ "rollup": "^4.0.0-24", "typescript": "^4.8.3" }, - "types": "./types/index.d.ts", "ava": { "extensions": [ "ts" diff --git a/packages/replace/package.json b/packages/replace/package.json index 64875020a..0d271d388 100644 --- a/packages/replace/package.json +++ b/packages/replace/package.json @@ -16,9 +16,6 @@ "main": "dist/cjs/index.js", "module": "dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -74,7 +71,6 @@ "source-map": "^0.7.4", "typescript": "^4.8.3" }, - "types": "./types/index.d.ts", "ava": { "workerThreads": false, "files": [ diff --git a/packages/run/package.json b/packages/run/package.json index 5d295695a..122dabe6f 100644 --- a/packages/run/package.json +++ b/packages/run/package.json @@ -16,9 +16,6 @@ "main": "./dist/cjs/index.js", "module": "./dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -68,7 +65,6 @@ "sinon": "^14.0.0", "typescript": "^4.8.3" }, - "types": "./types/index.d.ts", "ava": { "workerThreads": false, "files": [ diff --git a/packages/strip/package.json b/packages/strip/package.json index 55f825aaf..c4d3bdffb 100644 --- a/packages/strip/package.json +++ b/packages/strip/package.json @@ -16,9 +16,6 @@ "main": "./dist/cjs/index.js", "module": "./dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -65,7 +62,6 @@ "acorn": "^8.8.0", "rollup": "^4.0.0-24" }, - "types": "./types/index.d.ts", "ava": { "files": [ "!**/fixtures/**", diff --git a/packages/sucrase/package.json b/packages/sucrase/package.json index cf7da0947..37a134fd0 100644 --- a/packages/sucrase/package.json +++ b/packages/sucrase/package.json @@ -17,9 +17,6 @@ "module": "./dist/es/index.js", "type": "commonjs", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -71,7 +68,6 @@ "@rollup/plugin-alias": "^4.0.0", "rollup": "^4.0.0-24" }, - "types": "./types/index.d.ts", "ava": { "workerThreads": false, "files": [ diff --git a/packages/swc/package.json b/packages/swc/package.json index 9d6b9331c..d9e270be1 100644 --- a/packages/swc/package.json +++ b/packages/swc/package.json @@ -16,9 +16,6 @@ "main": "dist/cjs/index.js", "module": "dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -71,6 +68,5 @@ "@swc/core": "^1.3.78", "rollup": "^4.0.0-24", "typescript": "^4.8.3" - }, - "types": "./types/index.d.ts" + } } diff --git a/packages/terser/package.json b/packages/terser/package.json index 68c5402f3..f93ea16c0 100644 --- a/packages/terser/package.json +++ b/packages/terser/package.json @@ -16,9 +16,6 @@ "main": "dist/cjs/index.js", "module": "dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -71,6 +68,5 @@ "@types/serialize-javascript": "^5.0.2", "rollup": "^4.0.0-24", "typescript": "^4.8.3" - }, - "types": "./types/index.d.ts" + } } diff --git a/packages/typescript/package.json b/packages/typescript/package.json index 361d850c5..b83e7ca8b 100644 --- a/packages/typescript/package.json +++ b/packages/typescript/package.json @@ -16,9 +16,6 @@ "main": "./dist/cjs/index.js", "module": "./dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -77,6 +74,5 @@ "buble": "^0.20.0", "rollup": "^4.0.0-24", "typescript": "^4.8.3" - }, - "types": "./types/index.d.ts" + } } diff --git a/packages/url/package.json b/packages/url/package.json index e75b2e6cb..8a1854623 100644 --- a/packages/url/package.json +++ b/packages/url/package.json @@ -16,9 +16,6 @@ "main": "./dist/cjs/index.js", "module": "./dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -68,7 +65,6 @@ "globby": "^11.1.0", "rollup": "^4.0.0-24" }, - "types": "./types/index.d.ts", "ava": { "workerThreads": false, "files": [ diff --git a/packages/virtual/package.json b/packages/virtual/package.json index 688fe6a11..873493a29 100755 --- a/packages/virtual/package.json +++ b/packages/virtual/package.json @@ -16,9 +16,6 @@ "main": "./dist/cjs/index.js", "module": "./dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -68,7 +65,6 @@ "rollup": "^4.0.0-24", "typescript": "^4.8.3" }, - "types": "./types/index.d.ts", "ava": { "files": [ "!**/fixtures/**", diff --git a/packages/wasm/package.json b/packages/wasm/package.json index 474fe9b30..601fa9e6b 100644 --- a/packages/wasm/package.json +++ b/packages/wasm/package.json @@ -16,9 +16,6 @@ "main": "./dist/cjs/index.js", "module": "./dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -74,7 +71,6 @@ "source-map": "^0.7.4", "typescript": "^4.8.3" }, - "types": "./types/index.d.ts", "ava": { "workerThreads": false, "files": [ diff --git a/packages/yaml/package.json b/packages/yaml/package.json index 434dc18b6..bf0689426 100755 --- a/packages/yaml/package.json +++ b/packages/yaml/package.json @@ -16,9 +16,6 @@ "main": "./dist/cjs/index.js", "module": "./dist/es/index.js", "exports": { - "types": { - "import": "./dist/es/index.d.ts" - }, "import": "./dist/es/index.js", "default": "./dist/cjs/index.js" }, @@ -69,7 +66,6 @@ "rollup": "^4.0.0-24", "source-map-support": "^0.5.21" }, - "types": "./types/index.d.ts", "ava": { "workerThreads": false, "files": [ diff --git a/shared/rollup.config.mjs b/shared/rollup.config.mjs index 817f166c5..a2652cf17 100644 --- a/shared/rollup.config.mjs +++ b/shared/rollup.config.mjs @@ -27,6 +27,7 @@ export function createConfig({ pkg, external = [] }) { file: pkg.main, exports: 'named', footer: 'module.exports = Object.assign(exports.default, exports);', + plugins: [emitDeclarationFile()], sourcemap: true }, {