From 3a867919a8bc73cc8ba452b32809f0859b945ba5 Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov <34244704+Lightning00Blade@users.noreply.github.com> Date: Thu, 2 Feb 2023 11:17:28 +0100 Subject: [PATCH] chore: Remove Rollup dts plugin (#9614) --- package-lock.json | 126 ++++-------------- package.json | 5 +- packages/puppeteer-core/package.json | 5 +- ...onfig.js => rollup.third_party.config.mjs} | 10 +- 4 files changed, 30 insertions(+), 116 deletions(-) rename packages/puppeteer-core/{rollup.third_party.config.js => rollup.third_party.config.mjs} (79%) diff --git a/package-lock.json b/package-lock.json index 07361d07..2c182272 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@microsoft/api-extractor": "7.33.7", "@microsoft/api-extractor-model": "7.25.3", "@pptr/testserver": "file:packages/testserver", - "@rollup/plugin-commonjs": "24.0.0", + "@rollup/plugin-commonjs": "24.0.1", "@rollup/plugin-node-resolve": "15.0.1", "@types/debug": "4.1.7", "@types/diff": "5.0.2", @@ -70,8 +70,7 @@ "pngjs": "6.0.0", "prettier": "2.8.1", "puppeteer": "file:packages/puppeteer", - "rollup": "2.79.1", - "rollup-plugin-dts": "4.2.2", + "rollup": "3.12.1", "semver": "7.3.8", "sinon": "15.0.1", "source-map-support": "0.5.21", @@ -1391,9 +1390,9 @@ "link": true }, "node_modules/@rollup/plugin-commonjs": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-24.0.0.tgz", - "integrity": "sha512-0w0wyykzdyRRPHOb0cQt14mIBLujfAv6GgP6g8nvg/iBxEm112t3YPPq+Buqe2+imvElTka+bjNlJ/gB56TD8g==", + "version": "24.0.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-24.0.1.tgz", + "integrity": "sha512-15LsiWRZk4eOGqvrJyu3z3DaBu5BhXIMeWnijSRvd8irrrg9SHpQ1pH+BUK4H6Z9wL9yOxZJMTLU+Au86XHxow==", "dev": true, "dependencies": { "@rollup/pluginutils": "^5.0.1", @@ -1421,18 +1420,6 @@ "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", "dev": true }, - "node_modules/@rollup/plugin-commonjs/node_modules/magic-string": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.27.0.tgz", - "integrity": "sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==", - "dev": true, - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.13" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/@rollup/plugin-node-resolve": { "version": "15.0.1", "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.0.1.tgz", @@ -5851,12 +5838,12 @@ } }, "node_modules/magic-string": { - "version": "0.26.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.26.7.tgz", - "integrity": "sha512-hX9XH3ziStPoPhJxLq1syWuZMxbDvGNbVchfrdCtanC7D13888bMFow61x8axrx+GfHLtVeAx2kxL7tTGRl+Ow==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.27.0.tgz", + "integrity": "sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==", "dev": true, "dependencies": { - "sourcemap-codec": "^1.4.8" + "@jridgewell/sourcemap-codec": "^1.4.13" }, "engines": { "node": ">=12" @@ -7363,55 +7350,21 @@ } }, "node_modules/rollup": { - "version": "2.79.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz", - "integrity": "sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==", + "version": "3.12.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.12.1.tgz", + "integrity": "sha512-t9elERrz2i4UU9z7AwISj3CQcXP39cWxgRWLdf4Tm6aKm1eYrqHIgjzXBgb67GNY1sZckTFFi0oMozh3/S++Ig==", "dev": true, "bin": { "rollup": "dist/bin/rollup" }, "engines": { - "node": ">=10.0.0" + "node": ">=14.18.0", + "npm": ">=8.0.0" }, "optionalDependencies": { "fsevents": "~2.3.2" } }, - "node_modules/rollup-plugin-dts": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-dts/-/rollup-plugin-dts-4.2.2.tgz", - "integrity": "sha512-A3g6Rogyko/PXeKoUlkjxkP++8UDVpgA7C+Tdl77Xj4fgEaIjPSnxRmR53EzvoYy97VMVwLAOcWJudaVAuxneQ==", - "dev": true, - "dependencies": { - "magic-string": "^0.26.1" - }, - "engines": { - "node": ">=v12.22.11" - }, - "funding": { - "url": "https://github.com/sponsors/Swatinem" - }, - "optionalDependencies": { - "@babel/code-frame": "^7.16.7" - }, - "peerDependencies": { - "rollup": "^2.55", - "typescript": "^4.1" - } - }, - "node_modules/rollup-plugin-dts/node_modules/@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", - "dev": true, - "optional": true, - "dependencies": { - "@babel/highlight": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/run-async": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", @@ -10074,9 +10027,9 @@ } }, "@rollup/plugin-commonjs": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-24.0.0.tgz", - "integrity": "sha512-0w0wyykzdyRRPHOb0cQt14mIBLujfAv6GgP6g8nvg/iBxEm112t3YPPq+Buqe2+imvElTka+bjNlJ/gB56TD8g==", + "version": "24.0.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-24.0.1.tgz", + "integrity": "sha512-15LsiWRZk4eOGqvrJyu3z3DaBu5BhXIMeWnijSRvd8irrrg9SHpQ1pH+BUK4H6Z9wL9yOxZJMTLU+Au86XHxow==", "dev": true, "requires": { "@rollup/pluginutils": "^5.0.1", @@ -10092,15 +10045,6 @@ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", "dev": true - }, - "magic-string": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.27.0.tgz", - "integrity": "sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==", - "dev": true, - "requires": { - "@jridgewell/sourcemap-codec": "^1.4.13" - } } } }, @@ -13318,12 +13262,12 @@ } }, "magic-string": { - "version": "0.26.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.26.7.tgz", - "integrity": "sha512-hX9XH3ziStPoPhJxLq1syWuZMxbDvGNbVchfrdCtanC7D13888bMFow61x8axrx+GfHLtVeAx2kxL7tTGRl+Ow==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.27.0.tgz", + "integrity": "sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==", "dev": true, "requires": { - "sourcemap-codec": "^1.4.8" + "@jridgewell/sourcemap-codec": "^1.4.13" } }, "make-dir": { @@ -14482,36 +14426,14 @@ } }, "rollup": { - "version": "2.79.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz", - "integrity": "sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==", + "version": "3.12.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.12.1.tgz", + "integrity": "sha512-t9elERrz2i4UU9z7AwISj3CQcXP39cWxgRWLdf4Tm6aKm1eYrqHIgjzXBgb67GNY1sZckTFFi0oMozh3/S++Ig==", "dev": true, "requires": { "fsevents": "~2.3.2" } }, - "rollup-plugin-dts": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-dts/-/rollup-plugin-dts-4.2.2.tgz", - "integrity": "sha512-A3g6Rogyko/PXeKoUlkjxkP++8UDVpgA7C+Tdl77Xj4fgEaIjPSnxRmR53EzvoYy97VMVwLAOcWJudaVAuxneQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.16.7", - "magic-string": "^0.26.1" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", - "dev": true, - "optional": true, - "requires": { - "@babel/highlight": "^7.18.6" - } - } - } - }, "run-async": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", diff --git a/package.json b/package.json index 5491334e..f63a0a72 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "@microsoft/api-extractor": "7.33.7", "@microsoft/api-extractor-model": "7.25.3", "@pptr/testserver": "file:packages/testserver", - "@rollup/plugin-commonjs": "24.0.0", + "@rollup/plugin-commonjs": "24.0.1", "@rollup/plugin-node-resolve": "15.0.1", "@types/debug": "4.1.7", "@types/diff": "5.0.2", @@ -96,8 +96,7 @@ "pngjs": "6.0.0", "prettier": "2.8.1", "puppeteer": "file:packages/puppeteer", - "rollup": "2.79.1", - "rollup-plugin-dts": "4.2.2", + "rollup": "3.12.1", "semver": "7.3.8", "sinon": "15.0.1", "source-map-support": "0.5.21", diff --git a/packages/puppeteer-core/package.json b/packages/puppeteer-core/package.json index 4ba29d50..e1588296 100644 --- a/packages/puppeteer-core/package.json +++ b/packages/puppeteer-core/package.json @@ -79,7 +79,7 @@ "command": "rimraf lib/esm/third_party lib/cjs/third_party" }, "build:third_party": { - "command": "rollup --config rollup.third_party.config.js", + "command": "rollup --config rollup.third_party.config.mjs", "dependencies": [ "build:tsc" ], @@ -105,7 +105,8 @@ "build:types": { "command": "api-extractor run --local", "dependencies": [ - "build:tsc" + "build:tsc", + "build:third_party" ], "files": [ "tsconfig.json", diff --git a/packages/puppeteer-core/rollup.third_party.config.js b/packages/puppeteer-core/rollup.third_party.config.mjs similarity index 79% rename from packages/puppeteer-core/rollup.third_party.config.js rename to packages/puppeteer-core/rollup.third_party.config.mjs index bc1ded50..826f19b9 100644 --- a/packages/puppeteer-core/rollup.third_party.config.js +++ b/packages/puppeteer-core/rollup.third_party.config.mjs @@ -14,7 +14,6 @@ * limitations under the License. */ import glob from 'glob'; -import dts from 'rollup-plugin-dts'; import {nodeResolve} from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; @@ -26,16 +25,9 @@ export default ['cjs', 'esm'].flatMap(outputType => { for (const jsFile of glob.sync(`${thirdPartyPath}/**/*.js`)) { configs.push({ input: jsFile, - output: {file: jsFile, format: outputType}, + output: {file: jsFile, format: outputType, dynamicImportInCjs: false}, plugins: [commonjs(), nodeResolve()], }); } - for (const typesFile of glob.sync(`${thirdPartyPath}/**/*.d.ts`)) { - configs.push({ - input: typesFile, - output: {file: typesFile, format: outputType}, - plugins: [dts({respectExternal: true})], - }); - } return configs; });