From f5ed32d0f8bdfc40804418ae950d4b2b476d2d64 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Thu, 14 Sep 2023 12:38:21 -0700 Subject: [PATCH] chore: upgrade rollup --- package-lock.json | 433 +++++++++++++++---------- package.json | 9 +- scripts/build-api.ts | 2 +- scripts/build-atomics.ts | 6 +- scripts/build-integration.ts | 6 +- scripts/build-main-snippet.ts | 4 +- scripts/build-media-implementations.ts | 4 +- scripts/build-react.ts | 2 +- scripts/build-service-worker.ts | 10 +- scripts/build-services.ts | 2 +- scripts/build-utils.ts | 2 +- scripts/build-web-worker.ts | 8 +- scripts/index.ts | 24 +- scripts/minify.ts | 2 +- scripts/rollup.config.js | 5 +- scripts/utils.ts | 4 +- 16 files changed, 316 insertions(+), 207 deletions(-) diff --git a/package-lock.json b/package-lock.json index ed2affe3..64b4cab4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,17 +15,18 @@ "devDependencies": { "@microsoft/api-extractor": "^7.19.5", "@playwright/test": "^1.17.1", - "@types/fs-extra": "^9.0.13", + "@rollup/plugin-terser": "^0.4.3", + "@types/fs-extra": "^11.0.2", + "@types/node": "^18.17.15", "@types/react": "^17.0.42", "concurrently": "^7.0.0", "domino": "^2.1.6", - "fs-extra": "^10.0.1", + "fs-extra": "^11.1.1", "gzip-size": "^6.0.0", "np": "^7.6.1", "playwright": "^1.17.2", "prettier": "^2.6.0", - "rollup": "^2.70.1", - "rollup-plugin-terser": "^7.0.2", + "rollup": "^3.29.1", "tslib": "^2.3.1", "tsm": "^2.2.1", "typescript": "^4.6.2", @@ -879,6 +880,64 @@ "node": ">=8" } }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", + "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", + "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, "node_modules/@microsoft/api-extractor": { "version": "7.19.5", "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.19.5.tgz", @@ -1050,6 +1109,37 @@ "node": ">=0.1.90" } }, + "node_modules/@rollup/plugin-terser": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.3.tgz", + "integrity": "sha512-EF0oejTMtkyhrkwCdg0HJ0IpkcaVg1MMSf2olHb2Jp+1mnLM04OhjpJWGma4HobiDTF0WCyViWuvadyE9ch2XA==", + "dev": true, + "dependencies": { + "serialize-javascript": "^6.0.1", + "smob": "^1.0.0", + "terser": "^5.17.4" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.x || ^3.x" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-terser/node_modules/serialize-javascript": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", + "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, "node_modules/@rushstack/node-core-library": { "version": "3.45.1", "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.45.1.tgz", @@ -1067,6 +1157,12 @@ "z-schema": "~5.0.2" } }, + "node_modules/@rushstack/node-core-library/node_modules/@types/node": { + "version": "12.20.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.24.tgz", + "integrity": "sha512-yxDeaQIAJlMav7fH5AQqPH1u8YIuhYJXYBzxaQ4PifsU0GDO38MSdmEDeRlIxrKbC6NbEaaEHDanWb+y30U8SQ==", + "dev": true + }, "node_modules/@rushstack/node-core-library/node_modules/fs-extra": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", @@ -1193,11 +1289,12 @@ } }, "node_modules/@types/fs-extra": { - "version": "9.0.13", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.13.tgz", - "integrity": "sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==", + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.2.tgz", + "integrity": "sha512-c0hrgAOVYr21EX8J0jBMXGLMgJqVf/v6yxi0dLaJboW9aQPh16Id+z6w2Tx1hm+piJOLv8xPfVKZCLfjPw/IMQ==", "dev": true, "dependencies": { + "@types/jsonfile": "*", "@types/node": "*" } }, @@ -1231,6 +1328,15 @@ "@types/istanbul-lib-report": "*" } }, + "node_modules/@types/jsonfile": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/@types/jsonfile/-/jsonfile-6.1.1.tgz", + "integrity": "sha512-GSgiRCVeapDN+3pqA35IkQwasaCh/0YFH5dEF6S88iDvEn901DjOeH3/QPY+XYP1DFzDZPvIvfeEgk+7br5png==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/keyv": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.3.tgz", @@ -1247,9 +1353,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "12.20.24", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.24.tgz", - "integrity": "sha512-yxDeaQIAJlMav7fH5AQqPH1u8YIuhYJXYBzxaQ4PifsU0GDO38MSdmEDeRlIxrKbC6NbEaaEHDanWb+y30U8SQ==", + "version": "18.17.15", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.15.tgz", + "integrity": "sha512-2yrWpBk32tvV/JAd3HNHWuZn/VDN1P+72hWirHnvsvTGSqbANi+kSeuQR9yAHnbvaBvHDsoTdXV0Fe+iRtHLKA==", "dev": true }, "node_modules/@types/normalize-package-data": { @@ -1327,6 +1433,18 @@ "@types/node": "*" } }, + "node_modules/acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -2957,9 +3075,9 @@ } }, "node_modules/fs-extra": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.1.tgz", - "integrity": "sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==", + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz", + "integrity": "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==", "dev": true, "dependencies": { "graceful-fs": "^4.2.0", @@ -2967,7 +3085,7 @@ "universalify": "^2.0.0" }, "engines": { - "node": ">=12" + "node": ">=14.14" } }, "node_modules/fs.realpath": { @@ -4298,41 +4416,6 @@ "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" } }, - "node_modules/jest-worker": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", - "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", - "dev": true, - "dependencies": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" - }, - "engines": { - "node": ">= 10.13.0" - } - }, - "node_modules/jest-worker/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-worker/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/jju": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", @@ -6616,35 +6699,21 @@ } }, "node_modules/rollup": { - "version": "2.70.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.70.1.tgz", - "integrity": "sha512-CRYsI5EuzLbXdxC6RnYhOuRdtz4bhejPMSWjsFLfVM/7w/85n2szZv6yExqUXsBdz5KT8eoubeyDUDjhLHEslA==", + "version": "3.29.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.1.tgz", + "integrity": "sha512-c+ebvQz0VIH4KhhCpDsI+Bik0eT8ZFEVZEYw0cGMVqIP8zc+gnwl7iXCamTw7vzv2MeuZFZfdx5JJIq+ehzDlg==", "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-terser": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", - "integrity": "sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.10.4", - "jest-worker": "^26.2.1", - "serialize-javascript": "^4.0.0", - "terser": "^5.0.0" - }, - "peerDependencies": { - "rollup": "^2.0.0" - } - }, "node_modules/run-async": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", @@ -6764,15 +6833,6 @@ "semver": "bin/semver.js" } }, - "node_modules/serialize-javascript": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", - "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", - "dev": true, - "dependencies": { - "randombytes": "^2.1.0" - } - }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -6828,6 +6888,12 @@ "npm": ">= 3.0.0" } }, + "node_modules/smob": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/smob/-/smob-1.4.0.tgz", + "integrity": "sha512-MqR3fVulhjWuRNSMydnTlweu38UhQ0HXM4buStD/S3mc/BzX3CuM9OmhyQpmtYCvoYdl5ris6TI0ZqH355Ymqg==", + "dev": true + }, "node_modules/socks": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/socks/-/socks-2.6.1.tgz", @@ -7100,13 +7166,14 @@ } }, "node_modules/terser": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.10.0.tgz", - "integrity": "sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==", + "version": "5.19.4", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.4.tgz", + "integrity": "sha512-6p1DjHeuluwxDXcuT9VR8p64klWJKo1ILiy19s6C9+0Bh2+NWTX6nD9EPppiER4ICkHDVB1RkVpin/YW2nQn/g==", "dev": true, "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", "commander": "^2.20.0", - "source-map": "~0.7.2", "source-map-support": "~0.5.20" }, "bin": { @@ -7114,14 +7181,6 @@ }, "engines": { "node": ">=10" - }, - "peerDependencies": { - "acorn": "^8.5.0" - }, - "peerDependenciesMeta": { - "acorn": { - "optional": true - } } }, "node_modules/terser/node_modules/commander": { @@ -7130,15 +7189,6 @@ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, - "node_modules/terser/node_modules/source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, "node_modules/terser/node_modules/source-map-support": { "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", @@ -8379,6 +8429,55 @@ } } }, + "@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true + }, + "@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true + }, + "@jridgewell/source-map": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", + "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", + "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, "@microsoft/api-extractor": { "version": "7.19.5", "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.19.5.tgz", @@ -8525,6 +8624,28 @@ } } }, + "@rollup/plugin-terser": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.3.tgz", + "integrity": "sha512-EF0oejTMtkyhrkwCdg0HJ0IpkcaVg1MMSf2olHb2Jp+1mnLM04OhjpJWGma4HobiDTF0WCyViWuvadyE9ch2XA==", + "dev": true, + "requires": { + "serialize-javascript": "^6.0.1", + "smob": "^1.0.0", + "terser": "^5.17.4" + }, + "dependencies": { + "serialize-javascript": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", + "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + } + } + }, "@rushstack/node-core-library": { "version": "3.45.1", "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.45.1.tgz", @@ -8542,6 +8663,12 @@ "z-schema": "~5.0.2" }, "dependencies": { + "@types/node": { + "version": "12.20.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.24.tgz", + "integrity": "sha512-yxDeaQIAJlMav7fH5AQqPH1u8YIuhYJXYBzxaQ4PifsU0GDO38MSdmEDeRlIxrKbC6NbEaaEHDanWb+y30U8SQ==", + "dev": true + }, "fs-extra": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", @@ -8643,11 +8770,12 @@ } }, "@types/fs-extra": { - "version": "9.0.13", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.13.tgz", - "integrity": "sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==", + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.2.tgz", + "integrity": "sha512-c0hrgAOVYr21EX8J0jBMXGLMgJqVf/v6yxi0dLaJboW9aQPh16Id+z6w2Tx1hm+piJOLv8xPfVKZCLfjPw/IMQ==", "dev": true, "requires": { + "@types/jsonfile": "*", "@types/node": "*" } }, @@ -8681,6 +8809,15 @@ "@types/istanbul-lib-report": "*" } }, + "@types/jsonfile": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/@types/jsonfile/-/jsonfile-6.1.1.tgz", + "integrity": "sha512-GSgiRCVeapDN+3pqA35IkQwasaCh/0YFH5dEF6S88iDvEn901DjOeH3/QPY+XYP1DFzDZPvIvfeEgk+7br5png==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/keyv": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.3.tgz", @@ -8697,9 +8834,9 @@ "dev": true }, "@types/node": { - "version": "12.20.24", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.24.tgz", - "integrity": "sha512-yxDeaQIAJlMav7fH5AQqPH1u8YIuhYJXYBzxaQ4PifsU0GDO38MSdmEDeRlIxrKbC6NbEaaEHDanWb+y30U8SQ==", + "version": "18.17.15", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.15.tgz", + "integrity": "sha512-2yrWpBk32tvV/JAd3HNHWuZn/VDN1P+72hWirHnvsvTGSqbANi+kSeuQR9yAHnbvaBvHDsoTdXV0Fe+iRtHLKA==", "dev": true }, "@types/normalize-package-data": { @@ -8777,6 +8914,12 @@ "@types/node": "*" } }, + "acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "dev": true + }, "agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -9949,9 +10092,9 @@ } }, "fs-extra": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.1.tgz", - "integrity": "sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==", + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz", + "integrity": "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==", "dev": true, "requires": { "graceful-fs": "^4.2.0", @@ -10937,34 +11080,6 @@ "integrity": "sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ==", "dev": true }, - "jest-worker": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", - "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", - "dev": true, - "requires": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "jju": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", @@ -12671,26 +12786,14 @@ } }, "rollup": { - "version": "2.70.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.70.1.tgz", - "integrity": "sha512-CRYsI5EuzLbXdxC6RnYhOuRdtz4bhejPMSWjsFLfVM/7w/85n2szZv6yExqUXsBdz5KT8eoubeyDUDjhLHEslA==", + "version": "3.29.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.1.tgz", + "integrity": "sha512-c+ebvQz0VIH4KhhCpDsI+Bik0eT8ZFEVZEYw0cGMVqIP8zc+gnwl7iXCamTw7vzv2MeuZFZfdx5JJIq+ehzDlg==", "dev": true, "requires": { "fsevents": "~2.3.2" } }, - "rollup-plugin-terser": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", - "integrity": "sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.10.4", - "jest-worker": "^26.2.1", - "serialize-javascript": "^4.0.0", - "terser": "^5.0.0" - } - }, "run-async": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", @@ -12776,15 +12879,6 @@ } } }, - "serialize-javascript": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", - "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", - "dev": true, - "requires": { - "randombytes": "^2.1.0" - } - }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -12824,6 +12918,12 @@ "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", "dev": true }, + "smob": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/smob/-/smob-1.4.0.tgz", + "integrity": "sha512-MqR3fVulhjWuRNSMydnTlweu38UhQ0HXM4buStD/S3mc/BzX3CuM9OmhyQpmtYCvoYdl5ris6TI0ZqH355Ymqg==", + "dev": true + }, "socks": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/socks/-/socks-2.6.1.tgz", @@ -13038,13 +13138,14 @@ } }, "terser": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.10.0.tgz", - "integrity": "sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==", + "version": "5.19.4", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.4.tgz", + "integrity": "sha512-6p1DjHeuluwxDXcuT9VR8p64klWJKo1ILiy19s6C9+0Bh2+NWTX6nD9EPppiER4ICkHDVB1RkVpin/YW2nQn/g==", "dev": true, "requires": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", "commander": "^2.20.0", - "source-map": "~0.7.2", "source-map-support": "~0.5.20" }, "dependencies": { @@ -13054,12 +13155,6 @@ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, - "source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true - }, "source-map-support": { "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", diff --git a/package.json b/package.json index d1e13642..d95b8ee9 100644 --- a/package.json +++ b/package.json @@ -85,17 +85,18 @@ "devDependencies": { "@microsoft/api-extractor": "^7.19.5", "@playwright/test": "^1.17.1", - "@types/fs-extra": "^9.0.13", + "@rollup/plugin-terser": "^0.4.3", + "@types/fs-extra": "^11.0.2", + "@types/node": "^18.17.15", "@types/react": "^17.0.42", "concurrently": "^7.0.0", "domino": "^2.1.6", - "fs-extra": "^10.0.1", + "fs-extra": "^11.1.1", "gzip-size": "^6.0.0", "np": "^7.6.1", "playwright": "^1.17.2", "prettier": "^2.6.0", - "rollup": "^2.70.1", - "rollup-plugin-terser": "^7.0.2", + "rollup": "^3.29.1", "tslib": "^2.3.1", "tsm": "^2.2.1", "typescript": "^4.6.2", diff --git a/scripts/build-api.ts b/scripts/build-api.ts index eed07ebe..5344ff68 100644 --- a/scripts/build-api.ts +++ b/scripts/build-api.ts @@ -1,4 +1,4 @@ -import type { BuildOptions } from './utils'; +import type { BuildOptions } from './utils.js'; import { join } from 'path'; import { Extractor, ExtractorConfig } from '@microsoft/api-extractor'; diff --git a/scripts/build-atomics.ts b/scripts/build-atomics.ts index 84bb8fd9..ba2f9e3d 100644 --- a/scripts/build-atomics.ts +++ b/scripts/build-atomics.ts @@ -6,10 +6,10 @@ import { syncCommunicationModulesPlugin, versionPlugin, watchDir, -} from './utils'; +} from './utils.js'; import { join } from 'path'; -import { minifyPlugin } from './minify'; -import { webWorkerBlobUrlPlugin } from './build-web-worker'; +import { minifyPlugin } from './minify.js'; +import { webWorkerBlobUrlPlugin } from './build-web-worker.js'; export function buildAtomics(opts: BuildOptions): RollupOptions[] { const rollups: RollupOptions[] = []; diff --git a/scripts/build-integration.ts b/scripts/build-integration.ts index 25ed8cbc..d23f3af9 100644 --- a/scripts/build-integration.ts +++ b/scripts/build-integration.ts @@ -1,7 +1,9 @@ -import { BuildOptions, submodulePackageJson } from './utils'; +import { BuildOptions, submodulePackageJson } from './utils.js'; import { join } from 'path'; import type { OutputOptions, RollupOptions } from 'rollup'; -import { readFile } from 'fs-extra'; +import fsExtra from 'fs-extra'; + +const { readFile } = fsExtra; export function buildIntegration(opts: BuildOptions): RollupOptions { const output: OutputOptions[] = [ diff --git a/scripts/build-main-snippet.ts b/scripts/build-main-snippet.ts index 26023b60..08e74574 100644 --- a/scripts/build-main-snippet.ts +++ b/scripts/build-main-snippet.ts @@ -1,6 +1,6 @@ -import { BuildOptions, fileSize, jsBannerPlugin, versionPlugin } from './utils'; +import { BuildOptions, fileSize, jsBannerPlugin, versionPlugin } from './utils.js'; import { join } from 'path'; -import { minifyPlugin } from './minify'; +import { minifyPlugin } from './minify.js'; import type { OutputOptions, Plugin, RollupOptions } from 'rollup'; export function buildMainSnippet(opts: BuildOptions): RollupOptions { diff --git a/scripts/build-media-implementations.ts b/scripts/build-media-implementations.ts index a6e5c89c..89f5a011 100644 --- a/scripts/build-media-implementations.ts +++ b/scripts/build-media-implementations.ts @@ -1,7 +1,7 @@ import type { OutputOptions, RollupOptions } from 'rollup'; -import { BuildOptions, fileSize, jsBannerPlugin, versionPlugin, watchDir } from './utils'; +import { BuildOptions, fileSize, jsBannerPlugin, versionPlugin, watchDir } from './utils.js'; import { join } from 'path'; -import { minifyPlugin } from './minify'; +import { minifyPlugin } from './minify.js'; export function buildMediaImplementation(opts: BuildOptions): RollupOptions { const debugOutput: OutputOptions = { diff --git a/scripts/build-react.ts b/scripts/build-react.ts index 81c24f14..7288dc3c 100644 --- a/scripts/build-react.ts +++ b/scripts/build-react.ts @@ -1,4 +1,4 @@ -import { BuildOptions, submodulePackageJson, submodulePath } from './utils'; +import { BuildOptions, submodulePackageJson, submodulePath } from './utils.js'; import { join } from 'path'; import type { RollupOptions } from 'rollup'; diff --git a/scripts/build-service-worker.ts b/scripts/build-service-worker.ts index 55da5d58..6c25078c 100644 --- a/scripts/build-service-worker.ts +++ b/scripts/build-service-worker.ts @@ -8,11 +8,13 @@ import { syncCommunicationModulesPlugin, versionPlugin, watchDir, -} from './utils'; +} from './utils.js'; import { join } from 'path'; -import { minifyPlugin } from './minify'; -import { writeFile } from 'fs-extra'; -import { webWorkerBlobUrlPlugin } from './build-web-worker'; +import { minifyPlugin } from './minify.js'; +import fsExtra from 'fs-extra'; +import { webWorkerBlobUrlPlugin } from './build-web-worker.js'; + +const { writeFile } = fsExtra; export function buildServiceWorker(opts: BuildOptions): RollupOptions { const swDebug: OutputOptions = { diff --git a/scripts/build-services.ts b/scripts/build-services.ts index e657d776..08a90b23 100644 --- a/scripts/build-services.ts +++ b/scripts/build-services.ts @@ -1,4 +1,4 @@ -import { BuildOptions, submodulePackageJson } from './utils'; +import { BuildOptions, submodulePackageJson } from './utils.js'; import { join } from 'path'; import type { OutputOptions, RollupOptions } from 'rollup'; diff --git a/scripts/build-utils.ts b/scripts/build-utils.ts index f15e02fd..449613c6 100644 --- a/scripts/build-utils.ts +++ b/scripts/build-utils.ts @@ -1,4 +1,4 @@ -import { BuildOptions, submodulePackageJson } from './utils'; +import { BuildOptions, submodulePackageJson } from './utils.js'; import { join } from 'path'; import type { RollupOptions } from 'rollup'; diff --git a/scripts/build-web-worker.ts b/scripts/build-web-worker.ts index 6804f051..6bb3f4bf 100644 --- a/scripts/build-web-worker.ts +++ b/scripts/build-web-worker.ts @@ -6,10 +6,12 @@ import { onwarn, syncCommunicationModulesPlugin, versionPlugin, -} from './utils'; +} from './utils.js'; import { join } from 'path'; -import { writeFile } from 'fs-extra'; -import { minifyPlugin } from './minify'; +import fsExtra from 'fs-extra'; +import { minifyPlugin } from './minify.js'; + +const { writeFile } = fsExtra; export async function buildWebWorker(opts: BuildOptions, msgType: MessageType, debug: boolean) { const build = await rollup({ diff --git a/scripts/index.ts b/scripts/index.ts index bfeb52b8..394cbac5 100644 --- a/scripts/index.ts +++ b/scripts/index.ts @@ -1,16 +1,18 @@ -import type { BuildOptions, PackageJson } from './utils'; -import { buildApi } from './build-api'; -import { buildAtomics } from './build-atomics'; -import { buildIntegration } from './build-integration'; -import { buildMediaImplementation } from './build-media-implementations'; -import { buildMainSnippet } from './build-main-snippet'; -import { buildReact } from './build-react'; -import { buildServiceWorker } from './build-service-worker'; -import { buildServices } from './build-services'; -import { buildUtils } from './build-utils'; -import { emptyDir, ensureDir, readJsonSync, writeFile } from 'fs-extra'; +import type { BuildOptions, PackageJson } from './utils.js'; +import { buildApi } from './build-api.js'; +import { buildAtomics } from './build-atomics.js'; +import { buildIntegration } from './build-integration.js'; +import { buildMediaImplementation } from './build-media-implementations.js'; +import { buildMainSnippet } from './build-main-snippet.js'; +import { buildReact } from './build-react.js'; +import { buildServiceWorker } from './build-service-worker.js'; +import { buildServices } from './build-services.js'; +import { buildUtils } from './build-utils.js'; +import fsExtra from 'fs-extra'; import { join } from 'path'; +const { emptyDir, ensureDir, readJsonSync, writeFile } = fsExtra; + export async function runBuild(rootDir: string, isDev: boolean, isReleaseBuild: boolean) { const opts = createBuildOptions(rootDir, isDev, isReleaseBuild); diff --git a/scripts/minify.ts b/scripts/minify.ts index cf38f806..9cdba168 100644 --- a/scripts/minify.ts +++ b/scripts/minify.ts @@ -1,6 +1,6 @@ import type { BuildOptions } from './utils'; import type { Plugin } from 'rollup'; -import { terser } from 'rollup-plugin-terser'; +import terser from '@rollup/plugin-terser'; import type { MinifyOptions } from 'terser'; export function minifyPlugin(opts: BuildOptions, debug: boolean) { diff --git a/scripts/rollup.config.js b/scripts/rollup.config.js index 63c6b5d7..e50b131d 100644 --- a/scripts/rollup.config.js +++ b/scripts/rollup.config.js @@ -1,6 +1,9 @@ // build scripts are generated after tsc runs import { runBuild } from '../tsc/scripts/index.js'; -import { join } from 'path'; +import { dirname, join } from 'path'; +import { fileURLToPath } from 'url'; + +const __dirname = dirname(fileURLToPath(import.meta.url)); export default function (cmdArgs) { const rootDir = join(__dirname, '..'); diff --git a/scripts/utils.ts b/scripts/utils.ts index 46427147..6509a8f2 100644 --- a/scripts/utils.ts +++ b/scripts/utils.ts @@ -1,8 +1,10 @@ import gzipSize from 'gzip-size'; import { basename, join } from 'path'; -import { readdirSync, readFileSync, readJson, statSync, writeJson } from 'fs-extra'; +import fsExtra from 'fs-extra'; import type { Plugin, RollupWarning } from 'rollup'; +const { readdirSync, readFileSync, readJson, statSync, writeJson } = fsExtra; + export function syncCommunicationModulesPlugin(opts: BuildOptions, msgType: MessageType): Plugin { return { name: 'syncCommunicationModulesPlugin',