From 4576ef3dfaf83415b319c851acd1a85b100e4ad1 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Mon, 18 Sep 2023 06:19:29 +0200 Subject: [PATCH 01/44] [v4.0] Set minimum Node version to 18 --- .github/workflows/repl-artefacts.yml | 2 +- .github/workflows/tests.yml | 36 ++++------------------------ package-lock.json | 6 ++--- package.json | 4 ++-- tsconfig.json | 4 +--- 5 files changed, 11 insertions(+), 41 deletions(-) diff --git a/.github/workflows/repl-artefacts.yml b/.github/workflows/repl-artefacts.yml index f9cf1852b..560feb49d 100644 --- a/.github/workflows/repl-artefacts.yml +++ b/.github/workflows/repl-artefacts.yml @@ -60,7 +60,7 @@ jobs: #TODO: remove after or before merging release-4.0 if: ${{ github.head_ref == 'release-4.0' || github.base_ref == 'release-4.0' }} run: npm exec -- concurrently -c green,blue,yellow 'npm:build:napi -- --release' 'npm run build:wasm' 'npm:build:cjs' && npm run build:copy-native && npm run build:bootstrap - #TODO: remove after or before merging release-4.0 + #TODO: remove after or before merging release-4.0 - name: Build artefacts if: ${{ github.head_ref != 'release-4.0' && github.base_ref != 'release-4.0' }} run: npm run build:cjs && npm run build:bootstrap diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8d4a2cb45..c776458a8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -47,14 +47,14 @@ jobs: linux16: runs-on: ubuntu-latest timeout-minutes: 15 - name: Node 16 + Extra Tests (Linux) + name: Node 18 + Extra Tests (Linux) steps: - name: Checkout Commit uses: actions/checkout@v4 - name: Setup Node uses: actions/setup-node@v3 with: - node-version: '16' + node-version: '18' - name: Cache Node Modules id: cache-node-modules uses: actions/cache@v3 @@ -73,40 +73,12 @@ jobs: env: CI: true - linux: - runs-on: ubuntu-latest - timeout-minutes: 15 - strategy: - matrix: - node: ['14.18.0'] - name: Node ${{ matrix.node }} (Linux) - steps: - - name: Checkout Commit - uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - - name: Cache Node Modules - id: cache-node-modules - uses: actions/cache@v3 - with: - path: node_modules - key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }} - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: npm i -g npm@8 && npm ci --ignore-scripts - - name: Run tests - run: npm run ci:test:only - env: - CI: true - macos: runs-on: macos-latest timeout-minutes: 15 strategy: matrix: - node: ['14.18.0', '18'] + node: ['18'] name: Node ${{ matrix.node }} (macOS) steps: - name: Checkout Commit @@ -137,7 +109,7 @@ jobs: timeout-minutes: 15 strategy: matrix: - node: ['14.18.0', '18'] + node: ['18'] name: Node ${{ matrix.node }} (Windows) steps: - name: Checkout Commit diff --git a/package-lock.json b/package-lock.json index 846caae1c..72442a541 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rollup", - "version": "3.29.4", + "version": "4.0.0-0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rollup", - "version": "3.29.4", + "version": "4.0.0-0", "license": "MIT", "bin": { "rollup": "dist/bin/rollup" @@ -94,7 +94,7 @@ "yargs-parser": "^21.1.1" }, "engines": { - "node": ">=14.18.0", + "node": ">=18.0.0", "npm": ">=8.0.0" }, "optionalDependencies": { diff --git a/package.json b/package.json index 88814e6b1..172f5bc44 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rollup", - "version": "3.29.4", + "version": "4.0.0-0", "description": "Next-generation ES module bundler", "main": "dist/rollup.js", "module": "dist/es/rollup.js", @@ -157,7 +157,7 @@ "dist/es/package.json" ], "engines": { - "node": ">=14.18.0", + "node": ">=18.0.0", "npm": ">=8.0.0" }, "exports": { diff --git a/tsconfig.json b/tsconfig.json index 5a205be52..4b0974ca4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,6 @@ "compilerOptions": { "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "isolatedModules": true, "module": "ESNext", "moduleResolution": "Node", "noEmitOnError": true, @@ -11,8 +10,7 @@ "resolveJsonModule": true, "skipLibCheck": true, "strict": true, - "target": "ES2020", - "useDefineForClassFields": false + "target": "ES2022" }, "include": ["typings/**/*.d.ts", "src", "cli", "browser", "rollup.config.ts"], "exclude": ["dist", "node_modules", "test/typescript", "browser/dist"] From 643272e0d11a28bd56491719b75f95147bb66ac7 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Sun, 17 Sep 2023 21:53:04 +0200 Subject: [PATCH 02/44] [v4.0] Switch parser to SWC and introduce native/WASM code (#5073) * Add native compilation for local NodeJS * Link instead of copying for faster dev cycles for now * Parse AST * Convert first trivial AST to a buffer * Use SWC for parsing * Extend AST conversion * Make AST more similar * Fix line number issue by creating a new sourcemap (and thus compiler) for each run * Collect timings * Add code_length to struct * Refine parsing * Extend parsing * Extend AST: ImportDefaultSpecifier, LiteralBoolean, LiteralNull, ExportDefaultExpression * Extend AST: ImportNamespaceSpecifier, ExportAll * Extend AST: BinaryExpression, ArrayPattern, ObjectPattern, AssignmentPatternProperty, ArrayLiteral, ImportExpression * Extend AST: ConditionalExpression * Extend AST: FunctionDeclaration, ClassDeclaration, ClassBody, ReturnStatement * Extend AST: ObjectLiteral, KeyValueProperty * Extend AST: ShorthandProperty * Extend AST: GetterProperty, AssignmentExpression, NewExpression, FunctionExpression * Extend AST: ThrowStatement * Extend AST: ExportDefaultDeclaration * Extend AST: AssignmentPattern, AwaitExpression, BreakStatement Start sorting AST nodes * Extend AST: TryStatement, CatchClause, ChainExpression * Extend AST: ClassExpression, ContinueStatement, DebuggerStatement, DoWhileStatement, EmptyStatement * Extend AST: ExportNamedDeclaration, ForInStatement, ForOfStatement, ForStatement * Extend AST: IfStatement * Extend AST: Import attributes * Extend AST: Literal, Literal * Extend AST: LogicalExpression * Extend AST: MetaProperty * Extend AST: Various Property types * Extend AST: Progress on classes * Extend AST: MethodDefinition, PropertyDefinition, PrivateName, ThisExpression * Extend AST: StaticBlock, Super * Extend AST: RestElement, SequenceExpression, SwitchCase, SwitchStatement * Extend AST: TaggedTemplateExpression, TemplateElement, TemplateLiteral, UnaryExpression, UpdateExpression, YieldExpression * Extend AST: Properties in object patterns * Finishing Fixes * More fixes * Run cargo fmt * Handle directives * Minor fixes * Unicode support * Fix optional chain expressions * Adapt tests * Do not run acorn anymore * Update lockfile * Minor fixes * Move to rust folder * Separate Rust Node bindings to allow adding WASM bindings in another workspace * Make Napi build closer to how rs.napi works * Fix path issues * Disable browser build for now * Add native package directories * Refine runWithEcho * Try initial steps with Github flow * Trigger change * Temporarily add yarn lockfile until we figured out if we get it to work with npm * Use nightly toolchain * Use default locations for Napi files to make things easier * Adapt workflow * Skip regular tests for now * Attempt to fix broken workflows * Attempt to fix broken workflows * Attempt to fix broken workflows * Test MacOS/WIndows * Fix bootstrap build * Skip tests * Rename workflow * Add additional tests * Use zig differently * Try to fix musl build * Skip musl again for now * Add publish to workflow * 4.0.0-0 * Remove yarn lock again * Fix coverage job * Fix artefact handling * Revert "4.0.0-0" This reverts commit 734806f0ae9a4cfa63e996c2d9be099b2a4580bf. * 4.0.0-0 * Do not include default triples twice * Fix native npm packages * 4.0.0-1 * Add missing additional tests except browser tests * Try to fix publish and tests * 4.0.0-2 * Switch to faster utf-16 conversion * 4.0.0-3 * Fix positioning algorithm when manually searching the code * 4.0.0-4 * feat: Add WASM browser build (#5077) * feat: add wasm browser build * move wasm binding into a separate cargo workspace * use imports replacing * set the targetEnv option of wasm to browser in browser build * add the wasm build to build command * fix lint error and ci error * add more comments to silence the linter * big change * trigger change * run browser tests * trigger change * tweak wasm build on CI * Increase build timeout * Use shared string constants * Extract fixed strings into constants * Remove comment * Get rid of dbg! calls * Add lockfile hash to cargo cache * Use if let over match in some cases * Return the buffer of the syntax error in parse_ast * Initial annotation support * Put annotation types into string table * Remove invalid annotations * Support nested calls and new expressions * Improve tree-shaking for annotations * Adapt test * Properly handle line-breaks, commas etc. * Mark nested pure annotations as pure * Remove sourcemap comments * Handle function side effect annotatinos * Remove old comment-handling code * Increase timeout for browser tests * Only skip the tests that still fail * Run coverage again on CI * Get the buffer of pos and message from the Syntax error * Handle the lint errors from SWC * Reenable tests about parse errors and adjust some relevant code * Emit native.js to native.cjs * Add cjs extension for native importee when bundling for ESM * Change native importee with replace plugin and emit native.cjs in napi build * Silence the linter for importing native * Use node:path to resolve native binding files * Add Node WASM files to Native packages for StackBlitz and similar use cases * Unignore *.d.ts in the wasm dir * 4.0.0-5 * Fix copy-wasm-node.js * 4.0.0-6 * Remove .gitignore in wasm-node directory * 4.0.0-7 * Include .cjs files when publishing rollup to npm * 4.0.0-8 * Get readString function at runtime * eslint: ignore wasm-node and set node extensions of import/resolver * 4.0.0-9 * Change the required node to >=14.18.0 as before * 4.0.0-10 * Prepare to fix ESM build Still requires bug-fix on Rollup side for relative external dependencies outside the ouput directory * Update Rollup * Enable ESM tests * Re-enable another test * Remove CJS eslint configuration * Fix extension * Fix test * Fix entension for native import * Support for publishing a completely separate package @rollup/wasm-node * 4.0.0-11 * Fix publish for wasm node package * Add AST verification to function tests * Only use plugin arrays in form and function tests * Fix spans in function tests * Verify AST in form tests as well * Try to publish @rollup/browser and fix publish-wasm-node-package.js * 4.0.0-12 * Tweak publish scripts * Fix importing wasm file in browser * Parse code as unknown module type for greater compatibility * Remove acorn options * Tweak getReadStringFunction * Fix browser tests * 4.0.0-13 * Remove polyfills that are no longer needed in browser tests * Convert to new import attributes AST format * Rename assertions to attributes * Deprecate externalImportAssertions in favor of externalImportAttributes * Update SWC version * Remove max-call-stack test SWC is not capable of handling it and we cannot fix it * Improve coverage * re-enable repl-artefacts workflow * Fix test * Preload wasm file in docs * docs: add functions to get full path of url * Delete the build plugin handleImportMetaUrl * Make 'npm install github/branch' work * Verify there is a valid changelog entry before releasing * Create release notes and comments from CI Minor change to maybe trigger a CI run * Fix RegExp * 4.0.0-14 * Minor changes for a test PR (#5139) * Fix RegExp use * 4.0.0-15 * Do not rely on current branch to find the PR * 4.0.0-16 * Fix how to determine git commit range * 4.0.0-17 * Make sure we fetch all history on publish * 4.0.0-18 * Add proper permissions * 4.0.0-19 * Use Double quotation marks instead of Single quotation marks if concurrently scripts with flags * Remove "engines" from native packages * Update CONTRIBUTING.md --------- Co-authored-by: XiaoPi <530257315@qq.com> --- .eslintrc.js | 6 +- .github/workflows/build-and-tests.yml | 348 +++ .github/workflows/tests.yml | 136 - .nycrc | 2 +- CONTRIBUTING.md | 8 +- LICENSE.md | 65 - browser/LICENSE.md | 65 - browser/package.json | 3 +- browser/src/initWasm.ts | 6 + browser/src/wasm.ts | 6 + build-plugins/aliases.ts | 1 - build-plugins/emit-native-entry.ts | 15 + build-plugins/emit-wasm-file.ts | 15 + build-plugins/external-native-import.ts | 17 + build-plugins/replace-browser-modules.ts | 29 +- cli/help.md | 2 +- docs/.vitepress/verify-anchors.ts | 2 +- docs/command-line-interface/index.md | 6 +- docs/configuration-options/index.md | 45 +- .../en/slugs-and-pages-by-legacy-slugs.json | 2 +- docs/javascript-api/index.md | 4 +- docs/plugin-development/index.md | 12 +- docs/repl/stores/options.ts | 6 +- docs/repl/stores/rollup.ts | 47 +- native.d.ts | 6 + native.js | 257 ++ npm/android-arm-eabi/README.md | 3 + npm/android-arm-eabi/package.json | 19 + npm/android-arm64/README.md | 3 + npm/android-arm64/package.json | 19 + npm/darwin-arm64/README.md | 3 + npm/darwin-arm64/package.json | 19 + npm/darwin-x64/README.md | 3 + npm/darwin-x64/package.json | 19 + npm/linux-arm-gnueabihf/README.md | 3 + npm/linux-arm-gnueabihf/package.json | 19 + npm/linux-arm64-gnu/README.md | 3 + npm/linux-arm64-gnu/package.json | 22 + npm/linux-arm64-musl/README.md | 3 + npm/linux-arm64-musl/package.json | 22 + npm/linux-x64-gnu/README.md | 3 + npm/linux-x64-gnu/package.json | 22 + npm/linux-x64-musl/README.md | 3 + npm/linux-x64-musl/package.json | 22 + npm/win32-arm64-msvc/README.md | 3 + npm/win32-arm64-msvc/package.json | 19 + npm/win32-ia32-msvc/README.md | 3 + npm/win32-ia32-msvc/package.json | 19 + npm/win32-x64-msvc/README.md | 3 + npm/win32-x64-msvc/package.json | 19 + package-lock.json | 642 ++-- package.json | 66 +- rollup.config.ts | 33 +- rust/Cargo.lock | 2452 +++++++++++++++ rust/Cargo.toml | 10 + rust/bindings_napi/Cargo.toml | 18 + rust/bindings_napi/build.rs | 5 + rust/bindings_napi/src/lib.rs | 10 + rust/bindings_wasm/Cargo.toml | 11 + rust/bindings_wasm/src/lib.rs | 7 + rust/parse_ast/Cargo.toml | 18 + rust/parse_ast/src/convert_ast.rs | 2 + rust/parse_ast/src/convert_ast/annotations.rs | 129 + rust/parse_ast/src/convert_ast/converter.rs | 2762 +++++++++++++++++ .../src/convert_ast/converter/analyze_code.rs | 40 + .../src/convert_ast/converter/node_types.rs | 78 + .../convert_ast/converter/string_constants.rs | 62 + .../convert_ast/converter/utf16_positions.rs | 142 + rust/parse_ast/src/error_emit.rs | 129 + rust/parse_ast/src/lib.rs | 69 + rust/rustfmt.toml | 2 + scripts/check-release.js | 1 + scripts/colors.js | 2 +- scripts/helpers.js | 31 +- scripts/postpublish.js | 91 + scripts/{release.js => prepare-release.js} | 202 +- scripts/prepublish.js | 65 + scripts/publish-wasm-node-package.js | 54 + scripts/release-constants.js | 6 + scripts/release-helpers.js | 111 + scripts/test-options.js | 9 +- src/Bundle.ts | 4 +- src/Chunk.ts | 16 +- src/ExternalChunk.ts | 18 +- src/ExternalModule.ts | 4 +- src/Graph.ts | 40 +- src/Module.ts | 38 +- src/ModuleLoader.ts | 79 +- src/ast/keys.ts | 3 - src/ast/nodes/BinaryExpression.ts | 4 + src/ast/nodes/ChainExpression.ts | 5 + src/ast/nodes/ConditionalExpression.ts | 7 +- src/ast/nodes/ExportAllDeclaration.ts | 2 +- src/ast/nodes/ExportDefaultDeclaration.ts | 4 + src/ast/nodes/ExportNamedDeclaration.ts | 6 +- src/ast/nodes/ExpressionStatement.ts | 8 +- src/ast/nodes/Identifier.ts | 11 - src/ast/nodes/ImportDeclaration.ts | 4 +- src/ast/nodes/ImportExpression.ts | 21 +- src/ast/nodes/LogicalExpression.ts | 7 +- src/ast/nodes/SequenceExpression.ts | 4 + src/ast/nodes/VariableDeclaration.ts | 4 + src/ast/nodes/VariableDeclarator.ts | 4 + src/ast/nodes/shared/Node.ts | 37 +- src/finalisers/es.ts | 4 +- src/rollup/rollup.ts | 3 + src/rollup/types.d.ts | 32 +- src/utils/PluginContext.ts | 4 +- src/utils/commentAnnotations.ts | 212 -- src/utils/convert-ast-strings.ts | 62 + src/utils/convert-ast.ts | 1235 ++++++++ src/utils/getReadStringFunction.ts | 14 + src/utils/initWasm.ts | 1 + src/utils/logs.ts | 55 +- src/utils/options/mergeOptions.ts | 6 +- src/utils/options/normalizeInputOptions.ts | 17 - src/utils/options/normalizeOutputOptions.ts | 20 +- ...Assertions.ts => parseImportAttributes.ts} | 45 +- src/utils/resolveId.ts | 4 +- src/utils/resolveIdViaPlugins.ts | 8 +- src/utils/treeshakeNode.ts | 22 +- src/utils/urls.ts | 2 + test/browser/index.js | 9 +- .../_config.js | 30 +- .../implicitly-dependent-entry/_config.js | 30 +- .../multiple-dependencies/_config.js | 103 +- .../single-dependency/_config.js | 30 +- test/cli/samples/validate/_config.js | 2 +- .../cli/samples/watch/bundle-error/_config.js | 2 +- test/form/index.js | 17 +- test/form/samples/absolute-path-resolver/a.js | 2 +- .../samples/acorn-external-plugins/_config.js | 8 - .../acorn-external-plugins/_expected.js | 3 - .../samples/acorn-external-plugins/main.js | 1 - test/form/samples/big-int/_config.js | 2 +- .../_config.js | 12 +- .../removes-dynamic-assertions/_config.js | 3 +- .../removes-dynamic-assertions/_expected.js | 0 .../removes-dynamic-assertions}/main.js | 0 .../removes-static-attributes}/_config.js | 3 +- .../removes-static-attributes}/_expected.js | 0 .../removes-static-attributes}/main.js | 0 test/form/samples/emit-asset-file/_config.js | 66 +- .../emit-file-tree-shaken-access/_config.js | 32 +- .../emit-uint8array-no-buffer/_config.js | 30 +- .../_config.js | 12 +- test/form/samples/export-globals/_config.js | 3 - .../_expected.js | 2 +- .../assertion-shapes/_config.js | 6 - .../attribute-shapes/_config.js | 7 + .../attribute-shapes}/_expected.js | 0 .../attribute-shapes}/main.js | 0 .../keep-dynamic-attributes}/_config.js | 2 +- .../keep-dynamic-attributes}/_expected/amd.js | 0 .../keep-dynamic-attributes}/_expected/cjs.js | 0 .../keep-dynamic-attributes}/_expected/es.js | 0 .../_expected/iife.js | 0 .../_expected/system.js | 0 .../keep-dynamic-attributes}/_expected/umd.js | 0 .../keep-dynamic-attributes}/main.js | 0 .../keeps-static-attributes}/_config.js | 2 +- .../keeps-static-attributes}/_expected/amd.js | 0 .../keeps-static-attributes}/_expected/cjs.js | 0 .../keeps-static-attributes}/_expected/es.js | 0 .../_expected/iife.js | 0 .../_expected/system.js | 0 .../keeps-static-attributes}/_expected/umd.js | 0 .../keeps-static-attributes}/main.js | 0 .../_config.js | 6 +- .../_expected.js | 0 .../main.js | 0 .../plugin-attributes-resolveid}/_config.js | 6 +- .../plugin-attributes-resolveid}/_expected.js | 0 .../plugin-attributes-resolveid}/main.js | 0 .../removes-dynamic-attributes/_config.js | 29 + .../removes-dynamic-attributes/_expected.js | 6 + .../removes-dynamic-attributes/main.js | 6 + .../removes-static-attributes/_config.js | 11 + .../removes-static-attributes/_expected.js | 7 + .../removes-static-attributes/main.js | 9 + .../_config.js | 3 - .../make-relative-false/_config.js | 52 +- .../make-relative-relative/_config.js | 58 +- .../make-relative-true/_config.js | 62 +- .../samples/module-no-treeshake/_config.js | 50 +- .../form/samples/nested-pure-comments/main.js | 2 + .../_config.js | 2 - .../_expected.js | 21 +- .../functions.js | 21 +- .../_config.js | 2 - .../functions.js | 16 +- .../ns-external-star-reexport/_config.js | 20 +- .../pure-comment-line-break/_expected.js | 48 +- .../samples/pure-comment-line-break/dep.js | 2 +- .../samples/pure-comment-line-break/main.js | 51 +- .../_expected.js | 12 +- .../samples/relative-external-ids/_config.js | 38 +- test/form/samples/resolution-order/_config.js | 12 +- .../side-effects-internal-modules/_config.js | 24 +- test/form/samples/supports-core-js/_config.js | 1 + .../samples/system-uninitialized/_config.js | 3 - .../_expected.js | 18 +- .../samples/unknown-token-effects/_config.js | 17 - .../unknown-token-effects/_expected.js | 34 - .../samples/unknown-token-effects/main.js | 32 - test/function/index.js | 18 +- .../add-watch-file-generate/_config.js | 12 +- .../samples/allow-reserved/_config.js | 8 - test/function/samples/allow-reserved/main.js | 4 - .../samples/bundle-facade-order/_config.js | 28 +- .../_config.js | 6 +- .../_config.js | 12 +- .../_config.js | 14 +- .../samples/context-resolve/_config.js | 18 +- .../dynamic-import-name-warn/_config.js | 10 +- .../deprecated/dynamic-import-name/_config.js | 10 +- .../inline-dynamic-imports-bundle/_config.js | 16 +- .../deprecated/manual-chunks-info/_config.js | 18 +- .../deprecated/plugin-module-ids/_config.js | 20 +- .../deprecated/resolve-id-external/_config.js | 80 +- .../samples/deprecated/resolve-id/_config.js | 100 +- .../externalImportAssertions/_config.js | 12 + .../externalImportAssertions/_expected.js | 6 + .../externalImportAssertions/main.js | 6 + .../deprecations/plugin-module-ids/_config.js | 12 +- .../samples/double-default-export/_config.js | 17 +- .../samples/double-named-export/_config.js | 11 +- .../samples/double-named-reexport/_config.js | 11 +- .../samples/duplicate-import-fails/_config.js | 11 +- .../_config.js | 11 +- .../samples/emit-chunk-hash/_config.js | 16 +- .../emit-chunk-manual-asset-source/_config.js | 28 +- .../samples/emit-chunk-manual/_config.js | 18 +- .../emit-file/asset-source-invalid/_config.js | 14 +- .../asset-source-invalid2/_config.js | 14 +- .../asset-source-invalid3/_config.js | 14 +- .../asset-source-invalid4/_config.js | 12 +- .../emit-file/asset-source-missing/_config.js | 12 +- .../asset-source-missing2/_config.js | 12 +- .../asset-source-missing3/_config.js | 14 +- .../asset-source-missing4/_config.js | 14 +- .../asset-source-missing5/_config.js | 18 +- .../_config.js | 18 +- .../_config.js | 18 +- .../chunk-filename-not-available/_config.js | 14 +- .../emit-file/chunk-not-found/_config.js | 10 +- .../emit-from-output-options/_config.js | 16 +- .../file-references-in-bundle/_config.js | 44 +- .../emit-file/invalid-asset-name/_config.js | 12 +- .../emit-file/invalid-asset-name3/_config.js | 12 +- .../emit-file/invalid-chunk-id/_config.js | 12 +- .../emit-file/invalid-file-type/_config.js | 12 +- .../_config.js | 18 +- .../invalid-prebuit-chunk-code/_config.js | 18 +- .../emit-file/invalid-reference-id/_config.js | 12 +- .../invalid-set-asset-source-id/_config.js | 12 +- .../emit-file/modules-loaded/_config.js | 12 +- .../samples/emit-file/no-input/_config.js | 12 +- .../set-asset-source-chunk/_config.js | 14 +- .../set-asset-source-transform/_config.js | 16 +- .../set-asset-source-twice/_config.js | 16 +- .../set-asset-source-twice2/_config.js | 16 +- .../set-source-in-output-options/_config.js | 16 +- .../samples/error-parse-json/_config.js | 10 +- .../error-parse-unknown-extension/_config.js | 10 +- .../function/samples/export-global/_config.js | 7 +- test/function/samples/export-global/main.js | 2 +- .../export-not-at-top-level-fails/_config.js | 9 +- .../external-entry-point-object/_config.js | 10 +- .../samples/external-entry-point/_config.js | 10 +- .../samples/external-resolved/_config.js | 40 +- .../samples/function-asm-directive/main.js | 2 +- .../function-directive-not-first/main.js | 2 +- .../handle-missing-export-source/_config.js | 17 +- .../_config.js | 20 +- .../_config.js | 30 +- .../dependant-not-part-of-graph/_config.js | 40 +- .../external-dependant/_config.js | 20 +- .../missing-dependant/_config.js | 28 +- .../plugin-assertions-this-resolve/_config.js | 14 +- .../warn-assertion-conflicts/_config.js | 22 +- .../warn-unresolvable-assertions/_config.js | 141 + .../warn-unresolvable-assertions/main.js | 8 + .../import-not-at-top-level-fails/_config.js | 9 +- .../inline-dynamic-imports-bundle/_config.js | 16 +- .../_config.js | 20 +- .../samples/invalid-addon-hook/_config.js | 4 +- .../samples/manual-chunks-info/_config.js | 18 +- .../samples/module-parsed-hook/_config.js | 236 +- .../module-side-effects/array/_config.js | 30 +- .../external-false/_config.js | 40 +- .../global-false/_config.js | 30 +- .../module-side-effects/load/_config.js | 32 +- .../resolve-id-external/_config.js | 82 +- .../module-side-effects/resolve-id/_config.js | 102 +- .../non-function-hook-async/_config.js | 4 +- .../samples/non-function-hook-sync/_config.js | 8 +- .../samples/optional-catch-binding/_config.js | 2 +- .../samples/options-async-hook/_config.js | 1 + test/function/samples/options-hook/_config.js | 86 +- .../samples/options-in-renderstart/_config.js | 24 +- .../samples/output-options-hook/_config.js | 127 +- .../plugin-cache/anonymous-delete/_config.js | 10 +- .../plugin-cache/anonymous-get/_config.js | 10 +- .../plugin-cache/anonymous-has/_config.js | 10 +- .../plugin-cache/anonymous-set/_config.js | 10 +- .../_config.js | 2 +- .../plugin-module-information/_config.js | 797 ++--- .../_config.js | 24 - .../main.js | 4 - .../samples/preload-module/_config.js | 4 +- .../samples/preserve-symlink/_config.js | 2 +- .../samples/reassign-import-fails/_config.js | 11 +- .../samples/reassign-import-fails/foo.js | 1 - .../_config.js | 11 +- .../foo.js | 1 - .../samples/resolve-id-object/_config.js | 28 +- .../resolve-relative-external-id/_config.js | 40 +- .../_config.js | 10 +- test/function/samples/symlink/_config.js | 2 +- .../_config.js | 12 +- .../samples/transform-empty-string/_config.js | 14 +- .../_config.js | 12 +- .../_config.js | 12 +- .../samples/transform-without-code/_config.js | 48 +- .../_config.js | 11 +- .../update-expression-of-import-fails/foo.js | 1 - .../samples/uses-supplied-ast/_config.js | 1 + .../samples/validate-output/_config.js | 5 +- .../_config.js | 23 +- .../samples/warnings-to-string/_config.js | 12 +- test/incremental/index.js | 31 +- test/misc/acorn-plugins.js | 45 - test/misc/index.js | 1 - test/misc/misc.js | 28 - test/misc/optionList.js | 6 +- test/utils.js | 56 + test/watch/index.js | 8 +- tsconfig.json | 2 +- wasm.d.ts | 6 + wasm/bindings_wasm.d.ts | 47 + wasm/bindings_wasm_bg.wasm.d.ts | 10 + 342 files changed, 11987 insertions(+), 3503 deletions(-) create mode 100644 .github/workflows/build-and-tests.yml delete mode 100644 .github/workflows/tests.yml create mode 100644 browser/src/initWasm.ts create mode 100644 browser/src/wasm.ts create mode 100644 build-plugins/emit-native-entry.ts create mode 100644 build-plugins/emit-wasm-file.ts create mode 100644 build-plugins/external-native-import.ts create mode 100644 native.d.ts create mode 100644 native.js create mode 100644 npm/android-arm-eabi/README.md create mode 100644 npm/android-arm-eabi/package.json create mode 100644 npm/android-arm64/README.md create mode 100644 npm/android-arm64/package.json create mode 100644 npm/darwin-arm64/README.md create mode 100644 npm/darwin-arm64/package.json create mode 100644 npm/darwin-x64/README.md create mode 100644 npm/darwin-x64/package.json create mode 100644 npm/linux-arm-gnueabihf/README.md create mode 100644 npm/linux-arm-gnueabihf/package.json create mode 100644 npm/linux-arm64-gnu/README.md create mode 100644 npm/linux-arm64-gnu/package.json create mode 100644 npm/linux-arm64-musl/README.md create mode 100644 npm/linux-arm64-musl/package.json create mode 100644 npm/linux-x64-gnu/README.md create mode 100644 npm/linux-x64-gnu/package.json create mode 100644 npm/linux-x64-musl/README.md create mode 100644 npm/linux-x64-musl/package.json create mode 100644 npm/win32-arm64-msvc/README.md create mode 100644 npm/win32-arm64-msvc/package.json create mode 100644 npm/win32-ia32-msvc/README.md create mode 100644 npm/win32-ia32-msvc/package.json create mode 100644 npm/win32-x64-msvc/README.md create mode 100644 npm/win32-x64-msvc/package.json create mode 100644 rust/Cargo.lock create mode 100644 rust/Cargo.toml create mode 100644 rust/bindings_napi/Cargo.toml create mode 100644 rust/bindings_napi/build.rs create mode 100644 rust/bindings_napi/src/lib.rs create mode 100644 rust/bindings_wasm/Cargo.toml create mode 100644 rust/bindings_wasm/src/lib.rs create mode 100644 rust/parse_ast/Cargo.toml create mode 100644 rust/parse_ast/src/convert_ast.rs create mode 100644 rust/parse_ast/src/convert_ast/annotations.rs create mode 100644 rust/parse_ast/src/convert_ast/converter.rs create mode 100644 rust/parse_ast/src/convert_ast/converter/analyze_code.rs create mode 100644 rust/parse_ast/src/convert_ast/converter/node_types.rs create mode 100644 rust/parse_ast/src/convert_ast/converter/string_constants.rs create mode 100644 rust/parse_ast/src/convert_ast/converter/utf16_positions.rs create mode 100644 rust/parse_ast/src/error_emit.rs create mode 100644 rust/parse_ast/src/lib.rs create mode 100644 rust/rustfmt.toml create mode 100644 scripts/postpublish.js rename scripts/{release.js => prepare-release.js} (53%) create mode 100755 scripts/prepublish.js create mode 100644 scripts/publish-wasm-node-package.js create mode 100644 scripts/release-constants.js create mode 100644 scripts/release-helpers.js delete mode 100644 src/utils/commentAnnotations.ts create mode 100644 src/utils/convert-ast-strings.ts create mode 100644 src/utils/convert-ast.ts create mode 100644 src/utils/getReadStringFunction.ts create mode 100644 src/utils/initWasm.ts rename src/utils/{parseAssertions.ts => parseImportAttributes.ts} (51%) delete mode 100644 test/form/samples/acorn-external-plugins/_config.js delete mode 100644 test/form/samples/acorn-external-plugins/_expected.js delete mode 100644 test/form/samples/acorn-external-plugins/main.js rename test/form/samples/{import-assertions => deprecated}/removes-dynamic-assertions/_config.js (88%) rename test/form/samples/{import-assertions => deprecated}/removes-dynamic-assertions/_expected.js (100%) rename test/form/samples/{import-assertions/keep-dynamic-assertions => deprecated/removes-dynamic-assertions}/main.js (100%) rename test/form/samples/{import-assertions/removes-static-assertions => deprecated/removes-static-attributes}/_config.js (72%) rename test/form/samples/{import-assertions/removes-static-assertions => deprecated/removes-static-attributes}/_expected.js (100%) rename test/form/samples/{import-assertions/keeps-static-assertions => deprecated/removes-static-attributes}/main.js (100%) delete mode 100644 test/form/samples/import-assertions/assertion-shapes/_config.js create mode 100644 test/form/samples/import-attributes/attribute-shapes/_config.js rename test/form/samples/{import-assertions/assertion-shapes => import-attributes/attribute-shapes}/_expected.js (100%) rename test/form/samples/{import-assertions/assertion-shapes => import-attributes/attribute-shapes}/main.js (100%) rename test/form/samples/{import-assertions/keep-dynamic-assertions => import-attributes/keep-dynamic-attributes}/_config.js (91%) rename test/form/samples/{import-assertions/keep-dynamic-assertions => import-attributes/keep-dynamic-attributes}/_expected/amd.js (100%) rename test/form/samples/{import-assertions/keep-dynamic-assertions => import-attributes/keep-dynamic-attributes}/_expected/cjs.js (100%) rename test/form/samples/{import-assertions/keep-dynamic-assertions => import-attributes/keep-dynamic-attributes}/_expected/es.js (100%) rename test/form/samples/{import-assertions/keep-dynamic-assertions => import-attributes/keep-dynamic-attributes}/_expected/iife.js (100%) rename test/form/samples/{import-assertions/keep-dynamic-assertions => import-attributes/keep-dynamic-attributes}/_expected/system.js (100%) rename test/form/samples/{import-assertions/keep-dynamic-assertions => import-attributes/keep-dynamic-attributes}/_expected/umd.js (100%) rename test/form/samples/{import-assertions/removes-dynamic-assertions => import-attributes/keep-dynamic-attributes}/main.js (100%) rename test/form/samples/{import-assertions/keeps-static-assertions => import-attributes/keeps-static-attributes}/_config.js (78%) rename test/form/samples/{import-assertions/keeps-static-assertions => import-attributes/keeps-static-attributes}/_expected/amd.js (100%) rename test/form/samples/{import-assertions/keeps-static-assertions => import-attributes/keeps-static-attributes}/_expected/cjs.js (100%) rename test/form/samples/{import-assertions/keeps-static-assertions => import-attributes/keeps-static-attributes}/_expected/es.js (100%) rename test/form/samples/{import-assertions/keeps-static-assertions => import-attributes/keeps-static-attributes}/_expected/iife.js (100%) rename test/form/samples/{import-assertions/keeps-static-assertions => import-attributes/keeps-static-attributes}/_expected/system.js (100%) rename test/form/samples/{import-assertions/keeps-static-assertions => import-attributes/keeps-static-attributes}/_expected/umd.js (100%) rename test/form/samples/{import-assertions/removes-static-assertions => import-attributes/keeps-static-attributes}/main.js (100%) rename test/form/samples/{import-assertions/plugin-assertions-resolvedynamicimport => import-attributes/plugin-attributes-resolvedynamicimport}/_config.js (71%) rename test/form/samples/{import-assertions/plugin-assertions-resolvedynamicimport => import-attributes/plugin-attributes-resolvedynamicimport}/_expected.js (100%) rename test/form/samples/{import-assertions/plugin-assertions-resolvedynamicimport => import-attributes/plugin-attributes-resolvedynamicimport}/main.js (100%) rename test/form/samples/{import-assertions/plugin-assertions-resolveid => import-attributes/plugin-attributes-resolveid}/_config.js (56%) rename test/form/samples/{import-assertions/plugin-assertions-resolveid => import-attributes/plugin-attributes-resolveid}/_expected.js (100%) rename test/form/samples/{import-assertions/plugin-assertions-resolveid => import-attributes/plugin-attributes-resolveid}/main.js (100%) create mode 100644 test/form/samples/import-attributes/removes-dynamic-attributes/_config.js create mode 100644 test/form/samples/import-attributes/removes-dynamic-attributes/_expected.js create mode 100644 test/form/samples/import-attributes/removes-dynamic-attributes/main.js create mode 100644 test/form/samples/import-attributes/removes-static-attributes/_config.js create mode 100644 test/form/samples/import-attributes/removes-static-attributes/_expected.js create mode 100644 test/form/samples/import-attributes/removes-static-attributes/main.js delete mode 100644 test/form/samples/unknown-token-effects/_config.js delete mode 100644 test/form/samples/unknown-token-effects/_expected.js delete mode 100644 test/form/samples/unknown-token-effects/main.js delete mode 100644 test/function/samples/allow-reserved/_config.js delete mode 100644 test/function/samples/allow-reserved/main.js create mode 100644 test/function/samples/deprecations/externalImportAssertions/_config.js create mode 100644 test/function/samples/deprecations/externalImportAssertions/_expected.js create mode 100644 test/function/samples/deprecations/externalImportAssertions/main.js create mode 100644 test/function/samples/import-assertions/warn-unresolvable-assertions/_config.js create mode 100644 test/function/samples/import-assertions/warn-unresolvable-assertions/main.js delete mode 100644 test/function/samples/plugin-parse-ast-receives-comments/_config.js delete mode 100644 test/function/samples/plugin-parse-ast-receives-comments/main.js delete mode 100644 test/function/samples/reassign-import-fails/foo.js delete mode 100644 test/function/samples/reassign-import-not-at-top-level-fails/foo.js delete mode 100644 test/function/samples/update-expression-of-import-fails/foo.js delete mode 100644 test/misc/acorn-plugins.js create mode 100644 wasm.d.ts create mode 100644 wasm/bindings_wasm.d.ts create mode 100644 wasm/bindings_wasm_bg.wasm.d.ts diff --git a/.eslintrc.js b/.eslintrc.js index c69d2b749..ca86abc8d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -21,11 +21,13 @@ module.exports = { 'coverage', '_tmp', 'cache', - 'wasm', + 'native*.*', '/test/*/samples/**/*.*', '!/test/*/samples/**/_config.js', '!/test/*/samples/**/rollup.config.js', - '!.vitepress' + '!.vitepress', + '/wasm/', + '/wasm-node/' ], overrides: [ { diff --git a/.github/workflows/build-and-tests.yml b/.github/workflows/build-and-tests.yml new file mode 100644 index 000000000..bdef57256 --- /dev/null +++ b/.github/workflows/build-and-tests.yml @@ -0,0 +1,348 @@ +name: CI +env: + DEBUG: napi:* + APP_NAME: rollup + MACOSX_DEPLOYMENT_TARGET: '10.13' + +on: + push: + branches: + - master + tags: + - 'v*.*.**' + pull_request: + types: + - synchronize + - opened + - reopened + merge_group: + +permissions: + contents: read + +jobs: + lint: + name: Lint and Audit + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Checkout Commit + uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 20 + - name: Cache Node Modules + id: cache-node-modules + uses: actions/cache@v3 + with: + path: node_modules + key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }} + - name: Install dependencies + if: steps.cache-node-modules.outputs.cache-hit != 'true' + run: npm ci --ignore-scripts + - name: Lint + run: npm run ci:lint + - name: Vulnerabilities + run: npm audit + - name: Optional Dependencies + run: npm run test:package + - name: CLI Docs + run: npm run test:options + + build: + strategy: + fail-fast: false + matrix: + settings: + - host: windows-latest + target: x86_64-pc-windows-msvc + name: wasm + is-wasm-build: true + build: npm run build:wasm + path: | + wasm/ + .empty + - host: windows-latest + target: x86_64-pc-windows-msvc + name: wasm-node + is-wasm-build: true + build: npm run build:wasm:node + path: | + wasm-node/ + .empty + - host: macos-latest + target: x86_64-apple-darwin + build: | + npm run build:napi -- --release + strip -x *.node + - host: windows-latest + build: npm run build:napi -- --release + target: x86_64-pc-windows-msvc + - host: windows-latest + build: | + npm run build:napi -- --release --target i686-pc-windows-msvc + target: i686-pc-windows-msvc + - host: ubuntu-latest + target: x86_64-unknown-linux-gnu + docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian + build: |- + set -e && + rustup default nightly && + npm run build:napi -- --release --target x86_64-unknown-linux-gnu && + strip *.node + - host: ubuntu-latest + target: x86_64-unknown-linux-musl + docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine + build: |- + set -e && + rustup default nightly && + npm run build:napi -- --release && strip *.node + - host: macos-latest + target: aarch64-apple-darwin + build: | + npm run build:napi -- --release --target aarch64-apple-darwin + strip -x *.node + - host: ubuntu-latest + target: aarch64-unknown-linux-gnu + docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64 + build: |- + set -e && + rustup default nightly && + rustup target add aarch64-unknown-linux-gnu && + npm run build:napi -- --release --target aarch64-unknown-linux-gnu && + aarch64-unknown-linux-gnu-strip *.node + - host: ubuntu-latest + target: armv7-unknown-linux-gnueabihf + zig: true + setup: | + sudo apt-get update + sudo apt-get install gcc-arm-linux-gnueabihf -y + build: | + npm run build:napi -- --release --target armv7-unknown-linux-gnueabihf + arm-linux-gnueabihf-strip *.node + - host: ubuntu-latest + target: aarch64-linux-android + build: | + npm run build:napi -- --release --target aarch64-linux-android + ${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip *.node + - host: ubuntu-latest + target: armv7-linux-androideabi + build: | + npm run build:napi -- --release --target armv7-linux-androideabi + ${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip *.node + # TODO SWC this does not work yet, also add back in package.json + # - host: ubuntu-latest + # target: aarch64-unknown-linux-musl + # docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine + # build: |- + # set -e && + # rustup default nightly && + # rustup target add aarch64-unknown-linux-musl && + # npm run build:napi -- --release --target aarch64-unknown-linux-musl && + # /aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node + - host: windows-latest + target: aarch64-pc-windows-msvc + build: npm run build:napi -- --release --target aarch64-pc-windows-msvc + name: Build ${{ matrix.settings.name || matrix.settings.target }} + runs-on: ${{ matrix.settings.host }} + timeout-minutes: 30 + steps: + - name: Checkout Commit + uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v3 + if: ${{ !matrix.settings.docker }} + with: + node-version: 20 + - name: Install Toolchain + uses: dtolnay/rust-toolchain@stable + if: ${{ !matrix.settings.docker }} + with: + toolchain: nightly + targets: ${{ matrix.settings.target }} + - name: Cache cargo + uses: actions/cache@v3 + with: + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + .cargo-cache + rust/target/ + key: ${{ matrix.settings.name || matrix.settings.target }}-cargo-${{ matrix.settings.host }}-${{ hashFiles('rust/Cargo.lock') }} + restore-keys: ${{ matrix.settings.name || matrix.settings.target }}-cargo-${{ matrix.settings.host }} + - uses: goto-bus-stop/setup-zig@v2 + if: ${{ matrix.settings.zig }} + with: + version: 0.10.1 + - name: Setup toolchain + run: ${{ matrix.settings.setup }} + if: ${{ matrix.settings.setup }} + shell: bash + - name: Cache Node Modules + id: cache-node-modules + uses: actions/cache@v3 + with: + path: node_modules + key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }} + - name: Install dependencies + if: steps.cache-node-modules.outputs.cache-hit != 'true' + run: npm ci --ignore-scripts + - name: Build in docker + uses: addnab/docker-run-action@v3 + if: ${{ matrix.settings.docker }} + with: + image: ${{ matrix.settings.docker }} + options: '--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build' + run: ${{ matrix.settings.build }} + - name: Build + run: ${{ matrix.settings.build }} + if: ${{ !matrix.settings.docker }} + shell: bash + - name: Upload wasm artifact + uses: actions/upload-artifact@v3 + with: + name: bindings-${{ matrix.settings.name }} + path: ${{ matrix.settings.path }} + if-no-files-found: error + if: ${{ matrix.settings.is-wasm-build }} + - name: Upload napi artifact + uses: actions/upload-artifact@v3 + with: + name: bindings-${{ matrix.settings.target }} + path: ${{ env.APP_NAME }}.*.node + if-no-files-found: error + if: ${{ !matrix.settings.is-wasm-build }} + + test: + name: Test${{ matrix.additionalName || '' }} Node ${{ matrix.node }} (${{ matrix.settings.target }}) + needs: + - build + strategy: + fail-fast: false + matrix: + settings: + - host: ubuntu-latest + target: x86_64-unknown-linux-gnu + - host: windows-latest + target: x86_64-pc-windows-msvc + - host: macos-latest + target: x86_64-apple-darwin + node: + - '18.0.0' + - '20' + include: + - settings: + host: ubuntu-latest + target: x86_64-unknown-linux-gnu + node: '20' + command: 'ci:coverage' + additionalName: ' with Coverage' + coverage: true + - settings: + host: ubuntu-latest + target: x86_64-unknown-linux-gnu + node: '18.0.0' + command: 'ci:test:all' + additionalName: ' with Additional Tests' + runs-on: ${{ matrix.settings.host }} + timeout-minutes: 15 + steps: + - name: Checkout Commit + uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + check-latest: true + - name: Cache Node Modules + id: cache-node-modules + uses: actions/cache@v3 + with: + path: node_modules + key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }} + - name: Install dependencies + if: steps.cache-node-modules.outputs.cache-hit != 'true' + run: npm ci --ignore-scripts + - name: Download napi artifacts + uses: actions/download-artifact@v3 + with: + name: bindings-${{ matrix.settings.target }} + path: . + - name: Download wasm artifacts + uses: actions/download-artifact@v3 + with: + name: bindings-wasm + - name: Build and test Rollup + run: npm run ${{ matrix.command || 'ci:test:only' }} + env: + CI: true + - name: Upload coverage + uses: codecov/codecov-action@v3 + if: matrix.coverage + with: +# It appears adding the token may result in the coverage comment not being added +# token: ${{ secrets.CODECOV_TOKEN }} + commit_parent: ${{ github.event.pull_request.head.sha }} + + publish: + permissions: + pull-requests: write # for writing comments + name: Publish + runs-on: ubuntu-latest + timeout-minutes: 15 + needs: + - test + - lint + # TODO SWC once v4 is live, this should be changed + if: startsWith(github.ref_name, 'v4') + steps: + - name: Checkout Commit + uses: actions/checkout@v4 + with: + # Necessary to find the commits included in the release + fetch-depth: 0 + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + check-latest: true + - name: Cache Node Modules + id: cache-node-modules + uses: actions/cache@v3 + with: + path: node_modules + key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }} + - name: Install dependencies + if: steps.cache-node-modules.outputs.cache-hit != 'true' + run: npm ci --ignore-scripts + - name: Download all artifacts + uses: actions/download-artifact@v3 + with: + path: artifacts + - name: Copy wasm files + run: cp -R artifacts/bindings-wasm/wasm . + - name: Build JavaScript + run: npm run build:cjs && cp artifacts/*/*.node dist/ && npm run build:bootstrap + - name: Move artifacts + run: npm run ci:artifacts + - name: Publish + run: | + if git --no-pager log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$"; + then + echo "Publishing regular release" + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc + npm publish --access public + elif git --no-pager log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+-[0-9]\+$"; + then + echo "Publishing beta release" + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc + npm publish --tag beta --access public + else + echo "Not a release, skipping publish" + fi + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + ROLLUP_RELEASE: 'releasing' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index c776458a8..000000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,136 +0,0 @@ -name: Tests - -on: - push: - branches: - - master - pull_request: - types: [synchronize, opened, reopened] - merge_group: - -permissions: - contents: read - -jobs: - linux18: - runs-on: ubuntu-latest - timeout-minutes: 15 - name: Node 18 + Coverage (Linux) - steps: - - name: Checkout Commit - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: '18' - - name: Cache Node Modules - id: cache-node-modules - uses: actions/cache@v3 - with: - path: node_modules - key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }} - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: npm ci --ignore-scripts - - name: Run tests with coverage - run: npm run ci:coverage - env: - CI: true - - uses: codecov/codecov-action@v3 - with: -# It appears that with the token, the comment is not created -# token: ${{ secrets.CODECOV_TOKEN }} - commit_parent: ${{ github.event.pull_request.head.sha }} - - linux16: - runs-on: ubuntu-latest - timeout-minutes: 15 - name: Node 18 + Extra Tests (Linux) - steps: - - name: Checkout Commit - uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: '18' - - name: Cache Node Modules - id: cache-node-modules - uses: actions/cache@v3 - with: - path: node_modules - key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }} - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: npm ci --ignore-scripts - - name: Lint - run: npm run ci:lint - - name: Vulnerabilities - run: npm audit - - name: Run all tests - run: npm run ci:test - env: - CI: true - - macos: - runs-on: macos-latest - timeout-minutes: 15 - strategy: - matrix: - node: ['18'] - name: Node ${{ matrix.node }} (macOS) - steps: - - name: Checkout Commit - uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - - name: Cache Node Modules - id: cache-node-modules - uses: actions/cache@v3 - with: - path: node_modules - key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }} - - name: Update npm - if: (matrix.node == '14.18.0') && (steps.cache-node-modules.outputs.cache-hit != 'true') - run: npm i -g npm@8 - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: npm ci --ignore-scripts - - name: Run tests - run: npm run ci:test:only - env: - CI: true - - windows: - runs-on: windows-latest - timeout-minutes: 15 - strategy: - matrix: - node: ['18'] - name: Node ${{ matrix.node }} (Windows) - steps: - - name: Checkout Commit - uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - - name: Cache Node Modules - id: cache-node-modules - uses: actions/cache@v3 - with: - path: node_modules - key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }} - - name: Update npm - if: (matrix.node == '14.18.0') && (steps.cache-node-modules.outputs.cache-hit != 'true') - run: npm i -g npm@8 - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: npm ci --ignore-scripts - - name: Run tests - run: npm run ci:test:only - env: - CI: true diff --git a/.nycrc b/.nycrc index af7db356d..9f64cae9e 100644 --- a/.nycrc +++ b/.nycrc @@ -1,4 +1,4 @@ { - "exclude": ["test"], + "exclude": ["test", "native.js"], "extension": [".ts", ""] } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 33ef921d0..f8bd53cad 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,6 +16,12 @@ We welcome any type of contribution, not only code. You can help with Working on your first Pull Request? You can learn how from this _free_ course, [How to Contribute to an Open Source Project on GitHub](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github). +### Setting up the Rust toolchain + +Rollup now includes some Rust code. To compile it, you need to set up Rust nightly. If you haven't installed it yet, please first see https://www.rust-lang.org/tools/install to learn how to download Rustup and install Rust, then see https://rust-lang.github.io/rustup/concepts/channels.html to learn how to install Rust nightly. If everything is set up correctly, `npm run build` should complete successfully. The first build will be rather slow, but subsequent builds will be much faster. + +For local development and tests, it is even faster to run `npm run build:quick`, which does not perform a Rust production build, does not build WASM artefacts, and only builds the CommonJS version of Rollup. Note that with this build, a few tests will fail that rely on the other artefacts, see below. + ### Git configuration to enable symlinks The unit tests in this projects make use of symlinks in the git project. On Windows, this may not work as expected without extra configuration. To configure git to create symlinks on windows, you need to enable the Windows "Developer Mode" setting, and also set the `core.symlinks` git feature using either of the following commands: @@ -43,7 +49,7 @@ To save time for quick iterations, you can add `solo:true` to the `_config.js` f For those tests, it is enough to run ```shell -npm run build:cjs +npm run build:quick npm run test:quick ``` diff --git a/LICENSE.md b/LICENSE.md index a199a3149..238cabc51 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -52,71 +52,6 @@ Repository: rollup/plugins --------------------------------------- -## acorn -License: MIT -By: Marijn Haverbeke, Ingvar Stepanyan, Adrian Heine -Repository: https://github.com/acornjs/acorn.git - -> MIT License -> -> Copyright (C) 2012-2022 by various contributors (see AUTHORS) -> -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in -> all copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -> THE SOFTWARE. - ---------------------------------------- - -## acorn-import-assertions -License: MIT -By: Sven Sauleau -Repository: https://github.com/xtuc/acorn-import-assertions - ---------------------------------------- - -## acorn-walk -License: MIT -By: Marijn Haverbeke, Ingvar Stepanyan, Adrian Heine -Repository: https://github.com/acornjs/acorn.git - -> MIT License -> -> Copyright (C) 2012-2020 by various contributors (see AUTHORS) -> -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in -> all copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -> THE SOFTWARE. - ---------------------------------------- - ## anymatch License: ISC By: Elan Shanker diff --git a/browser/LICENSE.md b/browser/LICENSE.md index 356f756a3..98239aca4 100644 --- a/browser/LICENSE.md +++ b/browser/LICENSE.md @@ -52,71 +52,6 @@ Repository: rollup/plugins --------------------------------------- -## acorn -License: MIT -By: Marijn Haverbeke, Ingvar Stepanyan, Adrian Heine -Repository: https://github.com/acornjs/acorn.git - -> MIT License -> -> Copyright (C) 2012-2022 by various contributors (see AUTHORS) -> -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in -> all copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -> THE SOFTWARE. - ---------------------------------------- - -## acorn-import-assertions -License: MIT -By: Sven Sauleau -Repository: https://github.com/xtuc/acorn-import-assertions - ---------------------------------------- - -## acorn-walk -License: MIT -By: Marijn Haverbeke, Ingvar Stepanyan, Adrian Heine -Repository: https://github.com/acornjs/acorn.git - -> MIT License -> -> Copyright (C) 2012-2020 by various contributors (see AUTHORS) -> -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in -> all copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -> THE SOFTWARE. - ---------------------------------------- - ## builtin-modules License: MIT By: Sindre Sorhus diff --git a/browser/package.json b/browser/package.json index 401c1c9cf..0b03a6a38 100644 --- a/browser/package.json +++ b/browser/package.json @@ -1,6 +1,6 @@ { "name": "@rollup/browser", - "version": "3.29.4", + "version": "4.0.0-19", "description": "Next-generation ES module bundler browser build", "main": "dist/rollup.browser.js", "module": "dist/es/rollup.browser.js", @@ -20,6 +20,7 @@ }, "homepage": "https://rollupjs.org/", "files": [ + "dist/**/*.wasm", "dist/**/*.js", "dist/*.d.ts", "dist/es/package.json", diff --git a/browser/src/initWasm.ts b/browser/src/initWasm.ts new file mode 100644 index 000000000..ccd5e8d56 --- /dev/null +++ b/browser/src/initWasm.ts @@ -0,0 +1,6 @@ +// eslint-disable-next-line import/no-unresolved +import init from '../../wasm/bindings_wasm'; + +export default async function initWasm() { + await init(); +} diff --git a/browser/src/wasm.ts b/browser/src/wasm.ts new file mode 100644 index 000000000..2e9f2391a --- /dev/null +++ b/browser/src/wasm.ts @@ -0,0 +1,6 @@ +// eslint-disable-next-line import/no-unresolved +import { parse } from '../../wasm/bindings_wasm.js'; + +export default { + parse +}; diff --git a/build-plugins/aliases.ts b/build-plugins/aliases.ts index 3989f8477..85a59dc4a 100644 --- a/build-plugins/aliases.ts +++ b/build-plugins/aliases.ts @@ -2,7 +2,6 @@ import { fileURLToPath } from 'node:url'; export const moduleAliases = { entries: { - acorn: fileURLToPath(new URL('../node_modules/acorn/dist/acorn.mjs', import.meta.url)), 'help.md': fileURLToPath(new URL('../cli/help.md', import.meta.url)), 'package.json': fileURLToPath(new URL('../package.json', import.meta.url)) }, diff --git a/build-plugins/emit-native-entry.ts b/build-plugins/emit-native-entry.ts new file mode 100644 index 000000000..8b4e0ffa6 --- /dev/null +++ b/build-plugins/emit-native-entry.ts @@ -0,0 +1,15 @@ +import { readFile } from 'node:fs/promises'; +import type { Plugin } from 'rollup'; + +export function emitNativeEntry(): Plugin { + return { + async generateBundle() { + this.emitFile({ + fileName: 'native.js', + source: await readFile(new URL('../native.js', import.meta.url)), + type: 'asset' + }); + }, + name: 'emit-native-entry' + }; +} diff --git a/build-plugins/emit-wasm-file.ts b/build-plugins/emit-wasm-file.ts new file mode 100644 index 000000000..713f637c0 --- /dev/null +++ b/build-plugins/emit-wasm-file.ts @@ -0,0 +1,15 @@ +import fs from 'node:fs/promises'; +import type { Plugin } from 'rollup'; + +export default function emitWasmFile(): Plugin { + return { + async generateBundle() { + this.emitFile({ + fileName: 'bindings_wasm_bg.wasm', + source: await fs.readFile('wasm/bindings_wasm_bg.wasm'), + type: 'asset' + }); + }, + name: 'emit-wasm-file' + }; +} diff --git a/build-plugins/external-native-import.ts b/build-plugins/external-native-import.ts new file mode 100644 index 000000000..842dfddc9 --- /dev/null +++ b/build-plugins/external-native-import.ts @@ -0,0 +1,17 @@ +import type { Plugin } from 'rollup'; + +export function externalNativeImport(): Plugin { + return { + name: 'external-native-import', + async resolveId(id, importer) { + if (id.includes('/native')) { + const resolved = await this.resolve(id, importer!, { skipSelf: true }); + const resolvedId = resolved!.id; + return { + external: 'relative', + id: resolvedId.endsWith('.js') ? resolvedId : `${resolvedId}.js` + }; + } + } + }; +} diff --git a/build-plugins/replace-browser-modules.ts b/build-plugins/replace-browser-modules.ts index e00234124..f8a8af2e9 100644 --- a/build-plugins/replace-browser-modules.ts +++ b/build-plugins/replace-browser-modules.ts @@ -4,26 +4,31 @@ import type { Plugin } from 'vite'; const resolve = (path: string) => fileURLToPath(new URL(`../${path}`, import.meta.url)); -const REPLACED_MODULES = [ +const JS_REPLACED_MODULES = [ 'crypto', 'fs', 'hookActions', 'path', 'performance', 'process', - 'resolveId' + 'resolveId', + 'initWasm' ]; -const resolutions: ReadonlyMap = new Map( - REPLACED_MODULES.flatMap(module => { - const originalId = resolve(`src/utils/${module}`); - const replacementId = resolve(`browser/src/${module}.ts`); - return [ - [originalId, replacementId], - [`${originalId}.ts`, replacementId] - ]; - }) -); +type ModulesMap = [string, string][]; + +const jsModulesMap: ModulesMap = JS_REPLACED_MODULES.flatMap(module => { + const originalId = resolve(`src/utils/${module}`); + const replacementId = resolve(`browser/src/${module}.ts`); + return [ + [originalId, replacementId], + [`${originalId}.ts`, replacementId] + ]; +}); + +const wasmModulesMap: ModulesMap = [[resolve('native'), resolve('browser/src/wasm.ts')]]; + +const resolutions: ReadonlyMap = new Map([...jsModulesMap, ...wasmModulesMap]); export default function replaceBrowserModules(): Plugin { return { diff --git a/cli/help.md b/cli/help.md index 74afadf40..99ce75d39 100644 --- a/cli/help.md +++ b/cli/help.md @@ -35,7 +35,7 @@ Basic options: --no-esModule Do not add __esModule property --exports Specify export mode (auto, default, named, none) --extend Extend global variable defined by --name ---no-externalImportAssertions Omit import assertions in "es" output +--no-externalImportAttributes Omit import attributes in "es" output --no-externalLiveBindings Do not generate code to support live bindings --failAfterWarnings Exit with an error if the build produced warnings --filterLogs Filter log messages diff --git a/docs/.vitepress/verify-anchors.ts b/docs/.vitepress/verify-anchors.ts index 37c75eaa1..09122401e 100644 --- a/docs/.vitepress/verify-anchors.ts +++ b/docs/.vitepress/verify-anchors.ts @@ -30,7 +30,7 @@ function updateLegacySlugsFile() { if (originalSlugsFileText !== slugsFileText) { writeFileSync(slugsFile, slugsFileText); throw new Error( - `The content of the legacy anchor mapping file has changed. You should run "npm run build" locally and commit the updated file.` + `The content of the legacy anchor mapping file has changed. You should run "npm run build:docs" locally and commit the updated file.` ); } } diff --git a/docs/command-line-interface/index.md b/docs/command-line-interface/index.md index b223f7caa..73d5f073f 100755 --- a/docs/command-line-interface/index.md +++ b/docs/command-line-interface/index.md @@ -57,8 +57,6 @@ export default { strictDeprecations, // danger zone - acorn, - acornInjectPlugins, context, moduleContext, preserveSymlinks, @@ -89,7 +87,7 @@ export default { dynamicImportInCjs, entryFileNames, extend, - externalImportAssertions, + externalImportAttributes, footer, generatedCode, hoistTransitiveImports, @@ -387,7 +385,7 @@ Many options have command line equivalents. In those cases, any arguments passed --no-esModule Do not add __esModule property --exports Specify export mode (auto, default, named, none) --extend Extend global variable defined by --name ---no-externalImportAssertions Omit import assertions in "es" output +--no-externalImportAttributes Omit import attributes in "es" output --no-externalLiveBindings Do not generate code to support live bindings --failAfterWarnings Exit with an error if the build produced warnings --filterLogs Filter log messages diff --git a/docs/configuration-options/index.md b/docs/configuration-options/index.md index 08485f511..543e81b0f 100755 --- a/docs/configuration-options/index.md +++ b/docs/configuration-options/index.md @@ -678,15 +678,15 @@ This pattern will also be used for every file when setting the [`output.preserve Whether to extend the global variable defined by the `name` option in `umd` or `iife` formats. When `true`, the global variable will be defined as `(global.name = global.name || {})`. When false, the global defined by `name` will be overwritten like `(global.name = {})`. -### output.externalImportAssertions +### output.externalImportAttributes | | | | -------: | :----------------------------------------------------------- | | Type: | `boolean` | -| CLI: | `--externalImportAssertions`/`--no-externalImportAssertions` | +| CLI: | `--externalImportAttributes`/`--no-externalImportAttributes` | | Default: | `true` | -Whether to add import assertions to external imports in the output if the output format is `es`. By default, assertions are taken from the input files, but plugins can add or remove assertions later. E.g. `import "foo" assert {type: "json"}` will cause the same import to appear in the output unless the option is set to `false`. Note that all imports of a module need to have consistent assertions, otherwise a warning is emitted. +Whether to add import attributes to external imports in the output if the output format is `es`. By default, attributes are taken from the input files, but plugins can add or remove attributes later. E.g. `import "foo" assert {type: "json"}` will cause the same import to appear in the output unless the option is set to `false`. Note that all imports of a module need to have consistent attributes, otherwise a warning is emitted. ### output.generatedCode @@ -1653,33 +1653,6 @@ This flag is intended to be used by e.g. plugin authors to be able to adjust the You probably don't need to use these options unless you know what you are doing! -### acorn - -| | | -| ----: | :------------- | -| Type: | `AcornOptions` | - -Any options that should be passed through to Acorn's `parse` function, such as `allowReserved: true`. Cf. the [Acorn documentation](https://github.com/acornjs/acorn/tree/master/acorn#interface) for more available options. - -### acornInjectPlugins - -| | | -| ----: | :--------------------------------------------- | -| Type: | `AcornPluginFunction \| AcornPluginFunction[]` | - -A single plugin or an array of plugins to be injected into Acorn. For instance to use JSX syntax, you can specify - -```javascript -import jsx from 'acorn-jsx'; - -export default { - // … other options … - acornInjectPlugins: [jsx()] -}; -``` - -in your rollup configuration. Note that this is different from using Babel in that the generated output will still contain JSX while Babel will replace it with valid JavaScript. - ### context | | | @@ -2627,6 +2600,18 @@ _This option is no longer needed._ This option was used to prevent performance issues with the full chunk optimization algorithm. As the algorithm is much faster now, this option is now ignored by Rollup and should no longer be used. +### output.externalImportAssertions + +_Use the [`output.externalImportAttributes`](#output-externalimportattributes) option instead._ + +| | | +| -------: | :----------------------------------------------------------- | +| Type: | `boolean` | +| CLI: | `--externalImportAssertions`/`--no-externalImportAssertions` | +| Default: | `true` | + +Whether to add import assertions to external imports in the output if the output format is `es`. By default, assertions are taken from the input files, but plugins can add or remove assertions later. E.g. `import "foo" assert {type: "json"}` will cause the same import to appear in the output unless the option is set to `false`. Note that all imports of a module need to have consistent assertions, otherwise a warning is emitted. + ### output.preferConst _Use the [`output.generatedCode.constBindings`](#output-generatedcode-constbindings) option instead._ diff --git a/docs/guide/en/slugs-and-pages-by-legacy-slugs.json b/docs/guide/en/slugs-and-pages-by-legacy-slugs.json index fc59c07d5..07eacc06d 100644 --- a/docs/guide/en/slugs-and-pages-by-legacy-slugs.json +++ b/docs/guide/en/slugs-and-pages-by-legacy-slugs.json @@ -1 +1 @@ -{"--bundleconfigascjs":["command-line-interface","bundleconfigascjs"],"--configplugin-plugin":["command-line-interface","configplugin-plugin"],"--environment-values":["command-line-interface","environment-values"],"--failafterwarnings":["command-line-interface","failafterwarnings"],"--no-stdin":["command-line-interface","no-stdin"],"--silent":["command-line-interface","silent"],"--stdinext":["command-line-interface","stdin-ext"],"--waitforbundleinput":["command-line-interface","waitforbundleinput"],"--watchonstart-cmd---watchonbundlestart-cmd---watchonbundleend-cmd---watchonend-cmd---watchonerror-cmd":["command-line-interface","watch-onstart-cmd-watch-onbundlestart-cmd-watch-onbundleend-cmd-watch-onend-cmd-watch-onerror-cmd"],"-h--help":["command-line-interface","h-help"],"-p-plugin---plugin-plugin":["command-line-interface","p-plugin-plugin-plugin"],"-v--version":["command-line-interface","v-version"],"-w--watch":["command-line-interface","w-watch"],"a-simple-example":["plugin-development","a-simple-example"],"acorn":["configuration-options","acorn"],"acorninjectplugins":["configuration-options","acorninjectplugins"],"advanced-functionality":["configuration-options","advanced-functionality"],"augmentchunkhash":["plugin-development","augmentchunkhash"],"avoiding-eval":["troubleshooting","avoiding-eval"],"babel":["tools","babel"],"banner":["plugin-development","banner"],"big-list-of-options":["configuration-options",""],"build-hooks":["plugin-development","build-hooks"],"buildend":["plugin-development","buildend"],"buildstart":["plugin-development","buildstart"],"cache":["configuration-options","cache"],"caveats-when-using-native-node-es-modules":["command-line-interface","caveats-when-using-native-node-es-modules"],"changed-defaults":["migration","changed-defaults"],"changes-to-the-plugin-api":["migration","changes-to-the-plugin-api"],"closebundle":["plugin-development","closebundle"],"closewatcher":["plugin-development","closewatcher"],"code-splitting":["tutorial","code-splitting"],"command-line-flags":["command-line-interface","command-line-flags"],"command-line-reference":["command-line-interface",""],"compatibility":["introduction","compatibility"],"config-intellisense":["command-line-interface","config-intellisense"],"configuration-files":["command-line-interface","configuration-files"],"context":["configuration-options","context"],"conventions":["plugin-development","conventions"],"core-functionality":["configuration-options","core-functionality"],"creating-your-first-bundle":["tutorial","creating-your-first-bundle"],"custom-module-meta-data":["plugin-development","custom-module-meta-data"],"custom-resolver-options":["plugin-development","custom-resolver-options"],"danger-zone":["configuration-options","danger-zone"],"default-export":["es-module-syntax","default-export"],"default-import":["es-module-syntax","default-import"],"deno":["tools","deno"],"deprecated-context-functions":["plugin-development","deprecated-context-functions"],"deprecated-options":["configuration-options","deprecated-options"],"differences-to-the-javascript-api":["command-line-interface","differences-to-the-javascript-api"],"direct-plugin-communication":["plugin-development","direct-plugin-communication"],"dynamic-import":["es-module-syntax","dynamic-import"],"dynamic-import-in-commonjs-output":["migration","dynamic-import-in-commonjs-output"],"empty-import":["es-module-syntax","empty-import"],"error-emfile-too-many-open-files":["troubleshooting","error-emfile-too-many-open-files"],"error-javascript-heap-out-of-memory":["troubleshooting","error-javascript-heap-out-of-memory"],"error-name-is-not-exported-by-module":["troubleshooting","error-name-is-not-exported-by-module"],"error-node-tried-to-load-your-configuration-file-as-commonjs-even-though-it-is-likely-an-es-module":["troubleshooting","error-node-tried-to-load-your-configuration-file-as-commonjs-even-though-it-is-likely-an-es-module"],"error-this-is-undefined":["troubleshooting","error-this-is-undefined"],"es-module-syntax":["es-module-syntax",""],"eval2--eval":["troubleshooting","eval2-eval"],"example-transformer":["plugin-development","example-transformer"],"experimental-options":["configuration-options","experimental-options"],"experimentalcacheexpiry":["configuration-options","experimentalcacheexpiry"],"exporting":["es-module-syntax","exporting"],"external":["configuration-options","external"],"faqs":["faqs",""],"file-urls":["plugin-development","file-urls"],"footer":["plugin-development","footer"],"generatebundle":["plugin-development","generatebundle"],"getting-the-current-directory":["command-line-interface","getting-the-current-directory"],"gulp":["tools","gulp"],"how-bindings-work":["es-module-syntax","how-bindings-work"],"how-do-i-add-polyfills-to-a-rollup-bundle":["faqs","how-do-i-add-polyfills-to-a-rollup-bundle"],"how-do-i-run-rollup-itself-in-a-browser":["faqs","how-do-i-run-rollup-itself-in-a-browser"],"how-do-i-use-rollup-in-nodejs-with-commonjs-modules":["faqs","how-do-i-use-rollup-in-node-js-with-commonjs-modules"],"importing":["es-module-syntax","importing"],"importing-commonjs":["introduction","importing-commonjs"],"importing-packagejson":["command-line-interface","importing-package-json"],"inlinedynamicimports":["configuration-options","inlinedynamicimports"],"input":["configuration-options","input"],"inputoptions-object":["javascript-api","inputoptions-object"],"installation":["introduction","installation"],"installing-rollup-locally":["tutorial","installing-rollup-locally"],"inter-plugin-communication":["plugin-development","inter-plugin-communication"],"intro":["plugin-development","intro"],"introduction":["introduction",""],"is-rollup-meant-for-building-libraries-or-applications":["faqs","is-rollup-meant-for-building-libraries-or-applications"],"javascript-api":["javascript-api",""],"load":["plugin-development","load"],"loading-a-configuration-from-a-node-package":["command-line-interface","loading-a-configuration-from-a-node-package"],"makeabsoluteexternalsrelative":["configuration-options","makeabsoluteexternalsrelative"],"manualchunks":["configuration-options","manualchunks"],"maxparallelfileops":["configuration-options","maxparallelfileops"],"maxparallelfilereads":["configuration-options","maxparallelfilereads"],"migration":["migration",""],"modulecontext":["configuration-options","modulecontext"],"moduleparsed":["plugin-development","moduleparsed"],"more-changed-options":["migration","more-changed-options"],"name":["plugin-development","name"],"named-exports":["es-module-syntax","named-exports"],"named-imports":["es-module-syntax","named-imports"],"namespace-imports":["es-module-syntax","namespace-imports"],"new-function":["troubleshooting","new-function"],"onwarn":["configuration-options","onwarn"],"options":["plugin-development","options"],"output-generation-hooks":["plugin-development","output-generation-hooks"],"outputamd":["configuration-options","output-amd"],"outputassetfilenames":["configuration-options","output-assetfilenames"],"outputbanneroutputfooter":["configuration-options","output-banner-output-footer"],"outputchunkfilenames":["configuration-options","output-chunkfilenames"],"outputcompact":["configuration-options","output-compact"],"outputdir":["configuration-options","output-dir"],"outputdynamicimportfunction":["configuration-options","output-dynamicimportfunction"],"outputdynamicimportincjs":["configuration-options","output-dynamicimportincjs"],"outputentryfilenames":["configuration-options","output-entryfilenames"],"outputesmodule":["configuration-options","output-esmodule"],"outputexports":["configuration-options","output-exports"],"outputextend":["configuration-options","output-extend"],"outputexternalimportassertions":["configuration-options","output-externalimportassertions"],"outputexternallivebindings":["configuration-options","output-externallivebindings"],"outputfile":["configuration-options","output-file"],"outputformat":["configuration-options","output-format"],"outputfreeze":["configuration-options","output-freeze"],"outputgeneratedcode":["configuration-options","output-generatedcode"],"outputglobals":["configuration-options","output-globals"],"outputhoisttransitiveimports":["configuration-options","output-hoisttransitiveimports"],"outputindent":["configuration-options","output-indent"],"outputinlinedynamicimports":["configuration-options","output-inlinedynamicimports"],"outputinterop":["configuration-options","output-interop"],"outputintrooutputoutro":["configuration-options","output-intro-output-outro"],"outputmanualchunks":["configuration-options","output-manualchunks"],"outputminifyinternalexports":["configuration-options","output-minifyinternalexports"],"outputname":["configuration-options","output-name"],"outputnamespacetostringtag":["configuration-options","output-namespacetostringtag"],"outputnoconflict":["configuration-options","output-noconflict"],"outputoptions":["plugin-development","outputoptions"],"outputoptions-object":["javascript-api","outputoptions-object"],"outputpaths":["configuration-options","output-paths"],"outputplugins":["configuration-options","output-plugins"],"outputpreferconst":["configuration-options","output-preferconst"],"outputpreservemodules":["configuration-options","output-preservemodules"],"outputpreservemodulesroot":["configuration-options","output-preservemodulesroot"],"outputsanitizefilename":["configuration-options","output-sanitizefilename"],"outputsourcemap":["configuration-options","output-sourcemap"],"outputsourcemapbaseurl":["configuration-options","output-sourcemapbaseurl"],"outputsourcemapexcludesources":["configuration-options","output-sourcemapexcludesources"],"outputsourcemapfile":["configuration-options","output-sourcemapfile"],"outputsourcemappathtransform":["configuration-options","output-sourcemappathtransform"],"outputstrict":["configuration-options","output-strict"],"outputsystemnullsetters":["configuration-options","output-systemnullsetters"],"outputvalidate":["configuration-options","output-validate"],"outro":["plugin-development","outro"],"overview":["introduction","overview"],"peer-dependencies":["tools","peer-dependencies"],"perf":["configuration-options","perf"],"plugin-context":["plugin-development","plugin-context"],"plugin-development":["plugin-development",""],"plugins":["configuration-options","plugins"],"plugins-overview":["plugin-development","plugins-overview"],"prerequisites":["migration","prerequisites"],"preserveentrysignatures":["configuration-options","preserveentrysignatures"],"preservemodules":["configuration-options","preservemodules"],"preservesymlinks":["configuration-options","preservesymlinks"],"programmatically-loading-a-config-file":["javascript-api","programmatically-loading-a-config-file"],"properties":["plugin-development","properties"],"publishing-es-modules":["introduction","publishing-es-modules"],"quick-start":["introduction","quick-start"],"reading-a-file-from-stdin":["command-line-interface","reading-a-file-from-stdin"],"renderchunk":["plugin-development","renderchunk"],"renderdynamicimport":["plugin-development","renderdynamicimport"],"rendererror":["plugin-development","rendererror"],"renderstart":["plugin-development","renderstart"],"resolvedynamicimport":["plugin-development","resolvedynamicimport"],"resolvefileurl":["plugin-development","resolvefileurl"],"resolveid":["plugin-development","resolveid"],"resolveimportmeta":["plugin-development","resolveimportmeta"],"rollupplugin-commonjs":["tools","rollup-plugin-commonjs"],"rollupplugin-node-resolve":["tools","rollup-plugin-node-resolve"],"rolluprollup":["javascript-api","rollup-rollup"],"rollupwatch":["javascript-api","rollup-watch"],"shimmissingexports":["configuration-options","shimmissingexports"],"shouldtransformcachedmodule":["plugin-development","shouldtransformcachedmodule"],"source-code-transformations":["plugin-development","source-code-transformations"],"strictdeprecations":["configuration-options","strictdeprecations"],"synthetic-named-exports":["plugin-development","synthetic-named-exports"],"the-why":["introduction","the-why"],"thisaddwatchfile":["plugin-development","this-addwatchfile"],"thisemitfile":["plugin-development","this-emitfile"],"thiserror":["plugin-development","this-error"],"thisgetcombinedsourcemap":["plugin-development","this-getcombinedsourcemap"],"thisgetfilename":["plugin-development","this-getfilename"],"thisgetmoduleids":["plugin-development","this-getmoduleids"],"thisgetmoduleinfo":["plugin-development","this-getmoduleinfo"],"thisgetwatchfiles":["plugin-development","this-getwatchfiles"],"thisload":["plugin-development","this-load"],"thismeta":["plugin-development","this-meta"],"thisparse":["plugin-development","this-parse"],"thisresolve":["plugin-development","this-resolve"],"thissetassetsource":["plugin-development","this-setassetsource"],"thiswarn":["plugin-development","this-warn"],"tools":["tools",""],"transform":["plugin-development","transform"],"transformers":["plugin-development","transformers"],"tree-shaking":["introduction","tree-shaking"],"tree-shaking-doesnt-seem-to-be-working":["troubleshooting","tree-shaking-doesn-t-seem-to-be-working"],"treeshake":["configuration-options","treeshake"],"troubleshooting":["troubleshooting",""],"tutorial":["tutorial",""],"using-config-files":["tutorial","using-config-files"],"using-configuration-files":["migration","using-configuration-files"],"using-output-plugins":["tutorial","using-output-plugins"],"using-plugins":["tutorial","using-plugins"],"warning-sourcemap-is-likely-to-be-incorrect":["troubleshooting","warning-sourcemap-is-likely-to-be-incorrect"],"warning-treating-module-as-external-dependency":["troubleshooting","warning-treating-module-as-external-dependency"],"watch-options":["configuration-options","watch"],"watchbuilddelay":["configuration-options","watch-builddelay"],"watchchange":["plugin-development","watchchange"],"watchchokidar":["configuration-options","watch-chokidar"],"watchclearscreen":["configuration-options","watch-clearscreen"],"watchexclude":["configuration-options","watch-exclude"],"watchinclude":["configuration-options","watch-include"],"watchoptions":["javascript-api","watchoptions"],"watchskipwrite":["configuration-options","watch-skipwrite"],"what-is-tree-shaking":["faqs","what-is-tree-shaking"],"who-made-the-rollup-logo-its-lovely":["faqs","who-made-the-rollup-logo-it-s-lovely"],"why-are-es-modules-better-than-commonjs-modules":["faqs","why-are-es-modules-better-than-commonjs-modules"],"why-do-additional-imports-turn-up-in-my-entry-chunks-when-code-splitting":["faqs","why-do-additional-imports-turn-up-in-my-entry-chunks-when-code-splitting"],"why-isnt-node-resolve-a-built-in-feature":["faqs","why-isn-t-node-resolve-a-built-in-feature"],"with-npm-packages":["tools","with-npm-packages"],"writebundle":["plugin-development","writebundle"]} \ No newline at end of file +{"--bundleconfigascjs":["command-line-interface","bundleconfigascjs"],"--configplugin-plugin":["command-line-interface","configplugin-plugin"],"--environment-values":["command-line-interface","environment-values"],"--failafterwarnings":["command-line-interface","failafterwarnings"],"--no-stdin":["command-line-interface","no-stdin"],"--silent":["command-line-interface","silent"],"--stdinext":["command-line-interface","stdin-ext"],"--waitforbundleinput":["command-line-interface","waitforbundleinput"],"--watchonstart-cmd---watchonbundlestart-cmd---watchonbundleend-cmd---watchonend-cmd---watchonerror-cmd":["command-line-interface","watch-onstart-cmd-watch-onbundlestart-cmd-watch-onbundleend-cmd-watch-onend-cmd-watch-onerror-cmd"],"-h--help":["command-line-interface","h-help"],"-p-plugin---plugin-plugin":["command-line-interface","p-plugin-plugin-plugin"],"-v--version":["command-line-interface","v-version"],"-w--watch":["command-line-interface","w-watch"],"a-simple-example":["plugin-development","a-simple-example"],"advanced-functionality":["configuration-options","advanced-functionality"],"augmentchunkhash":["plugin-development","augmentchunkhash"],"avoiding-eval":["troubleshooting","avoiding-eval"],"babel":["tools","babel"],"banner":["plugin-development","banner"],"big-list-of-options":["configuration-options",""],"build-hooks":["plugin-development","build-hooks"],"buildend":["plugin-development","buildend"],"buildstart":["plugin-development","buildstart"],"cache":["configuration-options","cache"],"caveats-when-using-native-node-es-modules":["command-line-interface","caveats-when-using-native-node-es-modules"],"changed-defaults":["migration","changed-defaults"],"changes-to-the-plugin-api":["migration","changes-to-the-plugin-api"],"closebundle":["plugin-development","closebundle"],"closewatcher":["plugin-development","closewatcher"],"code-splitting":["tutorial","code-splitting"],"command-line-flags":["command-line-interface","command-line-flags"],"command-line-reference":["command-line-interface",""],"compatibility":["introduction","compatibility"],"config-intellisense":["command-line-interface","config-intellisense"],"configuration-files":["command-line-interface","configuration-files"],"context":["configuration-options","context"],"conventions":["plugin-development","conventions"],"core-functionality":["configuration-options","core-functionality"],"creating-your-first-bundle":["tutorial","creating-your-first-bundle"],"custom-module-meta-data":["plugin-development","custom-module-meta-data"],"custom-resolver-options":["plugin-development","custom-resolver-options"],"danger-zone":["configuration-options","danger-zone"],"default-export":["es-module-syntax","default-export"],"default-import":["es-module-syntax","default-import"],"deno":["tools","deno"],"deprecated-context-functions":["plugin-development","deprecated-context-functions"],"deprecated-options":["configuration-options","deprecated-options"],"differences-to-the-javascript-api":["command-line-interface","differences-to-the-javascript-api"],"direct-plugin-communication":["plugin-development","direct-plugin-communication"],"dynamic-import":["es-module-syntax","dynamic-import"],"dynamic-import-in-commonjs-output":["migration","dynamic-import-in-commonjs-output"],"empty-import":["es-module-syntax","empty-import"],"error-emfile-too-many-open-files":["troubleshooting","error-emfile-too-many-open-files"],"error-javascript-heap-out-of-memory":["troubleshooting","error-javascript-heap-out-of-memory"],"error-name-is-not-exported-by-module":["troubleshooting","error-name-is-not-exported-by-module"],"error-node-tried-to-load-your-configuration-file-as-commonjs-even-though-it-is-likely-an-es-module":["troubleshooting","error-node-tried-to-load-your-configuration-file-as-commonjs-even-though-it-is-likely-an-es-module"],"error-this-is-undefined":["troubleshooting","error-this-is-undefined"],"es-module-syntax":["es-module-syntax",""],"eval2--eval":["troubleshooting","eval2-eval"],"example-transformer":["plugin-development","example-transformer"],"experimental-options":["configuration-options","experimental-options"],"experimentalcacheexpiry":["configuration-options","experimentalcacheexpiry"],"exporting":["es-module-syntax","exporting"],"external":["configuration-options","external"],"faqs":["faqs",""],"file-urls":["plugin-development","file-urls"],"footer":["plugin-development","footer"],"generatebundle":["plugin-development","generatebundle"],"getting-the-current-directory":["command-line-interface","getting-the-current-directory"],"gulp":["tools","gulp"],"how-bindings-work":["es-module-syntax","how-bindings-work"],"how-do-i-add-polyfills-to-a-rollup-bundle":["faqs","how-do-i-add-polyfills-to-a-rollup-bundle"],"how-do-i-run-rollup-itself-in-a-browser":["faqs","how-do-i-run-rollup-itself-in-a-browser"],"how-do-i-use-rollup-in-nodejs-with-commonjs-modules":["faqs","how-do-i-use-rollup-in-node-js-with-commonjs-modules"],"importing":["es-module-syntax","importing"],"importing-commonjs":["introduction","importing-commonjs"],"importing-packagejson":["command-line-interface","importing-package-json"],"inlinedynamicimports":["configuration-options","inlinedynamicimports"],"input":["configuration-options","input"],"inputoptions-object":["javascript-api","inputoptions-object"],"installation":["introduction","installation"],"installing-rollup-locally":["tutorial","installing-rollup-locally"],"inter-plugin-communication":["plugin-development","inter-plugin-communication"],"intro":["plugin-development","intro"],"introduction":["introduction",""],"is-rollup-meant-for-building-libraries-or-applications":["faqs","is-rollup-meant-for-building-libraries-or-applications"],"javascript-api":["javascript-api",""],"load":["plugin-development","load"],"loading-a-configuration-from-a-node-package":["command-line-interface","loading-a-configuration-from-a-node-package"],"makeabsoluteexternalsrelative":["configuration-options","makeabsoluteexternalsrelative"],"manualchunks":["configuration-options","manualchunks"],"maxparallelfileops":["configuration-options","maxparallelfileops"],"maxparallelfilereads":["configuration-options","maxparallelfilereads"],"migration":["migration",""],"modulecontext":["configuration-options","modulecontext"],"moduleparsed":["plugin-development","moduleparsed"],"more-changed-options":["migration","more-changed-options"],"name":["plugin-development","name"],"named-exports":["es-module-syntax","named-exports"],"named-imports":["es-module-syntax","named-imports"],"namespace-imports":["es-module-syntax","namespace-imports"],"new-function":["troubleshooting","new-function"],"onwarn":["configuration-options","onwarn"],"options":["plugin-development","options"],"output-generation-hooks":["plugin-development","output-generation-hooks"],"outputamd":["configuration-options","output-amd"],"outputassetfilenames":["configuration-options","output-assetfilenames"],"outputbanneroutputfooter":["configuration-options","output-banner-output-footer"],"outputchunkfilenames":["configuration-options","output-chunkfilenames"],"outputcompact":["configuration-options","output-compact"],"outputdir":["configuration-options","output-dir"],"outputdynamicimportfunction":["configuration-options","output-dynamicimportfunction"],"outputdynamicimportincjs":["configuration-options","output-dynamicimportincjs"],"outputentryfilenames":["configuration-options","output-entryfilenames"],"outputesmodule":["configuration-options","output-esmodule"],"outputexports":["configuration-options","output-exports"],"outputextend":["configuration-options","output-extend"],"outputexternalimportassertions":["configuration-options","output-externalimportassertions"],"outputexternallivebindings":["configuration-options","output-externallivebindings"],"outputfile":["configuration-options","output-file"],"outputformat":["configuration-options","output-format"],"outputfreeze":["configuration-options","output-freeze"],"outputgeneratedcode":["configuration-options","output-generatedcode"],"outputglobals":["configuration-options","output-globals"],"outputhoisttransitiveimports":["configuration-options","output-hoisttransitiveimports"],"outputindent":["configuration-options","output-indent"],"outputinlinedynamicimports":["configuration-options","output-inlinedynamicimports"],"outputinterop":["configuration-options","output-interop"],"outputintrooutputoutro":["configuration-options","output-intro-output-outro"],"outputmanualchunks":["configuration-options","output-manualchunks"],"outputminifyinternalexports":["configuration-options","output-minifyinternalexports"],"outputname":["configuration-options","output-name"],"outputnamespacetostringtag":["configuration-options","output-namespacetostringtag"],"outputnoconflict":["configuration-options","output-noconflict"],"outputoptions":["plugin-development","outputoptions"],"outputoptions-object":["javascript-api","outputoptions-object"],"outputpaths":["configuration-options","output-paths"],"outputplugins":["configuration-options","output-plugins"],"outputpreferconst":["configuration-options","output-preferconst"],"outputpreservemodules":["configuration-options","output-preservemodules"],"outputpreservemodulesroot":["configuration-options","output-preservemodulesroot"],"outputsanitizefilename":["configuration-options","output-sanitizefilename"],"outputsourcemap":["configuration-options","output-sourcemap"],"outputsourcemapbaseurl":["configuration-options","output-sourcemapbaseurl"],"outputsourcemapexcludesources":["configuration-options","output-sourcemapexcludesources"],"outputsourcemapfile":["configuration-options","output-sourcemapfile"],"outputsourcemappathtransform":["configuration-options","output-sourcemappathtransform"],"outputstrict":["configuration-options","output-strict"],"outputsystemnullsetters":["configuration-options","output-systemnullsetters"],"outputvalidate":["configuration-options","output-validate"],"outro":["plugin-development","outro"],"overview":["introduction","overview"],"peer-dependencies":["tools","peer-dependencies"],"perf":["configuration-options","perf"],"plugin-context":["plugin-development","plugin-context"],"plugin-development":["plugin-development",""],"plugins":["configuration-options","plugins"],"plugins-overview":["plugin-development","plugins-overview"],"prerequisites":["migration","prerequisites"],"preserveentrysignatures":["configuration-options","preserveentrysignatures"],"preservemodules":["configuration-options","preservemodules"],"preservesymlinks":["configuration-options","preservesymlinks"],"programmatically-loading-a-config-file":["javascript-api","programmatically-loading-a-config-file"],"properties":["plugin-development","properties"],"publishing-es-modules":["introduction","publishing-es-modules"],"quick-start":["introduction","quick-start"],"reading-a-file-from-stdin":["command-line-interface","reading-a-file-from-stdin"],"renderchunk":["plugin-development","renderchunk"],"renderdynamicimport":["plugin-development","renderdynamicimport"],"rendererror":["plugin-development","rendererror"],"renderstart":["plugin-development","renderstart"],"resolvedynamicimport":["plugin-development","resolvedynamicimport"],"resolvefileurl":["plugin-development","resolvefileurl"],"resolveid":["plugin-development","resolveid"],"resolveimportmeta":["plugin-development","resolveimportmeta"],"rollupplugin-commonjs":["tools","rollup-plugin-commonjs"],"rollupplugin-node-resolve":["tools","rollup-plugin-node-resolve"],"rolluprollup":["javascript-api","rollup-rollup"],"rollupwatch":["javascript-api","rollup-watch"],"shimmissingexports":["configuration-options","shimmissingexports"],"shouldtransformcachedmodule":["plugin-development","shouldtransformcachedmodule"],"source-code-transformations":["plugin-development","source-code-transformations"],"strictdeprecations":["configuration-options","strictdeprecations"],"synthetic-named-exports":["plugin-development","synthetic-named-exports"],"the-why":["introduction","the-why"],"thisaddwatchfile":["plugin-development","this-addwatchfile"],"thisemitfile":["plugin-development","this-emitfile"],"thiserror":["plugin-development","this-error"],"thisgetcombinedsourcemap":["plugin-development","this-getcombinedsourcemap"],"thisgetfilename":["plugin-development","this-getfilename"],"thisgetmoduleids":["plugin-development","this-getmoduleids"],"thisgetmoduleinfo":["plugin-development","this-getmoduleinfo"],"thisgetwatchfiles":["plugin-development","this-getwatchfiles"],"thisload":["plugin-development","this-load"],"thismeta":["plugin-development","this-meta"],"thisparse":["plugin-development","this-parse"],"thisresolve":["plugin-development","this-resolve"],"thissetassetsource":["plugin-development","this-setassetsource"],"thiswarn":["plugin-development","this-warn"],"tools":["tools",""],"transform":["plugin-development","transform"],"transformers":["plugin-development","transformers"],"tree-shaking":["introduction","tree-shaking"],"tree-shaking-doesnt-seem-to-be-working":["troubleshooting","tree-shaking-doesn-t-seem-to-be-working"],"treeshake":["configuration-options","treeshake"],"troubleshooting":["troubleshooting",""],"tutorial":["tutorial",""],"using-config-files":["tutorial","using-config-files"],"using-configuration-files":["migration","using-configuration-files"],"using-output-plugins":["tutorial","using-output-plugins"],"using-plugins":["tutorial","using-plugins"],"warning-sourcemap-is-likely-to-be-incorrect":["troubleshooting","warning-sourcemap-is-likely-to-be-incorrect"],"warning-treating-module-as-external-dependency":["troubleshooting","warning-treating-module-as-external-dependency"],"watch-options":["configuration-options","watch"],"watchbuilddelay":["configuration-options","watch-builddelay"],"watchchange":["plugin-development","watchchange"],"watchchokidar":["configuration-options","watch-chokidar"],"watchclearscreen":["configuration-options","watch-clearscreen"],"watchexclude":["configuration-options","watch-exclude"],"watchinclude":["configuration-options","watch-include"],"watchoptions":["javascript-api","watchoptions"],"watchskipwrite":["configuration-options","watch-skipwrite"],"what-is-tree-shaking":["faqs","what-is-tree-shaking"],"who-made-the-rollup-logo-its-lovely":["faqs","who-made-the-rollup-logo-it-s-lovely"],"why-are-es-modules-better-than-commonjs-modules":["faqs","why-are-es-modules-better-than-commonjs-modules"],"why-do-additional-imports-turn-up-in-my-entry-chunks-when-code-splitting":["faqs","why-do-additional-imports-turn-up-in-my-entry-chunks-when-code-splitting"],"why-isnt-node-resolve-a-built-in-feature":["faqs","why-isn-t-node-resolve-a-built-in-feature"],"with-npm-packages":["tools","with-npm-packages"],"writebundle":["plugin-development","writebundle"]} \ No newline at end of file diff --git a/docs/javascript-api/index.md b/docs/javascript-api/index.md index e23428449..dee42b402 100755 --- a/docs/javascript-api/index.md +++ b/docs/javascript-api/index.md @@ -127,8 +127,6 @@ const inputOptions = { strictDeprecations, // danger zone - acorn, - acornInjectPlugins, context, moduleContext, preserveSymlinks, @@ -164,7 +162,7 @@ const outputOptions = { dynamicImportInCjs, entryFileNames, extend, - externalImportAssertions, + externalImportAttributes, footer, generatedCode, hoistTransitiveImports, diff --git a/docs/plugin-development/index.md b/docs/plugin-development/index.md index 370ce9535..404fa9c2b 100644 --- a/docs/plugin-development/index.md +++ b/docs/plugin-development/index.md @@ -417,7 +417,7 @@ Like the [`onLog`](#onlog) hook, this hook does not have access to most [plugin ```typescript type ResolveDynamicImportHook = ( - specifier: string | AcornNode, + specifier: string | AstNode, importer: string, options: { assertions: Record } ) => ResolveIdResult; @@ -613,7 +613,7 @@ In watch mode or when using the cache explicitly, the resolved imports of a cach ```typescript type ShouldTransformCachedModuleHook = (options: { - ast: AcornNode; + ast: AstNode; code: string; id: string; meta: { [plugin: string]: any }; @@ -1666,11 +1666,11 @@ An object containing potentially useful Rollup metadata: ### this.parse -| | | -| ----: | :-------------------------------------------------------------- | -| Type: | `(code: string, acornOptions?: AcornOptions) => ESTree.Program` | +| | | +| ----: | :--------------------------------- | +| Type: | `(code: string) => ESTree.Program` | -Use Rollup's internal acorn instance to parse code to an AST. +Use Rollup's internal SWC-based parser to parse code to an AST. ### this.resolve diff --git a/docs/repl/stores/options.ts b/docs/repl/stores/options.ts index 33cafd18e..20057c600 100644 --- a/docs/repl/stores/options.ts +++ b/docs/repl/stores/options.ts @@ -191,10 +191,10 @@ export const useOptions = defineStore('options2', () => { defaultValue: true, name: 'output.externalLiveBindings' }); - const optionOutputExternalImportAssertions = getBoolean({ + const optionOutputExternalImportAttributes = getBoolean({ available: () => optionOutputFormat.value.value === 'es', defaultValue: true, - name: 'output.externalImportAssertions' + name: 'output.externalImportAttributes' }); const optionOutputFreeze = getBoolean({ defaultValue: true, @@ -417,7 +417,7 @@ export const useOptions = defineStore('options2', () => { optionOutputExports, optionOutputExtend, optionOutputExternalLiveBindings, - optionOutputExternalImportAssertions, + optionOutputExternalImportAttributes, optionOutputFreeze, optionOutputFooter, optionOutputFormat, diff --git a/docs/repl/stores/rollup.ts b/docs/repl/stores/rollup.ts index e67e968fb..a0b3f51e3 100644 --- a/docs/repl/stores/rollup.ts +++ b/docs/repl/stores/rollup.ts @@ -4,33 +4,56 @@ import type { RollupBuild, RollupOptions } from '../../../src/rollup/types'; import type * as Rollup from '../helpers/importRollup'; import { isRollupVersionAtLeast } from '../helpers/rollupVersion'; -function getRollupUrl({ type, version }: RollupRequest) { +const ROLLUP_JS_FILE = 'rollup.browser.js'; +const ROLLUP_WASM_FILE = 'bindings_wasm_bg.wasm'; + +function isLoadLocalRollup({ type }: RollupRequest) { + return import.meta.env.DEV && type === 'local'; +} + +function getFullUrlFromUnpkg(version: string | undefined, file: string) { + return `https://unpkg.com/@rollup/browser${version ? `@${version}` : ''}/dist/${file}`; +} + +function getFullUrlFromAWS(version: string, file: string) { + return `https://rollup-ci-artefacts.s3.amazonaws.com/${version}/${file}`; +} + +function getRollupJsUrl({ type, version }: RollupRequest) { if (type === 'pr') { - return `https://rollup-ci-artefacts.s3.amazonaws.com/${version}/rollup.browser.js`; + return getFullUrlFromAWS(version, ROLLUP_JS_FILE); } else if (version) { - if (isRollupVersionAtLeast(version, 4, 0)) { - return `https://unpkg.com/@rollup/browser@${version}/dist/rollup.browser.js`; - } if (isRollupVersionAtLeast(version, 3, 0)) { - return `https://unpkg.com/@rollup/browser@${version}`; + return getFullUrlFromUnpkg(version, ROLLUP_JS_FILE); } if (isRollupVersionAtLeast(version, 1, 0)) { return `https://unpkg.com/rollup@${version}/dist/rollup.browser.js`; } throw new Error('The REPL only supports Rollup versions >= 1.0.0.'); } - return 'https://unpkg.com/@rollup/browser'; + return getFullUrlFromUnpkg(undefined, ROLLUP_JS_FILE); +} + +function getRollupWasmFileUrl({ type, version }: RollupRequest) { + if (type === 'pr') { + return getFullUrlFromAWS(version, ROLLUP_WASM_FILE); + } else if (type === 'version' && version && isRollupVersionAtLeast(version, 4, 0)) { + return getFullUrlFromUnpkg(version, ROLLUP_WASM_FILE); + } } -function loadRollup(rollupRequest: RollupRequest): Promise { - if (import.meta.env.DEV && rollupRequest.type === 'local') { +async function loadRollup(rollupRequest: RollupRequest): Promise { + if (isLoadLocalRollup(rollupRequest)) { return import('../helpers/importRollup'); } - const url = getRollupUrl(rollupRequest); + const url = getRollupJsUrl(rollupRequest); + const rollupWasmFileUrl = getRollupWasmFileUrl(rollupRequest); + const preloadRollupWasmFile = rollupWasmFileUrl && fetch(rollupWasmFileUrl).catch(() => {}); return new Promise((fulfil, reject) => { const script = document.createElement('script'); script.src = url; - script.addEventListener('load', () => { + script.addEventListener('load', async () => { + preloadRollupWasmFile && (await preloadRollupWasmFile); fulfil((window as any).rollup); }); script.addEventListener('error', () => { @@ -78,7 +101,7 @@ export const useRollup = defineStore('rollup', () => { try { request.value = rollupRequest; const instance = await loadRollup(rollupRequest); - if (import.meta.env.DEV) { + if (isLoadLocalRollup(rollupRequest)) { instance.onUpdate(newInstance => { loaded.value = { error: false, instance: newInstance }; }); diff --git a/native.d.ts b/native.d.ts new file mode 100644 index 000000000..6976f78bb --- /dev/null +++ b/native.d.ts @@ -0,0 +1,6 @@ +/* tslint:disable */ +/* eslint-disable */ + +/* auto-generated by NAPI-RS */ + +export function parse(code: string): Buffer diff --git a/native.js b/native.js new file mode 100644 index 000000000..a16b23546 --- /dev/null +++ b/native.js @@ -0,0 +1,257 @@ +/* tslint:disable */ +/* eslint-disable */ +/* prettier-ignore */ + +/* auto-generated by NAPI-RS */ + +const { existsSync, readFileSync } = require('fs') +const { join } = require('path') + +const { platform, arch } = process + +let nativeBinding = null +let localFileExisted = false +let loadError = null + +function isMusl() { + // For Node 10 + if (!process.report || typeof process.report.getReport !== 'function') { + try { + const lddPath = require('child_process').execSync('which ldd').toString().trim() + return readFileSync(lddPath, 'utf8').includes('musl') + } catch (e) { + return true + } + } else { + const { glibcVersionRuntime } = process.report.getReport().header + return !glibcVersionRuntime + } +} + +switch (platform) { + case 'android': + switch (arch) { + case 'arm64': + localFileExisted = existsSync(join(__dirname, 'rollup.android-arm64.node')) + try { + if (localFileExisted) { + nativeBinding = require('./rollup.android-arm64.node') + } else { + nativeBinding = require('@rollup/rollup-android-arm64') + } + } catch (e) { + loadError = e + } + break + case 'arm': + localFileExisted = existsSync(join(__dirname, 'rollup.android-arm-eabi.node')) + try { + if (localFileExisted) { + nativeBinding = require('./rollup.android-arm-eabi.node') + } else { + nativeBinding = require('@rollup/rollup-android-arm-eabi') + } + } catch (e) { + loadError = e + } + break + default: + throw new Error(`Unsupported architecture on Android ${arch}`) + } + break + case 'win32': + switch (arch) { + case 'x64': + localFileExisted = existsSync( + join(__dirname, 'rollup.win32-x64-msvc.node') + ) + try { + if (localFileExisted) { + nativeBinding = require('./rollup.win32-x64-msvc.node') + } else { + nativeBinding = require('@rollup/rollup-win32-x64-msvc') + } + } catch (e) { + loadError = e + } + break + case 'ia32': + localFileExisted = existsSync( + join(__dirname, 'rollup.win32-ia32-msvc.node') + ) + try { + if (localFileExisted) { + nativeBinding = require('./rollup.win32-ia32-msvc.node') + } else { + nativeBinding = require('@rollup/rollup-win32-ia32-msvc') + } + } catch (e) { + loadError = e + } + break + case 'arm64': + localFileExisted = existsSync( + join(__dirname, 'rollup.win32-arm64-msvc.node') + ) + try { + if (localFileExisted) { + nativeBinding = require('./rollup.win32-arm64-msvc.node') + } else { + nativeBinding = require('@rollup/rollup-win32-arm64-msvc') + } + } catch (e) { + loadError = e + } + break + default: + throw new Error(`Unsupported architecture on Windows: ${arch}`) + } + break + case 'darwin': + localFileExisted = existsSync(join(__dirname, 'rollup.darwin-universal.node')) + try { + if (localFileExisted) { + nativeBinding = require('./rollup.darwin-universal.node') + } else { + nativeBinding = require('@rollup/rollup-darwin-universal') + } + break + } catch {} + switch (arch) { + case 'x64': + localFileExisted = existsSync(join(__dirname, 'rollup.darwin-x64.node')) + try { + if (localFileExisted) { + nativeBinding = require('./rollup.darwin-x64.node') + } else { + nativeBinding = require('@rollup/rollup-darwin-x64') + } + } catch (e) { + loadError = e + } + break + case 'arm64': + localFileExisted = existsSync( + join(__dirname, 'rollup.darwin-arm64.node') + ) + try { + if (localFileExisted) { + nativeBinding = require('./rollup.darwin-arm64.node') + } else { + nativeBinding = require('@rollup/rollup-darwin-arm64') + } + } catch (e) { + loadError = e + } + break + default: + throw new Error(`Unsupported architecture on macOS: ${arch}`) + } + break + case 'freebsd': + if (arch !== 'x64') { + throw new Error(`Unsupported architecture on FreeBSD: ${arch}`) + } + localFileExisted = existsSync(join(__dirname, 'rollup.freebsd-x64.node')) + try { + if (localFileExisted) { + nativeBinding = require('./rollup.freebsd-x64.node') + } else { + nativeBinding = require('@rollup/rollup-freebsd-x64') + } + } catch (e) { + loadError = e + } + break + case 'linux': + switch (arch) { + case 'x64': + if (isMusl()) { + localFileExisted = existsSync( + join(__dirname, 'rollup.linux-x64-musl.node') + ) + try { + if (localFileExisted) { + nativeBinding = require('./rollup.linux-x64-musl.node') + } else { + nativeBinding = require('@rollup/rollup-linux-x64-musl') + } + } catch (e) { + loadError = e + } + } else { + localFileExisted = existsSync( + join(__dirname, 'rollup.linux-x64-gnu.node') + ) + try { + if (localFileExisted) { + nativeBinding = require('./rollup.linux-x64-gnu.node') + } else { + nativeBinding = require('@rollup/rollup-linux-x64-gnu') + } + } catch (e) { + loadError = e + } + } + break + case 'arm64': + if (isMusl()) { + localFileExisted = existsSync( + join(__dirname, 'rollup.linux-arm64-musl.node') + ) + try { + if (localFileExisted) { + nativeBinding = require('./rollup.linux-arm64-musl.node') + } else { + nativeBinding = require('@rollup/rollup-linux-arm64-musl') + } + } catch (e) { + loadError = e + } + } else { + localFileExisted = existsSync( + join(__dirname, 'rollup.linux-arm64-gnu.node') + ) + try { + if (localFileExisted) { + nativeBinding = require('./rollup.linux-arm64-gnu.node') + } else { + nativeBinding = require('@rollup/rollup-linux-arm64-gnu') + } + } catch (e) { + loadError = e + } + } + break + case 'arm': + localFileExisted = existsSync( + join(__dirname, 'rollup.linux-arm-gnueabihf.node') + ) + try { + if (localFileExisted) { + nativeBinding = require('./rollup.linux-arm-gnueabihf.node') + } else { + nativeBinding = require('@rollup/rollup-linux-arm-gnueabihf') + } + } catch (e) { + loadError = e + } + break + default: + throw new Error(`Unsupported architecture on Linux: ${arch}`) + } + break + default: + throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`) +} + +if (!nativeBinding) { + if (loadError) { + throw loadError + } + throw new Error(`Failed to load native binding`) +} + +const { parse } = nativeBinding + +module.exports.parse = parse diff --git a/npm/android-arm-eabi/README.md b/npm/android-arm-eabi/README.md new file mode 100644 index 000000000..b75a36c99 --- /dev/null +++ b/npm/android-arm-eabi/README.md @@ -0,0 +1,3 @@ +# `@rollup/rollup-android-arm-eabi` + +This is the **armv7-linux-androideabi** binary for `rollup` diff --git a/npm/android-arm-eabi/package.json b/npm/android-arm-eabi/package.json new file mode 100644 index 000000000..265fac014 --- /dev/null +++ b/npm/android-arm-eabi/package.json @@ -0,0 +1,19 @@ +{ + "name": "@rollup/rollup-android-arm-eabi", + "version": "0.0.0", + "os": [ + "android" + ], + "cpu": [ + "arm" + ], + "files": [ + "rollup.android-arm-eabi.node" + ], + "description": "Native bindings for Rollup", + "author": "Lukas Taegert-Atkinson", + "homepage": "https://rollupjs.org/", + "license": "MIT", + "repository": "rollup/rollup", + "main": "./rollup.android-arm-eabi.node" +} diff --git a/npm/android-arm64/README.md b/npm/android-arm64/README.md new file mode 100644 index 000000000..7aa827a92 --- /dev/null +++ b/npm/android-arm64/README.md @@ -0,0 +1,3 @@ +# `@rollup/rollup-android-arm64` + +This is the **aarch64-linux-android** binary for `rollup` diff --git a/npm/android-arm64/package.json b/npm/android-arm64/package.json new file mode 100644 index 000000000..19c500eee --- /dev/null +++ b/npm/android-arm64/package.json @@ -0,0 +1,19 @@ +{ + "name": "@rollup/rollup-android-arm64", + "version": "0.0.0", + "os": [ + "android" + ], + "cpu": [ + "arm64" + ], + "files": [ + "rollup.android-arm64.node" + ], + "description": "Native bindings for Rollup", + "author": "Lukas Taegert-Atkinson", + "homepage": "https://rollupjs.org/", + "license": "MIT", + "repository": "rollup/rollup", + "main": "./rollup.android-arm64.node" +} diff --git a/npm/darwin-arm64/README.md b/npm/darwin-arm64/README.md new file mode 100644 index 000000000..c29619c30 --- /dev/null +++ b/npm/darwin-arm64/README.md @@ -0,0 +1,3 @@ +# `@rollup/rollup-darwin-arm64` + +This is the **aarch64-apple-darwin** binary for `rollup` diff --git a/npm/darwin-arm64/package.json b/npm/darwin-arm64/package.json new file mode 100644 index 000000000..693f1fcef --- /dev/null +++ b/npm/darwin-arm64/package.json @@ -0,0 +1,19 @@ +{ + "name": "@rollup/rollup-darwin-arm64", + "version": "0.0.0", + "os": [ + "darwin" + ], + "cpu": [ + "arm64" + ], + "files": [ + "rollup.darwin-arm64.node" + ], + "description": "Native bindings for Rollup", + "author": "Lukas Taegert-Atkinson", + "homepage": "https://rollupjs.org/", + "license": "MIT", + "repository": "rollup/rollup", + "main": "./rollup.darwin-arm64.node" +} diff --git a/npm/darwin-x64/README.md b/npm/darwin-x64/README.md new file mode 100644 index 000000000..156d37a87 --- /dev/null +++ b/npm/darwin-x64/README.md @@ -0,0 +1,3 @@ +# `@rollup/rollup-darwin-x64` + +This is the **x86_64-apple-darwin** binary for `rollup` diff --git a/npm/darwin-x64/package.json b/npm/darwin-x64/package.json new file mode 100644 index 000000000..70a6d96c8 --- /dev/null +++ b/npm/darwin-x64/package.json @@ -0,0 +1,19 @@ +{ + "name": "@rollup/rollup-darwin-x64", + "version": "0.0.0", + "os": [ + "darwin" + ], + "cpu": [ + "x64" + ], + "files": [ + "rollup.darwin-x64.node" + ], + "description": "Native bindings for Rollup", + "author": "Lukas Taegert-Atkinson", + "homepage": "https://rollupjs.org/", + "license": "MIT", + "repository": "rollup/rollup", + "main": "./rollup.darwin-x64.node" +} diff --git a/npm/linux-arm-gnueabihf/README.md b/npm/linux-arm-gnueabihf/README.md new file mode 100644 index 000000000..1b58b1c47 --- /dev/null +++ b/npm/linux-arm-gnueabihf/README.md @@ -0,0 +1,3 @@ +# `@rollup/rollup-linux-arm-gnueabihf` + +This is the **armv7-unknown-linux-gnueabihf** binary for `rollup` diff --git a/npm/linux-arm-gnueabihf/package.json b/npm/linux-arm-gnueabihf/package.json new file mode 100644 index 000000000..ff1c7a151 --- /dev/null +++ b/npm/linux-arm-gnueabihf/package.json @@ -0,0 +1,19 @@ +{ + "name": "@rollup/rollup-linux-arm-gnueabihf", + "version": "0.0.0", + "os": [ + "linux" + ], + "cpu": [ + "arm" + ], + "files": [ + "rollup.linux-arm-gnueabihf.node" + ], + "description": "Native bindings for Rollup", + "author": "Lukas Taegert-Atkinson", + "homepage": "https://rollupjs.org/", + "license": "MIT", + "repository": "rollup/rollup", + "main": "./rollup.linux-arm-gnueabihf.node" +} diff --git a/npm/linux-arm64-gnu/README.md b/npm/linux-arm64-gnu/README.md new file mode 100644 index 000000000..48e68cb4c --- /dev/null +++ b/npm/linux-arm64-gnu/README.md @@ -0,0 +1,3 @@ +# `@rollup/rollup-linux-arm64-gnu` + +This is the **aarch64-unknown-linux-gnu** binary for `rollup` diff --git a/npm/linux-arm64-gnu/package.json b/npm/linux-arm64-gnu/package.json new file mode 100644 index 000000000..948275f9f --- /dev/null +++ b/npm/linux-arm64-gnu/package.json @@ -0,0 +1,22 @@ +{ + "name": "@rollup/rollup-linux-arm64-gnu", + "version": "0.0.0", + "os": [ + "linux" + ], + "cpu": [ + "arm64" + ], + "files": [ + "rollup.linux-arm64-gnu.node" + ], + "description": "Native bindings for Rollup", + "author": "Lukas Taegert-Atkinson", + "homepage": "https://rollupjs.org/", + "license": "MIT", + "repository": "rollup/rollup", + "libc": [ + "glibc" + ], + "main": "./rollup.linux-arm64-gnu.node" +} diff --git a/npm/linux-arm64-musl/README.md b/npm/linux-arm64-musl/README.md new file mode 100644 index 000000000..3db2751ae --- /dev/null +++ b/npm/linux-arm64-musl/README.md @@ -0,0 +1,3 @@ +# `@rollup/rollup-linux-arm64-musl` + +This is the **aarch64-unknown-linux-musl** binary for `rollup` diff --git a/npm/linux-arm64-musl/package.json b/npm/linux-arm64-musl/package.json new file mode 100644 index 000000000..d6d4b0c66 --- /dev/null +++ b/npm/linux-arm64-musl/package.json @@ -0,0 +1,22 @@ +{ + "name": "@rollup/rollup-linux-arm64-musl", + "version": "0.0.0", + "os": [ + "linux" + ], + "cpu": [ + "arm64" + ], + "files": [ + "rollup.linux-arm64-musl.node" + ], + "description": "Native bindings for Rollup", + "author": "Lukas Taegert-Atkinson", + "homepage": "https://rollupjs.org/", + "license": "MIT", + "repository": "rollup/rollup", + "libc": [ + "musl" + ], + "main": "./rollup.linux-arm64-musl.node" +} diff --git a/npm/linux-x64-gnu/README.md b/npm/linux-x64-gnu/README.md new file mode 100644 index 000000000..cabe280f1 --- /dev/null +++ b/npm/linux-x64-gnu/README.md @@ -0,0 +1,3 @@ +# `@rollup/rollup-linux-x64-gnu` + +This is the **x86_64-unknown-linux-gnu** binary for `rollup` diff --git a/npm/linux-x64-gnu/package.json b/npm/linux-x64-gnu/package.json new file mode 100644 index 000000000..8d5228dab --- /dev/null +++ b/npm/linux-x64-gnu/package.json @@ -0,0 +1,22 @@ +{ + "name": "@rollup/rollup-linux-x64-gnu", + "version": "0.0.0", + "os": [ + "linux" + ], + "cpu": [ + "x64" + ], + "files": [ + "rollup.linux-x64-gnu.node" + ], + "description": "Native bindings for Rollup", + "author": "Lukas Taegert-Atkinson", + "homepage": "https://rollupjs.org/", + "license": "MIT", + "repository": "rollup/rollup", + "libc": [ + "glibc" + ], + "main": "./rollup.linux-x64-gnu.node" +} diff --git a/npm/linux-x64-musl/README.md b/npm/linux-x64-musl/README.md new file mode 100644 index 000000000..5848a6c6e --- /dev/null +++ b/npm/linux-x64-musl/README.md @@ -0,0 +1,3 @@ +# `@rollup/rollup-linux-x64-musl` + +This is the **x86_64-unknown-linux-musl** binary for `rollup` diff --git a/npm/linux-x64-musl/package.json b/npm/linux-x64-musl/package.json new file mode 100644 index 000000000..7b1ca2564 --- /dev/null +++ b/npm/linux-x64-musl/package.json @@ -0,0 +1,22 @@ +{ + "name": "@rollup/rollup-linux-x64-musl", + "version": "0.0.0", + "os": [ + "linux" + ], + "cpu": [ + "x64" + ], + "files": [ + "rollup.linux-x64-musl.node" + ], + "description": "Native bindings for Rollup", + "author": "Lukas Taegert-Atkinson", + "homepage": "https://rollupjs.org/", + "license": "MIT", + "repository": "rollup/rollup", + "libc": [ + "musl" + ], + "main": "./rollup.linux-x64-musl.node" +} diff --git a/npm/win32-arm64-msvc/README.md b/npm/win32-arm64-msvc/README.md new file mode 100644 index 000000000..26ef53bf7 --- /dev/null +++ b/npm/win32-arm64-msvc/README.md @@ -0,0 +1,3 @@ +# `@rollup/rollup-win32-arm64-msvc` + +This is the **aarch64-pc-windows-msvc** binary for `rollup` diff --git a/npm/win32-arm64-msvc/package.json b/npm/win32-arm64-msvc/package.json new file mode 100644 index 000000000..ddd14a219 --- /dev/null +++ b/npm/win32-arm64-msvc/package.json @@ -0,0 +1,19 @@ +{ + "name": "@rollup/rollup-win32-arm64-msvc", + "version": "0.0.0", + "os": [ + "win32" + ], + "cpu": [ + "arm64" + ], + "files": [ + "rollup.win32-arm64-msvc.node" + ], + "description": "Native bindings for Rollup", + "author": "Lukas Taegert-Atkinson", + "homepage": "https://rollupjs.org/", + "license": "MIT", + "repository": "rollup/rollup", + "main": "./rollup.win32-arm64-msvc.node" +} diff --git a/npm/win32-ia32-msvc/README.md b/npm/win32-ia32-msvc/README.md new file mode 100644 index 000000000..9a03e8c74 --- /dev/null +++ b/npm/win32-ia32-msvc/README.md @@ -0,0 +1,3 @@ +# `@rollup/rollup-win32-ia32-msvc` + +This is the **i686-pc-windows-msvc** binary for `rollup` diff --git a/npm/win32-ia32-msvc/package.json b/npm/win32-ia32-msvc/package.json new file mode 100644 index 000000000..0716a9e8e --- /dev/null +++ b/npm/win32-ia32-msvc/package.json @@ -0,0 +1,19 @@ +{ + "name": "@rollup/rollup-win32-ia32-msvc", + "version": "0.0.0", + "os": [ + "win32" + ], + "cpu": [ + "ia32" + ], + "files": [ + "rollup.win32-ia32-msvc.node" + ], + "description": "Native bindings for Rollup", + "author": "Lukas Taegert-Atkinson", + "homepage": "https://rollupjs.org/", + "license": "MIT", + "repository": "rollup/rollup", + "main": "./rollup.win32-ia32-msvc.node" +} diff --git a/npm/win32-x64-msvc/README.md b/npm/win32-x64-msvc/README.md new file mode 100644 index 000000000..7382dbc4f --- /dev/null +++ b/npm/win32-x64-msvc/README.md @@ -0,0 +1,3 @@ +# `@rollup/rollup-win32-x64-msvc` + +This is the **x86_64-pc-windows-msvc** binary for `rollup` diff --git a/npm/win32-x64-msvc/package.json b/npm/win32-x64-msvc/package.json new file mode 100644 index 000000000..cb8094fb7 --- /dev/null +++ b/npm/win32-x64-msvc/package.json @@ -0,0 +1,19 @@ +{ + "name": "@rollup/rollup-win32-x64-msvc", + "version": "0.0.0", + "os": [ + "win32" + ], + "cpu": [ + "x64" + ], + "files": [ + "rollup.win32-x64-msvc.node" + ], + "description": "Native bindings for Rollup", + "author": "Lukas Taegert-Atkinson", + "homepage": "https://rollupjs.org/", + "license": "MIT", + "repository": "rollup/rollup", + "main": "./rollup.win32-x64-msvc.node" +} diff --git a/package-lock.json b/package-lock.json index 72442a541..11e70f240 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rollup", - "version": "4.0.0-0", + "version": "4.0.0-19", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rollup", - "version": "4.0.0-0", + "version": "4.0.0-19", "license": "MIT", "bin": { "rollup": "dist/bin/rollup" @@ -20,6 +20,7 @@ "@codemirror/view": "^6.20.2", "@jridgewell/sourcemap-codec": "^1.4.15", "@mermaid-js/mermaid-cli": "^10.4.0", + "@napi-rs/cli": "^2.16.2", "@rollup/plugin-alias": "^5.0.0", "@rollup/plugin-buble": "^1.0.2", "@rollup/plugin-commonjs": "^25.0.4", @@ -31,7 +32,7 @@ "@rollup/pluginutils": "^5.0.4", "@types/estree": "1.0.2", "@types/mocha": "^10.0.1", - "@types/node": "~14.18.63", + "@types/node": "18.0.0", "@types/yargs-parser": "^21.0.1", "@typescript-eslint/eslint-plugin": "^6.7.3", "@typescript-eslint/parser": "^6.7.3", @@ -39,8 +40,6 @@ "@vue/eslint-config-typescript": "^12.0.0", "acorn": "^8.10.0", "acorn-import-assertions": "^1.9.0", - "acorn-jsx": "^5.3.2", - "acorn-walk": "^8.2.0", "buble": "^0.20.0", "builtin-modules": "^3.3.0", "chokidar": "^3.5.3", @@ -90,6 +89,7 @@ "vite": "^4.4.9", "vitepress": "^1.0.0-rc.20", "vue": "^3.3.4", + "wasm-pack": "^0.12.1", "weak-napi": "^2.0.2", "yargs-parser": "^21.1.1" }, @@ -156,132 +156,132 @@ } }, "node_modules/@algolia/cache-browser-local-storage": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.20.0.tgz", - "integrity": "sha512-uujahcBt4DxduBTvYdwO3sBfHuJvJokiC3BP1+O70fglmE1ShkH8lpXqZBac1rrU3FnNYSUs4pL9lBdTKeRPOQ==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.19.1.tgz", + "integrity": "sha512-FYAZWcGsFTTaSAwj9Std8UML3Bu8dyWDncM7Ls8g+58UOe4XYdlgzXWbrIgjaguP63pCCbMoExKr61B+ztK3tw==", "dev": true, "dependencies": { - "@algolia/cache-common": "4.20.0" + "@algolia/cache-common": "4.19.1" } }, "node_modules/@algolia/cache-common": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@algolia/cache-common/-/cache-common-4.20.0.tgz", - "integrity": "sha512-vCfxauaZutL3NImzB2G9LjLt36vKAckc6DhMp05An14kVo8F1Yofb6SIl6U3SaEz8pG2QOB9ptwM5c+zGevwIQ==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@algolia/cache-common/-/cache-common-4.19.1.tgz", + "integrity": "sha512-XGghi3l0qA38HiqdoUY+wvGyBsGvKZ6U3vTiMBT4hArhP3fOGLXpIINgMiiGjTe4FVlTa5a/7Zf2bwlIHfRqqg==", "dev": true }, "node_modules/@algolia/cache-in-memory": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@algolia/cache-in-memory/-/cache-in-memory-4.20.0.tgz", - "integrity": "sha512-Wm9ak/IaacAZXS4mB3+qF/KCoVSBV6aLgIGFEtQtJwjv64g4ePMapORGmCyulCFwfePaRAtcaTbMcJF+voc/bg==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@algolia/cache-in-memory/-/cache-in-memory-4.19.1.tgz", + "integrity": "sha512-+PDWL+XALGvIginigzu8oU6eWw+o76Z8zHbBovWYcrtWOEtinbl7a7UTt3x3lthv+wNuFr/YD1Gf+B+A9V8n5w==", "dev": true, "dependencies": { - "@algolia/cache-common": "4.20.0" + "@algolia/cache-common": "4.19.1" } }, "node_modules/@algolia/client-account": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@algolia/client-account/-/client-account-4.20.0.tgz", - "integrity": "sha512-GGToLQvrwo7am4zVkZTnKa72pheQeez/16sURDWm7Seyz+HUxKi3BM6fthVVPUEBhtJ0reyVtuK9ArmnaKl10Q==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@algolia/client-account/-/client-account-4.19.1.tgz", + "integrity": "sha512-Oy0ritA2k7AMxQ2JwNpfaEcgXEDgeyKu0V7E7xt/ZJRdXfEpZcwp9TOg4TJHC7Ia62gIeT2Y/ynzsxccPw92GA==", "dev": true, "dependencies": { - "@algolia/client-common": "4.20.0", - "@algolia/client-search": "4.20.0", - "@algolia/transporter": "4.20.0" + "@algolia/client-common": "4.19.1", + "@algolia/client-search": "4.19.1", + "@algolia/transporter": "4.19.1" } }, "node_modules/@algolia/client-analytics": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-4.20.0.tgz", - "integrity": "sha512-EIr+PdFMOallRdBTHHdKI3CstslgLORQG7844Mq84ib5oVFRVASuuPmG4bXBgiDbcsMLUeOC6zRVJhv1KWI0ug==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-4.19.1.tgz", + "integrity": "sha512-5QCq2zmgdZLIQhHqwl55ZvKVpLM3DNWjFI4T+bHr3rGu23ew2bLO4YtyxaZeChmDb85jUdPDouDlCumGfk6wOg==", "dev": true, "dependencies": { - "@algolia/client-common": "4.20.0", - "@algolia/client-search": "4.20.0", - "@algolia/requester-common": "4.20.0", - "@algolia/transporter": "4.20.0" + "@algolia/client-common": "4.19.1", + "@algolia/client-search": "4.19.1", + "@algolia/requester-common": "4.19.1", + "@algolia/transporter": "4.19.1" } }, "node_modules/@algolia/client-common": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-4.20.0.tgz", - "integrity": "sha512-P3WgMdEss915p+knMMSd/fwiHRHKvDu4DYRrCRaBrsfFw7EQHon+EbRSm4QisS9NYdxbS04kcvNoavVGthyfqQ==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-4.19.1.tgz", + "integrity": "sha512-3kAIVqTcPrjfS389KQvKzliC559x+BDRxtWamVJt8IVp7LGnjq+aVAXg4Xogkur1MUrScTZ59/AaUd5EdpyXgA==", "dev": true, "dependencies": { - "@algolia/requester-common": "4.20.0", - "@algolia/transporter": "4.20.0" + "@algolia/requester-common": "4.19.1", + "@algolia/transporter": "4.19.1" } }, "node_modules/@algolia/client-personalization": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-4.20.0.tgz", - "integrity": "sha512-N9+zx0tWOQsLc3K4PVRDV8GUeOLAY0i445En79Pr3zWB+m67V+n/8w4Kw1C5LlbHDDJcyhMMIlqezh6BEk7xAQ==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-4.19.1.tgz", + "integrity": "sha512-8CWz4/H5FA+krm9HMw2HUQenizC/DxUtsI5oYC0Jxxyce1vsr8cb1aEiSJArQT6IzMynrERif1RVWLac1m36xw==", "dev": true, "dependencies": { - "@algolia/client-common": "4.20.0", - "@algolia/requester-common": "4.20.0", - "@algolia/transporter": "4.20.0" + "@algolia/client-common": "4.19.1", + "@algolia/requester-common": "4.19.1", + "@algolia/transporter": "4.19.1" } }, "node_modules/@algolia/client-search": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-4.20.0.tgz", - "integrity": "sha512-zgwqnMvhWLdpzKTpd3sGmMlr4c+iS7eyyLGiaO51zDZWGMkpgoNVmltkzdBwxOVXz0RsFMznIxB9zuarUv4TZg==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-4.19.1.tgz", + "integrity": "sha512-mBecfMFS4N+yK/p0ZbK53vrZbL6OtWMk8YmnOv1i0LXx4pelY8TFhqKoTit3NPVPwoSNN0vdSN9dTu1xr1XOVw==", "dev": true, "dependencies": { - "@algolia/client-common": "4.20.0", - "@algolia/requester-common": "4.20.0", - "@algolia/transporter": "4.20.0" + "@algolia/client-common": "4.19.1", + "@algolia/requester-common": "4.19.1", + "@algolia/transporter": "4.19.1" } }, "node_modules/@algolia/logger-common": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@algolia/logger-common/-/logger-common-4.20.0.tgz", - "integrity": "sha512-xouigCMB5WJYEwvoWW5XDv7Z9f0A8VoXJc3VKwlHJw/je+3p2RcDXfksLI4G4lIVncFUYMZx30tP/rsdlvvzHQ==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@algolia/logger-common/-/logger-common-4.19.1.tgz", + "integrity": "sha512-i6pLPZW/+/YXKis8gpmSiNk1lOmYCmRI6+x6d2Qk1OdfvX051nRVdalRbEcVTpSQX6FQAoyeaui0cUfLYW5Elw==", "dev": true }, "node_modules/@algolia/logger-console": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@algolia/logger-console/-/logger-console-4.20.0.tgz", - "integrity": "sha512-THlIGG1g/FS63z0StQqDhT6bprUczBI8wnLT3JWvfAQDZX5P6fCg7dG+pIrUBpDIHGszgkqYEqECaKKsdNKOUA==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@algolia/logger-console/-/logger-console-4.19.1.tgz", + "integrity": "sha512-jj72k9GKb9W0c7TyC3cuZtTr0CngLBLmc8trzZlXdfvQiigpUdvTi1KoWIb2ZMcRBG7Tl8hSb81zEY3zI2RlXg==", "dev": true, "dependencies": { - "@algolia/logger-common": "4.20.0" + "@algolia/logger-common": "4.19.1" } }, "node_modules/@algolia/requester-browser-xhr": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.20.0.tgz", - "integrity": "sha512-HbzoSjcjuUmYOkcHECkVTwAelmvTlgs48N6Owt4FnTOQdwn0b8pdht9eMgishvk8+F8bal354nhx/xOoTfwiAw==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.19.1.tgz", + "integrity": "sha512-09K/+t7lptsweRTueHnSnmPqIxbHMowejAkn9XIcJMLdseS3zl8ObnS5GWea86mu3vy4+8H+ZBKkUN82Zsq/zg==", "dev": true, "dependencies": { - "@algolia/requester-common": "4.20.0" + "@algolia/requester-common": "4.19.1" } }, "node_modules/@algolia/requester-common": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@algolia/requester-common/-/requester-common-4.20.0.tgz", - "integrity": "sha512-9h6ye6RY/BkfmeJp7Z8gyyeMrmmWsMOCRBXQDs4mZKKsyVlfIVICpcSibbeYcuUdurLhIlrOUkH3rQEgZzonng==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@algolia/requester-common/-/requester-common-4.19.1.tgz", + "integrity": "sha512-BisRkcWVxrDzF1YPhAckmi2CFYK+jdMT60q10d7z3PX+w6fPPukxHRnZwooiTUrzFe50UBmLItGizWHP5bDzVQ==", "dev": true }, "node_modules/@algolia/requester-node-http": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-4.20.0.tgz", - "integrity": "sha512-ocJ66L60ABSSTRFnCHIEZpNHv6qTxsBwJEPfYaSBsLQodm0F9ptvalFkHMpvj5DfE22oZrcrLbOYM2bdPJRHng==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-4.19.1.tgz", + "integrity": "sha512-6DK52DHviBHTG2BK/Vv2GIlEw7i+vxm7ypZW0Z7vybGCNDeWzADx+/TmxjkES2h15+FZOqVf/Ja677gePsVItA==", "dev": true, "dependencies": { - "@algolia/requester-common": "4.20.0" + "@algolia/requester-common": "4.19.1" } }, "node_modules/@algolia/transporter": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@algolia/transporter/-/transporter-4.20.0.tgz", - "integrity": "sha512-Lsii1pGWOAISbzeyuf+r/GPhvHMPHSPrTDWNcIzOE1SG1inlJHICaVe2ikuoRjcpgxZNU54Jl+if15SUCsaTUg==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@algolia/transporter/-/transporter-4.19.1.tgz", + "integrity": "sha512-nkpvPWbpuzxo1flEYqNIbGz7xhfhGOKGAZS7tzC+TELgEmi7z99qRyTfNSUlW7LZmB3ACdnqAo+9A9KFBENviQ==", "dev": true, "dependencies": { - "@algolia/cache-common": "4.20.0", - "@algolia/logger-common": "4.20.0", - "@algolia/requester-common": "4.20.0" + "@algolia/cache-common": "4.19.1", + "@algolia/logger-common": "4.19.1", + "@algolia/requester-common": "4.19.1" } }, "node_modules/@ampproject/remapping": { @@ -489,12 +489,12 @@ } }, "node_modules/@babel/helper-module-imports": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", - "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz", + "integrity": "sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==", "dev": true, "dependencies": { - "@babel/types": "^7.22.15" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -507,7 +507,7 @@ "dev": true, "dependencies": { "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-module-imports": "^7.22.15", + "@babel/helper-module-imports": "^7.22.5", "@babel/helper-simple-access": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", "@babel/helper-validator-identifier": "^7.22.20" @@ -737,14 +737,14 @@ } }, "node_modules/@codemirror/autocomplete": { - "version": "6.9.1", - "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.9.1.tgz", - "integrity": "sha512-yma56tqD7khIZK4gy4X5lX3/k5ArMiCGat7HEWRF/8L2kqOjVdp2qKZqpcJjwTIjSj6fqKAHqi7IjtH3QFE+Bw==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.9.0.tgz", + "integrity": "sha512-Fbwm0V/Wn3BkEJZRhr0hi5BhCo5a7eBL6LYaliPjOSwCyfOpnjXY59HruSxOUNV+1OYer0Tgx1zRNQttjXyDog==", "dev": true, "dependencies": { "@codemirror/language": "^6.0.0", "@codemirror/state": "^6.0.0", - "@codemirror/view": "^6.17.0", + "@codemirror/view": "^6.6.0", "@lezer/common": "^1.0.0" }, "peerDependencies": { @@ -796,9 +796,9 @@ } }, "node_modules/@codemirror/lint": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.4.2.tgz", - "integrity": "sha512-wzRkluWb1ptPKdzlsrbwwjYCPLgzU6N88YBAmlZi8WFyuiEduSd05MnJYNogzyc8rPK7pj6m95ptUApc8sHKVA==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.4.0.tgz", + "integrity": "sha512-6VZ44Ysh/Zn07xrGkdtNfmHCbGSHZzFBdzWi0pbd7chAQ/iUcpLGX99NYRZTa7Ugqg4kEHCqiHhcZnH0gLIgSg==", "dev": true, "dependencies": { "@codemirror/state": "^6.0.0", @@ -1549,6 +1549,22 @@ "node": "^14.13 || >=16.0" } }, + "node_modules/@napi-rs/cli": { + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/@napi-rs/cli/-/cli-2.16.2.tgz", + "integrity": "sha512-U2aZfnr0s9KkXpZlYC0l5WxWCXL7vJUNpCnWMwq3T9GG9rhYAAUM9CTZsi1Z+0iR2LcHbfq9EfMgoqnuTyUjfg==", + "dev": true, + "bin": { + "napi": "scripts/index.js" + }, + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -2606,15 +2622,6 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", - "dev": true, - "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", @@ -2657,25 +2664,25 @@ } }, "node_modules/algoliasearch": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.20.0.tgz", - "integrity": "sha512-y+UHEjnOItoNy0bYO+WWmLWBlPwDjKHW6mNHrPi0NkuhpQOOEbrkwQH/wgKFDLh7qlKjzoKeiRtlpewDPDG23g==", - "dev": true, - "dependencies": { - "@algolia/cache-browser-local-storage": "4.20.0", - "@algolia/cache-common": "4.20.0", - "@algolia/cache-in-memory": "4.20.0", - "@algolia/client-account": "4.20.0", - "@algolia/client-analytics": "4.20.0", - "@algolia/client-common": "4.20.0", - "@algolia/client-personalization": "4.20.0", - "@algolia/client-search": "4.20.0", - "@algolia/logger-common": "4.20.0", - "@algolia/logger-console": "4.20.0", - "@algolia/requester-browser-xhr": "4.20.0", - "@algolia/requester-common": "4.20.0", - "@algolia/requester-node-http": "4.20.0", - "@algolia/transporter": "4.20.0" + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.19.1.tgz", + "integrity": "sha512-IJF5b93b2MgAzcE/tuzW0yOPnuUyRgGAtaPv5UUywXM8kzqfdwZTO4sPJBzoGz1eOy6H9uEchsJsBFTELZSu+g==", + "dev": true, + "dependencies": { + "@algolia/cache-browser-local-storage": "4.19.1", + "@algolia/cache-common": "4.19.1", + "@algolia/cache-in-memory": "4.19.1", + "@algolia/client-account": "4.19.1", + "@algolia/client-analytics": "4.19.1", + "@algolia/client-common": "4.19.1", + "@algolia/client-personalization": "4.19.1", + "@algolia/client-search": "4.19.1", + "@algolia/logger-common": "4.19.1", + "@algolia/logger-console": "4.19.1", + "@algolia/requester-browser-xhr": "4.19.1", + "@algolia/requester-common": "4.19.1", + "@algolia/requester-node-http": "4.19.1", + "@algolia/transporter": "4.19.1" } }, "node_modules/ansi-colors": { @@ -2801,15 +2808,15 @@ } }, "node_modules/array-includes": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.7.tgz", - "integrity": "sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz", + "integrity": "sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "get-intrinsic": "^1.2.1", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "get-intrinsic": "^1.1.3", "is-string": "^1.0.7" }, "engines": { @@ -2829,16 +2836,16 @@ } }, "node_modules/array.prototype.findlastindex": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.3.tgz", - "integrity": "sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.2.tgz", + "integrity": "sha512-tb5thFFlUcp7NdNF6/MpDk/1r/4awWG1FIz3YqDf+/zJSTezBb+/5WViH41obXULHVpDzoiCLpJ/ZO9YbJMsdw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", "es-shim-unscopables": "^1.0.0", - "get-intrinsic": "^1.2.1" + "get-intrinsic": "^1.1.3" }, "engines": { "node": ">= 0.4" @@ -2848,14 +2855,14 @@ } }, "node_modules/array.prototype.flat": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", - "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz", + "integrity": "sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", "es-shim-unscopables": "^1.0.0" }, "engines": { @@ -2866,14 +2873,14 @@ } }, "node_modules/array.prototype.flatmap": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", - "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz", + "integrity": "sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", "es-shim-unscopables": "^1.0.0" }, "engines": { @@ -2884,15 +2891,14 @@ } }, "node_modules/arraybuffer.prototype.slice": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz", - "integrity": "sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.1.tgz", + "integrity": "sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw==", "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.0", "call-bind": "^1.0.2", "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", "get-intrinsic": "^1.2.1", "is-array-buffer": "^3.0.2", "is-shared-array-buffer": "^1.0.2" @@ -2969,6 +2975,29 @@ "node": ">=8" } }, + "node_modules/binary-install": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/binary-install/-/binary-install-1.1.0.tgz", + "integrity": "sha512-rkwNGW+3aQVSZoD0/o3mfPN6Yxh3Id0R/xzTVBVVpGNlVz8EGwusksxRlbk/A5iKTZt9zkMn3qIqmAt3vpfbzg==", + "dev": true, + "dependencies": { + "axios": "^0.26.1", + "rimraf": "^3.0.2", + "tar": "^6.1.11" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/binary-install/node_modules/axios": { + "version": "0.26.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", + "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", + "dev": true, + "dependencies": { + "follow-redirects": "^1.14.8" + } + }, "node_modules/bl": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", @@ -3416,9 +3445,9 @@ } }, "node_modules/cli-spinners": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.1.tgz", - "integrity": "sha512-jHgecW0pxkonBJdrKsqxgRX9AcG+u/5k0Q7WPDfi8AogLAdwxEkyYYNWwZ5GvVFoFx2uiY1eNcSK00fh+1+FyQ==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.0.tgz", + "integrity": "sha512-4/aL9X3Wh0yiMQlE+eeRhWP6vclO3QRtw1JHKIT0FFUs5FjpFmESqtMvYZ0+lbzBw900b95mS0hohy+qn2VK/g==", "dev": true, "engines": { "node": ">=6" @@ -3926,20 +3955,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/define-data-property": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.0.tgz", - "integrity": "sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.2.1", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/define-lazy-prop": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", @@ -3953,12 +3968,11 @@ } }, "node_modules/define-properties": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", - "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", + "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", "dev": true, "dependencies": { - "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" }, @@ -4051,18 +4065,18 @@ } }, "node_modules/es-abstract": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.2.tgz", - "integrity": "sha512-YoxfFcDmhjOgWPWsV13+2RNjq1F6UQnfs+8TftwNqtzlmFzEXvlUwdrNrYeaizfjQzRMxkZ6ElWMOJIFKdVqwA==", + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.1.tgz", + "integrity": "sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw==", "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.0", - "arraybuffer.prototype.slice": "^1.0.2", + "arraybuffer.prototype.slice": "^1.0.1", "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", "es-set-tostringtag": "^2.0.1", "es-to-primitive": "^1.2.1", - "function.prototype.name": "^1.1.6", + "function.prototype.name": "^1.1.5", "get-intrinsic": "^1.2.1", "get-symbol-description": "^1.0.0", "globalthis": "^1.0.3", @@ -4078,23 +4092,23 @@ "is-regex": "^1.1.4", "is-shared-array-buffer": "^1.0.2", "is-string": "^1.0.7", - "is-typed-array": "^1.1.12", + "is-typed-array": "^1.1.10", "is-weakref": "^1.0.2", "object-inspect": "^1.12.3", "object-keys": "^1.1.1", "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.5.1", - "safe-array-concat": "^1.0.1", + "regexp.prototype.flags": "^1.5.0", + "safe-array-concat": "^1.0.0", "safe-regex-test": "^1.0.0", - "string.prototype.trim": "^1.2.8", - "string.prototype.trimend": "^1.0.7", - "string.prototype.trimstart": "^1.0.7", + "string.prototype.trim": "^1.2.7", + "string.prototype.trimend": "^1.0.6", + "string.prototype.trimstart": "^1.0.6", "typed-array-buffer": "^1.0.0", "typed-array-byte-length": "^1.0.0", "typed-array-byte-offset": "^1.0.0", "typed-array-length": "^1.0.4", "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.11" + "which-typed-array": "^1.1.10" }, "engines": { "node": ">= 0.4" @@ -4915,17 +4929,16 @@ } }, "node_modules/flat-cache": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.0.tgz", - "integrity": "sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", "dev": true, "dependencies": { - "flatted": "^3.2.7", - "keyv": "^4.5.3", + "flatted": "^3.1.0", "rimraf": "^3.0.2" }, "engines": { - "node": ">=12.0.0" + "node": "^10.12.0 || >=12.0.0" } }, "node_modules/flatted": { @@ -5040,6 +5053,36 @@ "node": ">=14.14" } }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fs-minipass/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -5066,15 +5109,15 @@ "dev": true }, "node_modules/function.prototype.name": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", - "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", + "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "functions-have-names": "^1.2.3" + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "functions-have-names": "^1.2.2" }, "engines": { "node": ">= 0.4" @@ -6252,12 +6295,6 @@ "node": ">=6" } }, - "node_modules/json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true - }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -6306,15 +6343,6 @@ "graceful-fs": "^4.1.6" } }, - "node_modules/keyv": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz", - "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==", - "dev": true, - "dependencies": { - "json-buffer": "3.0.1" - } - }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -6904,12 +6932,52 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/minisearch": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/minisearch/-/minisearch-6.1.0.tgz", "integrity": "sha512-PNxA/X8pWk+TiqPbsoIYH0GQ5Di7m6326/lwU/S4mlo4wGQddIcf/V//1f9TB0V4j59b57b+HZxt8h3iMROGvg==", "dev": true }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/mitt": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.0.tgz", @@ -6917,18 +6985,15 @@ "dev": true }, "node_modules/mkdirp": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", - "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", "dev": true, "bin": { - "mkdirp": "dist/cjs/src/bin.js" + "mkdirp": "bin/cmd.js" }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" } }, "node_modules/mkdirp-classic": { @@ -7202,9 +7267,9 @@ } }, "node_modules/node-gyp-build": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.1.tgz", - "integrity": "sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", + "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==", "dev": true, "bin": { "node-gyp-build": "bin.js", @@ -7507,14 +7572,14 @@ } }, "node_modules/object.fromentries": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.7.tgz", - "integrity": "sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.6.tgz", + "integrity": "sha512-VciD13dswC4j1Xt5394WR4MzmAQmlgN72phd/riNp9vtD7tp4QQWJ0R4wvclXcafgcYK8veHRed2W6XeGBvcfg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" }, "engines": { "node": ">= 0.4" @@ -7524,26 +7589,26 @@ } }, "node_modules/object.groupby": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.1.tgz", - "integrity": "sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.0.tgz", + "integrity": "sha512-70MWG6NfRH9GnbZOikuhPPYzpUpof9iW2J9E4dW7FXTqPNb6rllE6u39SKwwiNh8lCwX3DDb5OgcKGiEBrTTyw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", + "es-abstract": "^1.21.2", "get-intrinsic": "^1.2.1" } }, "node_modules/object.values": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.7.tgz", - "integrity": "sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", + "integrity": "sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" }, "engines": { "node": ">= 0.4" @@ -7941,9 +8006,9 @@ } }, "node_modules/pinia/node_modules/vue-demi": { - "version": "0.14.6", - "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.6.tgz", - "integrity": "sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==", + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.5.tgz", + "integrity": "sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==", "dev": true, "hasInstallScript": true, "bin": { @@ -8465,14 +8530,14 @@ } }, "node_modules/regexp.prototype.flags": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz", - "integrity": "sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", + "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", - "set-function-name": "^2.0.0" + "functions-have-names": "^1.2.3" }, "engines": { "node": ">= 0.4" @@ -8765,6 +8830,21 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/rollup-plugin-license/node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "dev": true, + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/rollup-plugin-string": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/rollup-plugin-string/-/rollup-plugin-string-3.0.0.tgz", @@ -8950,13 +9030,13 @@ } }, "node_modules/safe-array-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.1.tgz", - "integrity": "sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.0.tgz", + "integrity": "sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1", + "get-intrinsic": "^1.2.0", "has-symbols": "^1.0.3", "isarray": "^2.0.5" }, @@ -9012,7 +9092,10 @@ "resolved": "https://registry.npmjs.org/search-insights/-/search-insights-2.8.3.tgz", "integrity": "sha512-W9rZfQ9XEfF0O6ntgQOTI7Txc8nkZrO4eJ/pTHK0Br6wWND2sPGPoWg+yGhdIW7wMbLqk8dc23IyEtLlNGpeNw==", "dev": true, - "peer": true + "peer": true, + "engines": { + "node": ">=8.16.0" + } }, "node_modules/semver": { "version": "7.5.4", @@ -9062,20 +9145,6 @@ "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", "dev": true }, - "node_modules/set-function-name": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", - "integrity": "sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==", - "dev": true, - "dependencies": { - "define-data-property": "^1.0.1", - "functions-have-names": "^1.2.3", - "has-property-descriptors": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/setimmediate-napi": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/setimmediate-napi/-/setimmediate-napi-1.0.6.tgz", @@ -9431,14 +9500,14 @@ } }, "node_modules/string.prototype.trim": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", - "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", + "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" }, "engines": { "node": ">= 0.4" @@ -9448,28 +9517,28 @@ } }, "node_modules/string.prototype.trimend": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", - "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", + "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", - "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", + "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -9593,6 +9662,23 @@ "integrity": "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==", "dev": true }, + "node_modules/tar": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.15.tgz", + "integrity": "sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==", + "dev": true, + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/tar-fs": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", @@ -9621,6 +9707,21 @@ "node": ">=6" } }, + "node_modules/tar/node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/terser": { "version": "5.20.0", "resolved": "https://registry.npmjs.org/terser/-/terser-5.20.0.tgz", @@ -9764,9 +9865,9 @@ } }, "node_modules/ts-api-utils": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", - "integrity": "sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.2.tgz", + "integrity": "sha512-Cbu4nIqnEdd+THNEsBdkolnOXhg0I8XteoHaEKgvsxpsbWda4IsUut2c187HxywQCvveojow0Dgw/amxtSKVkQ==", "dev": true, "engines": { "node": ">=16.13.0" @@ -10238,6 +10339,19 @@ "node": "10.* || >= 12.*" } }, + "node_modules/wasm-pack": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/wasm-pack/-/wasm-pack-0.12.1.tgz", + "integrity": "sha512-dIyKWUumPFsGohdndZjDXRFaokUT/kQS+SavbbiXVAvA/eN4riX5QNdB6AhXQx37zNxluxQkuixZUgJ8adKjOg==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "binary-install": "^1.0.1" + }, + "bin": { + "wasm-pack": "run.js" + } + }, "node_modules/wcwidth": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", diff --git a/package.json b/package.json index 172f5bc44..f7b063869 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rollup", - "version": "4.0.0-0", + "version": "4.0.0-19", "description": "Next-generation ES module bundler", "main": "dist/rollup.js", "module": "dist/es/rollup.js", @@ -8,27 +8,64 @@ "bin": { "rollup": "dist/bin/rollup" }, + "napi": { + "name": "rollup", + "package": { + "name": "@rollup/rollup" + }, + "triples": { + "defaults": false, + "additional": [ + "aarch64-apple-darwin", + "aarch64-linux-android", + "aarch64-pc-windows-msvc", + "aarch64-unknown-linux-gnu", + "armv7-linux-androideabi", + "armv7-unknown-linux-gnueabihf", + "i686-pc-windows-msvc", + "x86_64-apple-darwin", + "x86_64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl" + ] + } + }, "scripts": { - "build": "rollup --config rollup.config.ts --configPlugin typescript", + "build": "npm run build:wasm && concurrently -c green,blue \"npm run build:napi -- --release\" \"npm:build:js\" && npm run build:copy-native", + "build:quick": "concurrently -c green,blue 'npm:build:napi' 'npm:build:cjs' && npm run build:copy-native", + "build:napi": "napi build --platform --dts native.d.ts --js native.js --cargo-cwd rust -p bindings_napi --cargo-name bindings_napi", + "build:wasm": "wasm-pack build rust/bindings_wasm --out-dir ../../wasm --target web --no-pack && shx rm wasm/.gitignore", + "build:wasm:node": "wasm-pack build rust/bindings_wasm --out-dir ../../wasm-node --target nodejs --no-pack && shx rm wasm-node/.gitignore", + "update:napi": "npm run build:napi && npm run build:copy-native", + "build:js": "rollup --config rollup.config.ts --configPlugin typescript", + "build:js:node": "rollup --config rollup.config.ts --configPlugin typescript --configIsBuildNode", + "build:prepare": "concurrently -c green,blue \"npm run build:napi -- --release\" \"npm:build:js:node\" && npm run build:copy-native", + "update:js": "npm run build:js && npm run build:copy-native", + "build:copy-native": "shx mkdir -p dist && shx cp rollup.*.node dist/", "dev": "vitepress dev docs", "build:cjs": "rollup --config rollup.config.ts --configPlugin typescript --configTest", - "build:bootstrap": "node dist/bin/rollup --config rollup.config.ts --configPlugin typescript", + "build:bootstrap": "shx mv dist dist-build && node dist-build/bin/rollup --config rollup.config.ts --configPlugin typescript && shx rm -rf dist-build", "build:docs": "vitepress build docs", "preview:docs": "vitepress preview docs", - "ci:lint": "concurrently 'npm:lint:js:nofix' 'npm:lint:markdown:nofix'", - "ci:test": "npm run build:cjs && npm run build:bootstrap && npm run test:all", - "ci:test:only": "npm run build:cjs && npm run build:bootstrap && npm run test:only", - "ci:coverage": "npm run build:cjs && npm run build:bootstrap && nyc --reporter lcovonly mocha", - "lint": "concurrently -c red,green 'npm:lint:js' 'npm:lint:markdown'", + "ci:artifacts": "napi artifacts", + "ci:lint": "concurrently -c red,green,blue 'npm:lint:js:nofix' 'npm:lint:markdown:nofix' 'npm:lint:rust:nofix'", + "ci:test:only": "npm run build:cjs && npm run build:copy-native && npm run build:bootstrap && npm run build:copy-native && npm run test:only", + "ci:test:all": "npm run build:cjs && npm run build:copy-native && npm run build:bootstrap && npm run build:copy-native && concurrently --kill-others-on-fail -c green,blue,magenta,cyan 'npm:test:only' 'npm:test:typescript' 'npm:test:leak' 'npm:test:browser'", + "ci:coverage": "npm run build:cjs && npm run build:copy-native && npm run build:bootstrap && npm run build:copy-native && nyc --reporter lcovonly mocha", + "lint": "concurrently -c red,green,blue 'npm:lint:js' 'npm:lint:markdown' 'npm:lint:rust'", "lint:js": "eslint . --fix --cache", "lint:js:nofix": "eslint . --cache", "lint:markdown": "prettier --write \"**/*.md\"", "lint:markdown:nofix": "prettier --check \"**/*.md\"", + "lint:rust": "cd rust && cargo fmt", + "lint:rust:nofix": "cd rust && cargo fmt --check", "perf": "npm run build:cjs && node --expose-gc scripts/perf.js", "perf:init": "node scripts/perf-init.js", - "prepare": "husky install && node scripts/check-release.js || npm run build", - "prepublishOnly": "node scripts/check-release.js", - "release": "node scripts/release.js", + "prepare": "husky install && node scripts/check-release.js || npm run build:prepare", + "prepublishOnly": "node scripts/check-release.js && node scripts/prepublish.js", + "postpublish": "node scripts/postpublish.js", + "prepublish:napi": "napi prepublish --skip-gh-release", + "release": "node scripts/prepare-release.js", "release:docs": "git fetch --update-head-ok origin master:master && git branch --force documentation-published master && git push origin documentation-published", "test": "npm run build && npm run test:all", "test:update-snapshots": "node scripts/update-snapshots.js", @@ -74,6 +111,7 @@ "@codemirror/view": "^6.20.2", "@jridgewell/sourcemap-codec": "^1.4.15", "@mermaid-js/mermaid-cli": "^10.4.0", + "@napi-rs/cli": "^2.16.2", "@rollup/plugin-alias": "^5.0.0", "@rollup/plugin-buble": "^1.0.2", "@rollup/plugin-commonjs": "^25.0.4", @@ -85,7 +123,7 @@ "@rollup/pluginutils": "^5.0.4", "@types/estree": "1.0.2", "@types/mocha": "^10.0.1", - "@types/node": "~14.18.63", + "@types/node": "18.0.0", "@types/yargs-parser": "^21.0.1", "@typescript-eslint/eslint-plugin": "^6.7.3", "@typescript-eslint/parser": "^6.7.3", @@ -93,8 +131,6 @@ "@vue/eslint-config-typescript": "^12.0.0", "acorn": "^8.10.0", "acorn-import-assertions": "^1.9.0", - "acorn-jsx": "^5.3.2", - "acorn-walk": "^8.2.0", "buble": "^0.20.0", "builtin-modules": "^3.3.0", "chokidar": "^3.5.3", @@ -144,6 +180,7 @@ "vite": "^4.4.9", "vitepress": "^1.0.0-rc.20", "vue": "^3.3.4", + "wasm-pack": "^0.12.1", "weak-napi": "^2.0.2", "yargs-parser": "^21.1.1" }, @@ -151,6 +188,7 @@ "semver": "^7.5.4" }, "files": [ + "dist/*.node", "dist/**/*.js", "dist/*.d.ts", "dist/bin/rollup", diff --git a/rollup.config.ts b/rollup.config.ts index 83de4618f..dae1d86f6 100644 --- a/rollup.config.ts +++ b/rollup.config.ts @@ -13,7 +13,10 @@ import { moduleAliases } from './build-plugins/aliases'; import cleanBeforeWrite from './build-plugins/clean-before-write'; import { copyBrowserTypes, copyNodeTypes } from './build-plugins/copy-types'; import emitModulePackageFile from './build-plugins/emit-module-package-file'; +import { emitNativeEntry } from './build-plugins/emit-native-entry'; +import emitWasmFile from './build-plugins/emit-wasm-file'; import esmDynamicImport from './build-plugins/esm-dynamic-import'; +import { externalNativeImport } from './build-plugins/external-native-import'; import { fsEventsReplacement } from './build-plugins/fs-events-replacement'; import getLicenseHandler from './build-plugins/generate-license-file'; import getBanner from './build-plugins/get-banner'; @@ -46,7 +49,8 @@ const nodePlugins: readonly Plugin[] = [ include: 'node_modules/**' }), typescript(), - cleanBeforeWrite('dist') + cleanBeforeWrite('dist'), + externalNativeImport() ]; export default async function ( @@ -80,6 +84,7 @@ export default async function ( }, plugins: [ ...nodePlugins, + emitNativeEntry(), addCliEntry(), esmDynamicImport(), !command.configTest && collectLicenses(), @@ -93,6 +98,16 @@ export default async function ( return commonJSBuild; } + const exitOnCloseBundle: Plugin = { + closeBundle() { + // On CI, macOS runs sometimes do not close properly. This is a hack + // to fix this until the problem is understood. + console.log('Force quit.'); + setTimeout(() => process.exit(0)); + }, + name: 'force-close' + }; + const esmBuild: RollupOptions = { ...commonJSBuild, input: { @@ -109,6 +124,11 @@ export default async function ( plugins: [...nodePlugins, emitModulePackageFile(), collectLicenses(), writeLicense()] }; + if (command.configIsBuildNode) { + (esmBuild.plugins as Plugin[]).push(exitOnCloseBundle); + return [commonJSBuild, esmBuild]; + } + const { collectLicenses: collectLicensesBrowser, writeLicense: writeLicenseBrowser } = getLicenseHandler(fileURLToPath(new URL('browser', import.meta.url))); @@ -142,15 +162,8 @@ export default async function ( collectLicensesBrowser(), writeLicenseBrowser(), cleanBeforeWrite('browser/dist'), - { - closeBundle() { - // On CI, macOS runs sometimes do not close properly. This is a hack - // to fix this until the problem is understood. - console.log('Force quit.'); - setTimeout(() => process.exit(0)); - }, - name: 'force-close' - } + emitWasmFile(), + exitOnCloseBundle ], strictDeprecations: true, treeshake diff --git a/rust/Cargo.lock b/rust/Cargo.lock new file mode 100644 index 000000000..f6bb6ea8a --- /dev/null +++ b/rust/Cargo.lock @@ -0,0 +1,2452 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "addr2line" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +dependencies = [ + "cfg-if", + "getrandom", + "once_cell", + "serde", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "ast_node" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c09c69dffe06d222d072c878c3afe86eee2179806f20503faec97250268b4c24" +dependencies = [ + "pmutil", + "proc-macro2", + "quote", + "swc_macros_common", + "syn 2.0.27", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "auto_impl" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fee3da8ef1276b0bee5dd1c7258010d8fffd31801447323115a25560e1327b89" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "better_scoped_tls" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "794edcc9b3fb07bb4aecaa11f093fd45663b4feadb782d68303a2268bc2701de" +dependencies = [ + "scoped-tls", +] + +[[package]] +name = "bindings_napi" +version = "0.0.0" +dependencies = [ + "napi", + "napi-build", + "napi-derive", + "parse_ast", +] + +[[package]] +name = "bindings_wasm" +version = "0.0.0" +dependencies = [ + "parse_ast", + "wasm-bindgen", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "browserslist-rs" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9bda9b4595376bf255f68dafb5dcc5b0e2842b38dc2a7b52c4e0bfe9fd1c651" +dependencies = [ + "ahash", + "anyhow", + "chrono", + "either", + "getrandom", + "itertools", + "js-sys", + "nom", + "once_cell", + "quote", + "serde", + "serde-wasm-bindgen", + "serde_json", + "string_cache", + "string_cache_codegen", + "thiserror", + "wasm-bindgen", +] + +[[package]] +name = "bumpalo" +version = "3.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "time", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "cpufeatures" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "ctor" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f34ba9a9bcb8645379e9de8cb3ecfcf4d1c85ba66d90deb3259206fa5aa193b" +dependencies = [ + "quote", + "syn 2.0.27", +] + +[[package]] +name = "dashmap" +version = "5.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6943ae99c34386c84a470c499d3414f66502a41340aa895406e0d2e4a207b91d" +dependencies = [ + "cfg-if", + "hashbrown 0.14.0", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "data-encoding" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" + +[[package]] +name = "debugid" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" +dependencies = [ + "serde", + "uuid", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "from_variant" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03ec5dc38ee19078d84a692b1c41181ff9f94331c76cee66ff0208c770b5e54f" +dependencies = [ + "pmutil", + "proc-macro2", + "swc_macros_common", + "syn 2.0.27", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "gimli" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" + +[[package]] +name = "iana-time-zone" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "if_chain" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "is-macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4467ed1321b310c2625c5aa6c1b1ffc5de4d9e42668cf697a08fb033ee8265e" +dependencies = [ + "Inflector", + "pmutil", + "proc-macro2", + "quote", + "syn 2.0.27", +] + +[[package]] +name = "is_ci" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" + +[[package]] +name = "js-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "jsonc-parser" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b56a20e76235284255a09fcd1f45cf55d3c524ea657ebd3854735925c57743d" +dependencies = [ + "serde_json", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "lock_api" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" + +[[package]] +name = "lru" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "718e8fae447df0c7e1ba7f5189829e63fd536945c8988d61444c19039f16b670" +dependencies = [ + "hashbrown 0.13.2", +] + +[[package]] +name = "memchr" +version = "2.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5486aed0026218e61b8a01d5fbd5a0a134649abb71a0e53b7bc088529dced86e" + +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "miette" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c90329e44f9208b55f45711f9558cec15d7ef8295cc65ecd6d4188ae8edc58c" +dependencies = [ + "atty", + "backtrace", + "miette-derive", + "once_cell", + "owo-colors", + "supports-color", + "supports-hyperlinks", + "supports-unicode", + "terminal_size", + "textwrap", + "thiserror", + "unicode-width", +] + +[[package]] +name = "miette-derive" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b5bc45b761bcf1b5e6e6c4128cd93b84c218721a8d9b894aa0aff4ed180174c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "napi" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ede2d12cd6fce44da537a4be1f5510c73be2506c2e32dfaaafd1f36968f3a0e" +dependencies = [ + "bitflags 2.3.3", + "ctor", + "napi-derive", + "napi-sys", + "once_cell", +] + +[[package]] +name = "napi-build" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "882a73d9ef23e8dc2ebbffb6a6ae2ef467c0f18ac10711e4cc59c5485d41df0e" + +[[package]] +name = "napi-derive" +version = "2.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da1c6a8fa84d549aa8708fcd062372bf8ec6e849de39016ab921067d21bde367" +dependencies = [ + "cfg-if", + "convert_case", + "napi-derive-backend", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "napi-derive-backend" +version = "1.0.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20bbc7c69168d06a848f925ec5f0e0997f98e8c8d4f2cc30157f0da51c009e17" +dependencies = [ + "convert_case", + "once_cell", + "proc-macro2", + "quote", + "regex", + "semver 1.0.18", + "syn 1.0.109", +] + +[[package]] +name = "napi-sys" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "166b5ef52a3ab5575047a9fe8d4a030cdd0f63c96f071cd6907674453b07bae3" +dependencies = [ + "libloading", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "normpath" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a9da8c9922c35a1033d76f7272dfc2e7ee20392083d75aeea6ced23c6266578" +dependencies = [ + "winapi", +] + +[[package]] +name = "num-bigint" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", + "serde", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi 0.3.2", + "libc", +] + +[[package]] +name = "object" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "owo-colors" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "parse_ast" +version = "0.0.0" +dependencies = [ + "anyhow", + "parking_lot", + "swc", + "swc_common", + "swc_ecma_ast", + "swc_ecma_lints", + "swc_ecma_parser", + "swc_ecma_transforms_base", + "swc_ecma_visit", + "swc_error_reporters", +] + +[[package]] +name = "path-clean" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecba01bf2678719532c5e3059e0b5f0811273d94b397088b82e3bd0a78c78fdd" + +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "petgraph" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "phf" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" +dependencies = [ + "phf_macros", + "phf_shared", + "proc-macro-hack", +] + +[[package]] +name = "phf_generator" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" + +[[package]] +name = "pmutil" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52a40bc70c2c58040d2d8b167ba9a5ff59fc9dab7ad44771cfde3dcfde7a09c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.27", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "preset_env_base" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae83c5857727636a1f2c7188632c8a57986d2f1d2e2cf45f2642f5856c5b8e85" +dependencies = [ + "ahash", + "anyhow", + "browserslist-rs", + "dashmap", + "from_variant", + "once_cell", + "semver 1.0.18", + "serde", + "st-map", + "tracing", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + +[[package]] +name = "proc-macro2" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "psm" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +dependencies = [ + "cc", +] + +[[package]] +name = "quote" +version = "1.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_fmt" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce082a9940a7ace2ad4a8b7d0b1eac6aa378895f18be598230c5f2284ac05426" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rayon" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "regex" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver 0.9.0", +] + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "ryu-js" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6518fc26bced4d53678a22d6e423e9d8716377def84545fe328236e3af070e7f" + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +dependencies = [ + "serde", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "serde" +version = "1.0.175" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d25439cd7397d044e2748a6fe2432b5e85db703d6d097bd014b3c0ad1ebff0b" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_derive" +version = "1.0.175" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b23f7ade6f110613c0d63858ddb8b94c1041f550eab58a16b371bdf2c9c80ab4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.27", +] + +[[package]] +name = "serde_json" +version = "1.0.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha-1" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "siphasher" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" + +[[package]] +name = "smallvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" + +[[package]] +name = "smartstring" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29" +dependencies = [ + "autocfg", + "static_assertions", + "version_check", +] + +[[package]] +name = "smawk" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" + +[[package]] +name = "sourcemap" +version = "6.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8df03d85f2767c45e61b4453eb6144153c80399e4fdd6407a6d16cb87cc0347" +dependencies = [ + "data-encoding", + "debugid", + "if_chain", + "rustc_version", + "serde", + "serde_json", + "unicode-id", + "url", +] + +[[package]] +name = "st-map" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f352d5d14be5a1f956d76ae0c8060c3487aaa2a080f10a4b4ff023c7c05a9047" +dependencies = [ + "arrayvec", + "static-map-macro", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "stacker" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c886bd4480155fd3ef527d45e9ac8dd7118a898a46530b7b94c3e21866259fce" +dependencies = [ + "cc", + "cfg-if", + "libc", + "psm", + "winapi", +] + +[[package]] +name = "static-map-macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7628ae0bd92555d3de4303da41a5c8b1c5363e892001325f34e4be9ed024d0d7" +dependencies = [ + "pmutil", + "proc-macro2", + "quote", + "syn 2.0.27", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "string_cache" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" +dependencies = [ + "new_debug_unreachable", + "once_cell", + "parking_lot", + "phf_shared", + "precomputed-hash", + "serde", +] + +[[package]] +name = "string_cache_codegen" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", +] + +[[package]] +name = "string_enum" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fa4d4f81d7c05b9161f8de839975d3326328b8ba2831164b465524cc2f55252" +dependencies = [ + "pmutil", + "proc-macro2", + "quote", + "swc_macros_common", + "syn 2.0.27", +] + +[[package]] +name = "supports-color" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ba6faf2ca7ee42fdd458f4347ae0a9bd6bcc445ad7cb57ad82b383f18870d6f" +dependencies = [ + "atty", + "is_ci", +] + +[[package]] +name = "supports-hyperlinks" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "590b34f7c5f01ecc9d78dba4b3f445f31df750a67621cf31626f3b7441ce6406" +dependencies = [ + "atty", +] + +[[package]] +name = "supports-unicode" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8b945e45b417b125a8ec51f1b7df2f8df7920367700d1f98aedd21e5735f8b2" +dependencies = [ + "atty", +] + +[[package]] +name = "swc" +version = "0.265.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0d5177297253ff4013d2730770b4d28d227d168dbb5b3d7bc9dd785d1b07dc0" +dependencies = [ + "anyhow", + "base64", + "dashmap", + "either", + "indexmap", + "jsonc-parser", + "lru", + "once_cell", + "parking_lot", + "pathdiff", + "regex", + "rustc-hash", + "serde", + "serde_json", + "sourcemap", + "swc_atoms", + "swc_cached", + "swc_common", + "swc_config", + "swc_ecma_ast", + "swc_ecma_codegen", + "swc_ecma_ext_transforms", + "swc_ecma_lints", + "swc_ecma_loader", + "swc_ecma_minifier", + "swc_ecma_parser", + "swc_ecma_preset_env", + "swc_ecma_transforms", + "swc_ecma_transforms_base", + "swc_ecma_transforms_compat", + "swc_ecma_transforms_optimization", + "swc_ecma_utils", + "swc_ecma_visit", + "swc_error_reporters", + "swc_node_comments", + "swc_timer", + "swc_visit", + "tracing", + "url", +] + +[[package]] +name = "swc_atoms" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f54563d7dcba626d4acfe14ed12def7ecc28e004debe3ecd2c3ee07cc47e449" +dependencies = [ + "once_cell", + "rustc-hash", + "serde", + "string_cache", + "string_cache_codegen", + "triomphe", +] + +[[package]] +name = "swc_cached" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b8051bbf1c23817f9f2912fce18d9a6efcaaf8f8e1a4c69dbaf72bcaf71136" +dependencies = [ + "ahash", + "anyhow", + "dashmap", + "once_cell", + "regex", + "serde", +] + +[[package]] +name = "swc_common" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cb7fcd56655c8ae7dcf2344f0be6cbff4d9c7cb401fe3ec8e56e1de8dfe582" +dependencies = [ + "ahash", + "ast_node", + "better_scoped_tls", + "cfg-if", + "either", + "from_variant", + "new_debug_unreachable", + "num-bigint", + "once_cell", + "parking_lot", + "rustc-hash", + "serde", + "siphasher", + "sourcemap", + "string_cache", + "swc_atoms", + "swc_eq_ignore_macros", + "swc_visit", + "tracing", + "unicode-width", + "url", +] + +[[package]] +name = "swc_config" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ba1c7a40d38f9dd4e9a046975d3faf95af42937b34b2b963be4d8f01239584b" +dependencies = [ + "indexmap", + "serde", + "serde_json", + "swc_config_macro", +] + +[[package]] +name = "swc_config_macro" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5b5aaca9a0082be4515f0fbbecc191bf5829cd25b5b9c0a2810f6a2bb0d6829" +dependencies = [ + "pmutil", + "proc-macro2", + "quote", + "swc_macros_common", + "syn 2.0.27", +] + +[[package]] +name = "swc_ecma_ast" +version = "0.109.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bc2286cedd688a68f214faa1c19bb5cceab7c9c54d0cbe3273e4c1704e38f69" +dependencies = [ + "bitflags 2.3.3", + "is-macro", + "num-bigint", + "scoped-tls", + "serde", + "string_enum", + "swc_atoms", + "swc_common", + "unicode-id", +] + +[[package]] +name = "swc_ecma_codegen" +version = "0.144.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e62ba2c0ed1f119fc1a76542d007f1b2c12854d54dea15f5491363227debe11" +dependencies = [ + "memchr", + "num-bigint", + "once_cell", + "rustc-hash", + "serde", + "sourcemap", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_codegen_macros", + "tracing", +] + +[[package]] +name = "swc_ecma_codegen_macros" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcdff076dccca6cc6a0e0b2a2c8acfb066014382bc6df98ec99e755484814384" +dependencies = [ + "pmutil", + "proc-macro2", + "quote", + "swc_macros_common", + "syn 2.0.27", +] + +[[package]] +name = "swc_ecma_ext_transforms" +version = "0.108.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57eb7bbfbd7d0b4c2d5abf6936efb16d5a228508246a19795d59c849dbff073e" +dependencies = [ + "phf", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_utils", + "swc_ecma_visit", +] + +[[package]] +name = "swc_ecma_lints" +version = "0.87.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5f56635e73df9d6f4fa1ecbc1c65e9175ad2593fada76b13b05c5d2895b8a1d" +dependencies = [ + "auto_impl", + "dashmap", + "parking_lot", + "rayon", + "regex", + "serde", + "swc_atoms", + "swc_common", + "swc_config", + "swc_ecma_ast", + "swc_ecma_utils", + "swc_ecma_visit", +] + +[[package]] +name = "swc_ecma_loader" +version = "0.44.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7d7c322462657ae27ac090a2c89f7e456c94416284a2f5ecf66c43a6a3c19d1" +dependencies = [ + "anyhow", + "dashmap", + "lru", + "normpath", + "once_cell", + "parking_lot", + "path-clean", + "pathdiff", + "serde", + "serde_json", + "swc_cached", + "swc_common", + "tracing", +] + +[[package]] +name = "swc_ecma_minifier" +version = "0.186.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17745ea0c4f10846a29dfc1fe8d5e5141b57682a5645373be1252efa04d6937c" +dependencies = [ + "arrayvec", + "indexmap", + "num-bigint", + "num_cpus", + "once_cell", + "parking_lot", + "radix_fmt", + "regex", + "rustc-hash", + "ryu-js", + "serde", + "serde_json", + "swc_atoms", + "swc_cached", + "swc_common", + "swc_config", + "swc_ecma_ast", + "swc_ecma_codegen", + "swc_ecma_parser", + "swc_ecma_transforms_base", + "swc_ecma_transforms_optimization", + "swc_ecma_usage_analyzer", + "swc_ecma_utils", + "swc_ecma_visit", + "swc_timer", + "tracing", +] + +[[package]] +name = "swc_ecma_parser" +version = "0.139.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eab46cb863bc5cd61535464e07e5b74d5f792fa26a27b9f6fd4c8daca9903b7" +dependencies = [ + "either", + "num-bigint", + "num-traits", + "serde", + "smallvec", + "smartstring", + "stacker", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "tracing", + "typed-arena", +] + +[[package]] +name = "swc_ecma_preset_env" +version = "0.200.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb0e2940accc1b1d9f6bbe06190a84a43b1b7436d3fdae93f486a1971a045727" +dependencies = [ + "anyhow", + "dashmap", + "indexmap", + "once_cell", + "preset_env_base", + "rustc-hash", + "semver 1.0.18", + "serde", + "serde_json", + "st-map", + "string_enum", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms", + "swc_ecma_utils", + "swc_ecma_visit", +] + +[[package]] +name = "swc_ecma_transforms" +version = "0.223.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18ab21459fd0b85928da4654852ec875bb0f86d4ff17cc3de90ede6997e0ae56" +dependencies = [ + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms_base", + "swc_ecma_transforms_compat", + "swc_ecma_transforms_module", + "swc_ecma_transforms_optimization", + "swc_ecma_transforms_proposal", + "swc_ecma_transforms_react", + "swc_ecma_transforms_typescript", + "swc_ecma_utils", + "swc_ecma_visit", +] + +[[package]] +name = "swc_ecma_transforms_base" +version = "0.132.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e082ff07a2d31fd8e480dc590dd81efb75106e79bec24483dbece03630ca67b3" +dependencies = [ + "better_scoped_tls", + "bitflags 2.3.3", + "indexmap", + "once_cell", + "phf", + "rustc-hash", + "serde", + "smallvec", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_parser", + "swc_ecma_utils", + "swc_ecma_visit", + "tracing", +] + +[[package]] +name = "swc_ecma_transforms_classes" +version = "0.121.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71f54c8ce83b25e89dc60d09686ebc8c4d0376bc82c21ac1a14a1b0a339c714f" +dependencies = [ + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms_base", + "swc_ecma_utils", + "swc_ecma_visit", +] + +[[package]] +name = "swc_ecma_transforms_compat" +version = "0.158.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4da9073b7bfa9b2fd0a46f98fae9c1a205d1c7e8b91d8cd43c4077ce598c75b7" +dependencies = [ + "arrayvec", + "indexmap", + "is-macro", + "num-bigint", + "serde", + "smallvec", + "swc_atoms", + "swc_common", + "swc_config", + "swc_ecma_ast", + "swc_ecma_transforms_base", + "swc_ecma_transforms_classes", + "swc_ecma_transforms_macros", + "swc_ecma_utils", + "swc_ecma_visit", + "swc_trace_macro", + "tracing", +] + +[[package]] +name = "swc_ecma_transforms_macros" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8188eab297da773836ef5cf2af03ee5cca7a563e1be4b146f8141452c28cc690" +dependencies = [ + "pmutil", + "proc-macro2", + "quote", + "swc_macros_common", + "syn 2.0.27", +] + +[[package]] +name = "swc_ecma_transforms_module" +version = "0.175.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18db89901084ec9dddd7e2c32f00df335dfcd3b1e99dc146918223a625dc4638" +dependencies = [ + "Inflector", + "anyhow", + "bitflags 2.3.3", + "indexmap", + "is-macro", + "path-clean", + "pathdiff", + "regex", + "serde", + "swc_atoms", + "swc_cached", + "swc_common", + "swc_ecma_ast", + "swc_ecma_loader", + "swc_ecma_parser", + "swc_ecma_transforms_base", + "swc_ecma_utils", + "swc_ecma_visit", + "tracing", +] + +[[package]] +name = "swc_ecma_transforms_optimization" +version = "0.192.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a364e8747c2f2ef9715bf9626eefd3462e3b50fa137927dfa156276bf53f38aa" +dependencies = [ + "dashmap", + "indexmap", + "once_cell", + "petgraph", + "rustc-hash", + "serde_json", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_parser", + "swc_ecma_transforms_base", + "swc_ecma_transforms_macros", + "swc_ecma_utils", + "swc_ecma_visit", + "swc_fast_graph", + "tracing", +] + +[[package]] +name = "swc_ecma_transforms_proposal" +version = "0.166.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f2e61b71de4a1b403e6451d0c0fbeb66e27ef369c341a52b3827c9cf6df052c" +dependencies = [ + "either", + "rustc-hash", + "serde", + "smallvec", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms_base", + "swc_ecma_transforms_classes", + "swc_ecma_transforms_macros", + "swc_ecma_utils", + "swc_ecma_visit", +] + +[[package]] +name = "swc_ecma_transforms_react" +version = "0.178.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2313ff98bf87985b16be2d6ca7a3a9988888b6a02550a0eaa2a74cf2d2c7347" +dependencies = [ + "base64", + "dashmap", + "indexmap", + "once_cell", + "serde", + "sha-1", + "string_enum", + "swc_atoms", + "swc_common", + "swc_config", + "swc_ecma_ast", + "swc_ecma_parser", + "swc_ecma_transforms_base", + "swc_ecma_transforms_macros", + "swc_ecma_utils", + "swc_ecma_visit", +] + +[[package]] +name = "swc_ecma_transforms_typescript" +version = "0.182.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4be392ce94eecdb6e7afacec9080fb5be3cc36cfc376cd33f7e933ce6600768" +dependencies = [ + "serde", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms_base", + "swc_ecma_transforms_react", + "swc_ecma_utils", + "swc_ecma_visit", +] + +[[package]] +name = "swc_ecma_usage_analyzer" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1aabf52dfd20abdbe5087107273d250d134f5b0fa2251cbb42bbfbec88404af" +dependencies = [ + "indexmap", + "rustc-hash", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_utils", + "swc_ecma_visit", + "swc_timer", + "tracing", +] + +[[package]] +name = "swc_ecma_utils" +version = "0.122.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11006a3398ffd4693c4d3b0a1b1a5030edbdc04228159f5301120a6178144708" +dependencies = [ + "indexmap", + "num_cpus", + "once_cell", + "rustc-hash", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_visit", + "tracing", + "unicode-id", +] + +[[package]] +name = "swc_ecma_visit" +version = "0.95.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f628ec196e76e67892441e14eef2e423a738543d32bffdabfeec20c29582117" +dependencies = [ + "num-bigint", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_visit", + "tracing", +] + +[[package]] +name = "swc_eq_ignore_macros" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05a95d367e228d52484c53336991fdcf47b6b553ef835d9159db4ba40efb0ee8" +dependencies = [ + "pmutil", + "proc-macro2", + "quote", + "syn 2.0.27", +] + +[[package]] +name = "swc_error_reporters" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6530d0def50c33d14064a43837b7e3c1fe8716ee6c3495a478835793caae2c97" +dependencies = [ + "anyhow", + "miette", + "once_cell", + "parking_lot", + "swc_common", +] + +[[package]] +name = "swc_fast_graph" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a407fff2eb5ce3bee7513bdd9531a7be0285bc1213500b6d98ad235428d94cce" +dependencies = [ + "indexmap", + "petgraph", + "rustc-hash", + "swc_common", +] + +[[package]] +name = "swc_macros_common" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a273205ccb09b51fabe88c49f3b34c5a4631c4c00a16ae20e03111d6a42e832" +dependencies = [ + "pmutil", + "proc-macro2", + "quote", + "syn 2.0.27", +] + +[[package]] +name = "swc_node_comments" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73cee5dededc1e0d19e53dd0a41a343a43e21ed9b62c3df0fdd5801c11533bc9" +dependencies = [ + "dashmap", + "swc_atoms", + "swc_common", +] + +[[package]] +name = "swc_timer" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95c548665c811d1c5def583d3d6ca0291e5397122c0de6362bb201cc2de8beff" +dependencies = [ + "tracing", +] + +[[package]] +name = "swc_trace_macro" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff9719b6085dd2824fd61938a881937be14b08f95e2d27c64c825a9f65e052ba" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.27", +] + +[[package]] +name = "swc_visit" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e87c337fbb2d191bf371173dea6a957f01899adb8f189c6c31b122a6cfc98fc3" +dependencies = [ + "either", + "swc_visit_macros", +] + +[[package]] +name = "swc_visit_macros" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f322730fb82f3930a450ac24de8c98523af7d34ab8cb2f46bcb405839891a99" +dependencies = [ + "Inflector", + "pmutil", + "proc-macro2", + "quote", + "swc_macros_common", + "syn 2.0.27", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "terminal_size" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "textwrap" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7b3e525a49ec206798b40326a44121291b530c963cfb01018f63e135bac543d" +dependencies = [ + "smawk", + "unicode-linebreak", + "unicode-width", +] + +[[package]] +name = "thiserror" +version = "1.0.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.27", +] + +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.27", +] + +[[package]] +name = "tracing-core" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "triomphe" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee8098afad3fb0c54a9007aab6804558410503ad676d4633f9c2559a00ac0f" +dependencies = [ + "serde", + "stable_deref_trait", +] + +[[package]] +name = "typed-arena" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-id" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d70b6494226b36008c8366c288d77190b3fad2eb4c10533139c1c1f461127f1a" + +[[package]] +name = "unicode-ident" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" + +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "url" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "uuid" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.27", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.27", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" diff --git a/rust/Cargo.toml b/rust/Cargo.toml new file mode 100644 index 000000000..c6b84b979 --- /dev/null +++ b/rust/Cargo.toml @@ -0,0 +1,10 @@ +[profile.release] +lto = true + +[workspace] +resolver = "2" +members = [ + "bindings_napi", + "bindings_wasm", + "parse_ast", +] diff --git a/rust/bindings_napi/Cargo.toml b/rust/bindings_napi/Cargo.toml new file mode 100644 index 000000000..516950089 --- /dev/null +++ b/rust/bindings_napi/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "bindings_napi" +version = "0.0.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[lib] +crate-type = ["cdylib"] + +[dependencies] +# Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix +napi = { version = "2.12.2", default-features = false, features = ["napi4"] } +napi-derive = "2.12.2" +parse_ast = { path = "../parse_ast" } + +[build-dependencies] +napi-build = "2.0.1" diff --git a/rust/bindings_napi/build.rs b/rust/bindings_napi/build.rs new file mode 100644 index 000000000..1f866b6a3 --- /dev/null +++ b/rust/bindings_napi/build.rs @@ -0,0 +1,5 @@ +extern crate napi_build; + +fn main() { + napi_build::setup(); +} diff --git a/rust/bindings_napi/src/lib.rs b/rust/bindings_napi/src/lib.rs new file mode 100644 index 000000000..2a0087abf --- /dev/null +++ b/rust/bindings_napi/src/lib.rs @@ -0,0 +1,10 @@ +#![deny(clippy::all)] + +use napi::bindgen_prelude::*; +use napi_derive::napi; +use parse_ast::parse_ast; + +#[napi] +pub fn parse(code: String) -> Buffer { + parse_ast(code).into() +} diff --git a/rust/bindings_wasm/Cargo.toml b/rust/bindings_wasm/Cargo.toml new file mode 100644 index 000000000..50a988942 --- /dev/null +++ b/rust/bindings_wasm/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "bindings_wasm" +version = "0.0.0" +edition = "2021" + +[dependencies] +wasm-bindgen = "0.2.87" +parse_ast = { path = "../parse_ast" } + +[lib] +crate-type = ["cdylib", "rlib"] diff --git a/rust/bindings_wasm/src/lib.rs b/rust/bindings_wasm/src/lib.rs new file mode 100644 index 000000000..f75a62ab3 --- /dev/null +++ b/rust/bindings_wasm/src/lib.rs @@ -0,0 +1,7 @@ +use parse_ast::parse_ast; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +pub fn parse(code: String) -> Vec { + parse_ast(code) +} diff --git a/rust/parse_ast/Cargo.toml b/rust/parse_ast/Cargo.toml new file mode 100644 index 000000000..faefca303 --- /dev/null +++ b/rust/parse_ast/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "parse_ast" +version = "0.0.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +anyhow = "1.0.71" +swc = "0.265.7" +swc_common = "0.32.0" +swc_ecma_ast = "0.109.0" +swc_ecma_parser = "0.139.0" +swc_error_reporters = "0.16.0" +parking_lot = "0.12.1" +swc_ecma_lints = "0.87.2" +swc_ecma_transforms_base = "0.132.2" +swc_ecma_visit = "0.95.0" diff --git a/rust/parse_ast/src/convert_ast.rs b/rust/parse_ast/src/convert_ast.rs new file mode 100644 index 000000000..e7d6154cd --- /dev/null +++ b/rust/parse_ast/src/convert_ast.rs @@ -0,0 +1,2 @@ +pub mod annotations; +pub mod converter; diff --git a/rust/parse_ast/src/convert_ast/annotations.rs b/rust/parse_ast/src/convert_ast/annotations.rs new file mode 100644 index 000000000..6128718a7 --- /dev/null +++ b/rust/parse_ast/src/convert_ast/annotations.rs @@ -0,0 +1,129 @@ +use std::cell::RefCell; + +use swc_common::comments::{Comment, Comments}; +use swc_common::BytePos; + +#[derive(Default)] +pub struct SequentialComments { + annotations: RefCell>, +} + +impl SequentialComments { + pub fn add_comment(&self, comment: Comment) { + if comment.text.starts_with('#') && comment.text.contains("sourceMappingURL=") { + self.annotations.borrow_mut().push(AnnotationWithType { + comment, + kind: AnnotationKind::SourceMappingUrl, + }); + return; + } + let mut search_position = 1; + while let Some(Some(match_position)) = comment.text.get(search_position..).map(|s| s.find("__")) + { + search_position += match_position; + match &comment.text[search_position - 1..search_position] { + "@" | "#" => { + let annotation_slice = &comment.text[search_position..]; + if annotation_slice.starts_with("__PURE__") { + self.annotations.borrow_mut().push(AnnotationWithType { + comment, + kind: AnnotationKind::Pure, + }); + return; + } + if annotation_slice.starts_with("__NO_SIDE_EFFECTS__") { + self.annotations.borrow_mut().push(AnnotationWithType { + comment, + kind: AnnotationKind::NoSideEffects, + }); + return; + } + } + _ => {} + } + search_position += 3; + } + } + + pub fn take_annotations(self) -> Vec { + self.annotations.take() + } +} + +impl Comments for SequentialComments { + fn add_leading(&self, _: BytePos, comment: Comment) { + self.add_comment(comment); + } + + #[cfg_attr(not(debug_assertions), inline(always))] + fn add_leading_comments(&self, _: BytePos, _: Vec) { + panic!("add_leading_comments"); + } + + #[cfg_attr(not(debug_assertions), inline(always))] + fn has_leading(&self, _: BytePos) -> bool { + panic!("has_leading"); + } + + #[cfg_attr(not(debug_assertions), inline(always))] + fn move_leading(&self, _: BytePos, _: BytePos) { + panic!("move_leading"); + } + + #[cfg_attr(not(debug_assertions), inline(always))] + fn take_leading(&self, _: BytePos) -> Option> { + panic!("take_leading"); + } + + #[cfg_attr(not(debug_assertions), inline(always))] + fn get_leading(&self, _: BytePos) -> Option> { + panic!("get_leading"); + } + + #[cfg_attr(not(debug_assertions), inline(always))] + fn add_trailing(&self, _: BytePos, comment: Comment) { + self.add_comment(comment); + } + + #[cfg_attr(not(debug_assertions), inline(always))] + fn add_trailing_comments(&self, _: BytePos, _: Vec) { + panic!("add_trailing_comments"); + } + + #[cfg_attr(not(debug_assertions), inline(always))] + fn has_trailing(&self, _: BytePos) -> bool { + panic!("has_trailing"); + } + + #[cfg_attr(not(debug_assertions), inline(always))] + fn move_trailing(&self, _: BytePos, _: BytePos) { + panic!("move_trailing"); + } + + #[cfg_attr(not(debug_assertions), inline(always))] + fn take_trailing(&self, _: BytePos) -> Option> { + panic!("take_trailing"); + } + + #[cfg_attr(not(debug_assertions), inline(always))] + fn get_trailing(&self, _: BytePos) -> Option> { + panic!("get_trailing"); + } + + #[cfg_attr(not(debug_assertions), inline(always))] + fn add_pure_comment(&self, _: BytePos) { + panic!("add_pure_comment"); + } +} + +pub struct AnnotationWithType { + pub comment: Comment, + pub kind: AnnotationKind, +} + +#[derive(Clone, PartialEq, Debug)] +pub enum AnnotationKind { + Pure, + NoSideEffects, + SourceMappingUrl, +} diff --git a/rust/parse_ast/src/convert_ast/converter.rs b/rust/parse_ast/src/convert_ast/converter.rs new file mode 100644 index 000000000..0f65625d6 --- /dev/null +++ b/rust/parse_ast/src/convert_ast/converter.rs @@ -0,0 +1,2762 @@ +use swc::atoms::JsWord; +use swc_common::Span; +use swc_ecma_ast::{ + ArrayLit, ArrayPat, ArrowExpr, AssignExpr, AssignOp, AssignPat, AssignPatProp, AwaitExpr, BigInt, + BinExpr, BinaryOp, BindingIdent, BlockStmt, BlockStmtOrExpr, Bool, BreakStmt, CallExpr, Callee, + CatchClause, Class, ClassDecl, ClassExpr, ClassMember, ClassMethod, ClassProp, ComputedPropName, + CondExpr, Constructor, ContinueStmt, DebuggerStmt, Decl, DefaultDecl, DoWhileStmt, EmptyStmt, + ExportAll, ExportDecl, ExportDefaultDecl, ExportDefaultExpr, ExportNamedSpecifier, + ExportSpecifier, Expr, ExprOrSpread, ExprStmt, FnExpr, ForHead, ForInStmt, ForOfStmt, ForStmt, + Function, GetterProp, Ident, IfStmt, ImportDecl, ImportDefaultSpecifier, ImportNamedSpecifier, + ImportSpecifier, ImportStarAsSpecifier, KeyValuePatProp, KeyValueProp, LabeledStmt, Lit, + MemberExpr, MemberProp, MetaPropExpr, MetaPropKind, MethodKind, MethodProp, ModuleDecl, + ModuleExportName, ModuleItem, NamedExport, NewExpr, Null, Number, ObjectLit, ObjectPat, + ObjectPatProp, OptCall, OptChainBase, OptChainExpr, ParamOrTsParamProp, ParenExpr, Pat, + PatOrExpr, PrivateMethod, PrivateName, PrivateProp, Program, Prop, PropName, PropOrSpread, Regex, + RestPat, ReturnStmt, SeqExpr, SetterProp, SpreadElement, StaticBlock, Stmt, Str, Super, + SuperProp, SuperPropExpr, SwitchCase, SwitchStmt, TaggedTpl, ThisExpr, ThrowStmt, Tpl, + TplElement, TryStmt, UnaryExpr, UnaryOp, UpdateExpr, UpdateOp, VarDecl, VarDeclKind, + VarDeclOrExpr, VarDeclarator, WhileStmt, YieldExpr, +}; + +use crate::convert_ast::annotations::{AnnotationKind, AnnotationWithType}; +use crate::convert_ast::converter::analyze_code::find_first_occurrence_outside_comment; +use crate::convert_ast::converter::node_types::*; +use crate::convert_ast::converter::string_constants::*; +use crate::convert_ast::converter::utf16_positions::{ + ConvertedAnnotation, Utf8ToUtf16ByteIndexConverterAndAnnotationHandler, +}; + +mod analyze_code; +pub mod node_types; +mod string_constants; +mod utf16_positions; + +pub struct AstConverter<'a> { + buffer: Vec, + code: &'a [u8], + index_converter: Utf8ToUtf16ByteIndexConverterAndAnnotationHandler<'a>, +} + +impl<'a> AstConverter<'a> { + pub fn new(code: &'a str, annotations: &'a Vec) -> Self { + Self { + // TODO SWC This is just a wild guess and should be refined with a large + // block of minified code + buffer: Vec::with_capacity(20 * code.len()), + code: code.as_bytes(), + index_converter: Utf8ToUtf16ByteIndexConverterAndAnnotationHandler::new(code, annotations), + } + } + + pub fn convert_ast_to_buffer(mut self, node: &Program) -> Vec { + self.convert_program(node); + self.buffer.shrink_to_fit(); + self.buffer + } + + // === helpers + fn add_type_and_positions(&mut self, node_type: &[u8; 4], span: &Span) { + // type + self.buffer.extend_from_slice(node_type); + // start + self + .buffer + .extend_from_slice(&(self.index_converter.convert(span.lo.0 - 1, false)).to_ne_bytes()); + // end + self + .buffer + .extend_from_slice(&(self.index_converter.convert(span.hi.0 - 1, false)).to_ne_bytes()); + } + + fn add_type_and_explicit_start(&mut self, node_type: &[u8; 4], start: u32) -> usize { + // type + self.buffer.extend_from_slice(node_type); + // start + self + .buffer + .extend_from_slice(&(self.index_converter.convert(start, false)).to_ne_bytes()); + // end + let end_position = self.buffer.len(); + self.buffer.resize(end_position + 4, 0); + end_position + } + + fn add_explicit_end(&mut self, end_position: usize, end: u32) { + self.buffer[end_position..end_position + 4] + .copy_from_slice(&(self.index_converter.convert(end, false)).to_ne_bytes()); + } + + fn add_type_and_start(&mut self, node_type: &[u8; 4], span: &Span) -> usize { + self.add_type_and_start_and_handle_annotations(node_type, span, false) + } + + fn add_type_and_start_and_handle_annotations( + &mut self, + node_type: &[u8; 4], + span: &Span, + keep_annotations: bool, + ) -> usize { + // type + self.buffer.extend_from_slice(node_type); + // start + let start = self + .index_converter + .convert(span.lo.0 - 1, keep_annotations); + self.buffer.extend_from_slice(&start.to_ne_bytes()); + // end + let end_position = self.buffer.len(); + self.buffer.resize(end_position + 4, 0); + end_position + } + + fn add_end(&mut self, end_position: usize, span: &Span) { + self.buffer[end_position..end_position + 4] + .copy_from_slice(&(self.index_converter.convert(span.hi.0 - 1, false)).to_ne_bytes()); + } + + fn convert_item_list(&mut self, item_list: &[T], convert_item: F) + where + F: Fn(&mut AstConverter, &T) -> bool, + { + // store number of items in first position + self + .buffer + .extend_from_slice(&(item_list.len() as u32).to_ne_bytes()); + let mut reference_position = self.buffer.len(); + // make room for the reference positions of the items + self + .buffer + .resize(self.buffer.len() + item_list.len() * 4, 0); + for item in item_list { + let insert_position = (self.buffer.len() as u32) >> 2; + if convert_item(self, item) { + self.buffer[reference_position..reference_position + 4] + .copy_from_slice(&insert_position.to_ne_bytes()); + } + reference_position += 4; + } + } + + fn convert_item_list_with_state( + &mut self, + item_list: &[T], + state: &mut S, + convert_item: F, + ) where + F: Fn(&mut AstConverter, &T, &mut S) -> bool, + { + // store number of items in first position + self + .buffer + .extend_from_slice(&(item_list.len() as u32).to_ne_bytes()); + let mut reference_position = self.buffer.len(); + // make room for the reference positions of the items + self + .buffer + .resize(self.buffer.len() + item_list.len() * 4, 0); + for item in item_list { + let insert_position = (self.buffer.len() as u32) >> 2; + if convert_item(self, item, state) { + self.buffer[reference_position..reference_position + 4] + .copy_from_slice(&insert_position.to_ne_bytes()); + } + reference_position += 4; + } + } + + // TODO SWC deduplicate strings and see if we can easily compare atoms + fn convert_string(&mut self, string: &str) { + convert_string(&mut self.buffer, string); + } + + fn convert_boolean(&mut self, boolean: bool) { + self + .buffer + .extend_from_slice(&(if boolean { 1u32 } else { 0u32 }).to_ne_bytes()); + } + + fn reserve_reference_positions(&mut self, item_count: usize) -> usize { + let reference_position = self.buffer.len(); + self + .buffer + .resize(reference_position + (item_count << 2), 0); + reference_position + } + + fn update_reference_position(&mut self, reference_position: usize) { + let insert_position = (self.buffer.len() as u32) >> 2; + self.buffer[reference_position..reference_position + 4] + .copy_from_slice(&insert_position.to_ne_bytes()); + } + + // === enums + fn convert_program(&mut self, node: &Program) { + match node { + Program::Module(module) => { + self.store_program(ModuleItemsOrStatements::ModuleItems(&module.body)) + } + Program::Script(script) => { + self.store_program(ModuleItemsOrStatements::Statements(&script.body)) + } + } + } + + fn convert_module_item(&mut self, module_item: &ModuleItem) { + match module_item { + ModuleItem::Stmt(statement) => self.convert_statement(statement), + ModuleItem::ModuleDecl(module_declaration) => { + self.convert_module_declaration(module_declaration); + } + } + } + + fn convert_statement(&mut self, statement: &Stmt) { + match statement { + Stmt::Break(break_statement) => self.convert_break_statement(break_statement), + Stmt::Block(block_statement) => self.convert_block_statement(block_statement, false), + Stmt::Continue(continue_statement) => self.convert_continue_statement(continue_statement), + Stmt::Decl(declaration) => self.convert_declaration(declaration), + Stmt::Debugger(debugger_statement) => self.convert_debugger_statement(debugger_statement), + Stmt::DoWhile(do_while_statement) => self.convert_do_while_statement(do_while_statement), + Stmt::Empty(empty_statement) => self.convert_empty_statement(empty_statement), + Stmt::Expr(expression_statement) => { + self.convert_expression_statement(expression_statement, None) + } + Stmt::For(for_statement) => self.convert_for_statement(for_statement), + Stmt::ForIn(for_in_statement) => self.convert_for_in_statement(for_in_statement), + Stmt::ForOf(for_of_statement) => self.convert_for_of_statement(for_of_statement), + Stmt::If(if_statement) => self.convert_if_statement(if_statement), + Stmt::Labeled(labeled_statement) => self.convert_labeled_statement(labeled_statement), + Stmt::Return(return_statement) => self.convert_return_statement(return_statement), + Stmt::Switch(switch_statement) => self.convert_switch_statement(switch_statement), + Stmt::Throw(throw_statement) => self.convert_throw_statement(throw_statement), + Stmt::Try(try_statement) => self.convert_try_statement(try_statement), + Stmt::While(while_statement) => self.convert_while_statement(while_statement), + Stmt::With(_) => unimplemented!("Cannot convert Stmt::With"), + } + } + + fn convert_expression(&mut self, expression: &Expr) -> Option<(u32, u32)> { + match expression { + Expr::Array(array_literal) => { + self.convert_array_literal(array_literal); + None + } + Expr::Arrow(arrow_expression) => { + self.convert_arrow_expression(arrow_expression); + None + } + Expr::Assign(assignment_expression) => { + self.convert_assignment_expression(assignment_expression); + None + } + Expr::Await(await_expression) => { + self.convert_await_expression(await_expression); + None + } + Expr::Bin(binary_expression) => { + self.convert_binary_expression(binary_expression); + None + } + Expr::Call(call_expression) => { + self.convert_call_expression(call_expression, false, false); + None + } + Expr::Class(class_expression) => { + self.convert_class_expression(class_expression, &TYPE_CLASS_EXPRESSION); + None + } + Expr::Cond(conditional_expression) => { + self.convert_conditional_expression(conditional_expression); + None + } + Expr::Fn(function_expression) => { + self.convert_function( + &function_expression.function, + &TYPE_FUNCTION_EXPRESSION, + function_expression.ident.as_ref(), + ); + None + } + Expr::Ident(identifier) => { + self.convert_identifier(identifier); + None + } + Expr::Lit(literal) => { + self.convert_literal(literal); + None + } + Expr::Member(member_expression) => { + self.convert_member_expression(member_expression, false, false); + None + } + Expr::MetaProp(meta_property) => { + self.convert_meta_property(meta_property); + None + } + Expr::New(new_expression) => { + self.convert_new_expression(new_expression); + None + } + Expr::Object(object_literal) => { + self.convert_object_literal(object_literal); + None + } + Expr::OptChain(optional_chain_expression) => { + self.convert_optional_chain_expression(optional_chain_expression, false); + None + } + Expr::Paren(parenthesized_expression) => { + Some(self.convert_parenthesized_expression(parenthesized_expression)) + } + Expr::PrivateName(private_name) => { + self.convert_private_name(&private_name); + None + } + Expr::Seq(sequence_expression) => { + self.convert_sequence_expression(sequence_expression); + None + } + Expr::SuperProp(super_property) => { + self.convert_super_property(super_property); + None + } + Expr::TaggedTpl(tagged_template_expression) => { + self.convert_tagged_template_expression(tagged_template_expression); + None + } + Expr::This(this_expression) => { + self.convert_this_expression(this_expression); + None + } + Expr::Tpl(template_literal) => { + self.convert_template_literal(template_literal); + None + } + Expr::Unary(unary_expression) => { + self.convert_unary_expression(unary_expression); + None + } + Expr::Update(update_expression) => { + self.convert_update_expression(update_expression); + None + } + Expr::Yield(yield_expression) => { + self.convert_yield_expression(yield_expression); + None + } + Expr::JSXMember(_) => unimplemented!("Cannot convert Expr::JSXMember"), + Expr::JSXNamespacedName(_) => unimplemented!("Cannot convert Expr::JSXNamespacedName"), + Expr::JSXEmpty(_) => unimplemented!("Cannot convert Expr::JSXEmpty"), + Expr::JSXElement(_) => unimplemented!("Cannot convert Expr::JSXElement"), + Expr::JSXFragment(_) => unimplemented!("Cannot convert Expr::JSXFragment"), + Expr::TsTypeAssertion(_) => unimplemented!("Cannot convert Expr::TsTypeAssertion"), + Expr::TsConstAssertion(_) => unimplemented!("Cannot convert Expr::TsConstAssertion"), + Expr::TsNonNull(_) => unimplemented!("Cannot convert Expr::TsNonNull"), + Expr::TsAs(_) => unimplemented!("Cannot convert Expr::TsAs"), + Expr::TsInstantiation(_) => unimplemented!("Cannot convert Expr::TsInstantiation"), + Expr::TsSatisfies(_) => unimplemented!("Cannot convert Expr::TsSatisfies"), + Expr::Invalid(_) => unimplemented!("Cannot convert Expr::Invalid"), + } + } + + fn get_expression_span(&mut self, expression: &Expr) -> Span { + match expression { + Expr::Array(array_literal) => array_literal.span, + Expr::Arrow(arrow_expression) => arrow_expression.span, + Expr::Assign(assignment_expression) => assignment_expression.span, + Expr::Await(await_expression) => await_expression.span, + Expr::Bin(binary_expression) => binary_expression.span, + Expr::Call(call_expression) => call_expression.span, + Expr::Class(class_expression) => class_expression.class.span, + Expr::Cond(conditional_expression) => conditional_expression.span, + Expr::Fn(function_expression) => function_expression.function.span, + Expr::Ident(identifier) => identifier.span, + Expr::Lit(Lit::Str(literal)) => literal.span, + Expr::Lit(Lit::Bool(literal)) => literal.span, + Expr::Lit(Lit::Null(literal)) => literal.span, + Expr::Lit(Lit::Num(literal)) => literal.span, + Expr::Lit(Lit::BigInt(literal)) => literal.span, + Expr::Lit(Lit::Regex(literal)) => literal.span, + Expr::Member(member_expression) => member_expression.span, + Expr::MetaProp(meta_property) => meta_property.span, + Expr::New(new_expression) => new_expression.span, + Expr::Object(object_literal) => object_literal.span, + Expr::OptChain(optional_chain_expression) => optional_chain_expression.span, + Expr::Paren(parenthesized_expression) => parenthesized_expression.span, + Expr::PrivateName(private_name) => private_name.span, + Expr::Seq(sequence_expression) => sequence_expression.span, + Expr::SuperProp(super_property) => super_property.span, + Expr::TaggedTpl(tagged_template_expression) => tagged_template_expression.span, + Expr::This(this_expression) => this_expression.span, + Expr::Tpl(template_literal) => template_literal.span, + Expr::Unary(unary_expression) => unary_expression.span, + Expr::Update(update_expression) => update_expression.span, + Expr::Yield(yield_expression) => yield_expression.span, + Expr::JSXMember(_) => unimplemented!("Cannot convert Expr::JSXMember"), + Expr::JSXNamespacedName(_) => unimplemented!("Cannot convert Expr::JSXNamespacedName"), + Expr::JSXEmpty(_) => unimplemented!("Cannot convert Expr::JSXEmpty"), + Expr::JSXElement(_) => unimplemented!("Cannot convert Expr::JSXElement"), + Expr::JSXFragment(_) => unimplemented!("Cannot convert Expr::JSXFragment"), + Expr::TsTypeAssertion(_) => unimplemented!("Cannot convert Expr::TsTypeAssertion"), + Expr::TsConstAssertion(_) => unimplemented!("Cannot convert Expr::TsConstAssertion"), + Expr::TsNonNull(_) => unimplemented!("Cannot convert Expr::TsNonNull"), + Expr::TsAs(_) => unimplemented!("Cannot convert Expr::TsAs"), + Expr::TsInstantiation(_) => unimplemented!("Cannot convert Expr::TsInstantiation"), + Expr::TsSatisfies(_) => unimplemented!("Cannot convert Expr::TsSatisfies"), + Expr::Invalid(_) => unimplemented!("Cannot convert Expr::Invalid"), + Expr::Lit(Lit::JSXText(_)) => unimplemented!("Cannot convert Lit::JSXText"), + } + } + + fn convert_literal(&mut self, literal: &Lit) { + match literal { + Lit::BigInt(bigint_literal) => self.convert_literal_bigint(bigint_literal), + Lit::Bool(boolean_literal) => { + self.convert_literal_boolean(boolean_literal); + } + Lit::Null(null_literal) => { + self.convert_literal_null(null_literal); + } + Lit::Num(number_literal) => { + self.convert_literal_number(number_literal); + } + Lit::Regex(regex_literal) => { + self.convert_literal_regex(regex_literal); + } + Lit::Str(string_literal) => { + self.convert_literal_string(string_literal); + } + Lit::JSXText(_) => unimplemented!("Lit::JSXText"), + } + } + + fn convert_module_declaration(&mut self, module_declaration: &ModuleDecl) { + match module_declaration { + ModuleDecl::ExportDecl(export_declaration) => { + self.convert_export_declaration(export_declaration) + } + ModuleDecl::ExportNamed(export_named) => self.convert_export_named_declaration(export_named), + ModuleDecl::Import(import_declaration) => self.convert_import_declaration(import_declaration), + ModuleDecl::ExportDefaultExpr(export_default_expression) => { + self.convert_export_default_expression(export_default_expression) + } + ModuleDecl::ExportAll(export_all) => self.convert_export_all(export_all), + ModuleDecl::ExportDefaultDecl(export_default_declaration) => { + self.convert_export_default_declaration(export_default_declaration) + } + ModuleDecl::TsImportEquals(_) => unimplemented!("Cannot convert ModuleDecl::TsImportEquals"), + ModuleDecl::TsExportAssignment(_) => { + unimplemented!("Cannot convert ModuleDecl::TsExportAssignment") + } + ModuleDecl::TsNamespaceExport(_) => { + unimplemented!("Cannot convert ModuleDecl::TsNamespaceExport") + } + } + } + + fn convert_declaration(&mut self, declaration: &Decl) { + match declaration { + Decl::Var(variable_declaration) => self.convert_variable_declaration(variable_declaration), + Decl::Fn(function_declaration) => self.convert_function( + &function_declaration.function, + &TYPE_FUNCTION_DECLARATION, + Some(&function_declaration.ident), + ), + Decl::Class(class_declaration) => self.convert_class_declaration(class_declaration), + Decl::Using(_) => unimplemented!("Cannot convert Decl::Using"), + Decl::TsInterface(_) => unimplemented!("Cannot convert Decl::TsInterface"), + Decl::TsTypeAlias(_) => unimplemented!("Cannot convert Decl::TsTypeAlias"), + Decl::TsEnum(_) => unimplemented!("Cannot convert Decl::TsEnum"), + Decl::TsModule(_) => unimplemented!("Cannot convert Decl::TsModule"), + } + } + + fn convert_pattern(&mut self, pattern: &Pat) -> Option<(u32, u32)> { + match pattern { + Pat::Array(array_pattern) => { + self.convert_array_pattern(array_pattern); + None + } + Pat::Assign(assignment_pattern) => { + self.convert_assignment_pattern(assignment_pattern); + None + } + Pat::Expr(expression) => self.convert_expression(expression), + Pat::Ident(binding_identifier) => { + self.convert_binding_identifier(binding_identifier); + None + } + Pat::Object(object) => { + self.convert_object_pattern(object); + None + } + Pat::Rest(rest_pattern) => { + self.convert_rest_pattern(rest_pattern); + None + } + Pat::Invalid(_) => unimplemented!("Cannot convert invalid pattern"), + } + } + + fn convert_binding_identifier(&mut self, binding_identifier: &BindingIdent) { + self.convert_identifier(&binding_identifier.id); + } + + fn convert_export_specifier(&mut self, export_specifier: &ExportSpecifier) { + match export_specifier { + ExportSpecifier::Named(export_named_specifier) => { + self.convert_export_named_specifier(export_named_specifier) + } + ExportSpecifier::Namespace(_) => unimplemented!("Cannot convert ExportSpecifier::Namespace"), + ExportSpecifier::Default(_) => unimplemented!("Cannot convert ExportSpecifier::Default"), + } + } + + fn convert_module_export_name(&mut self, module_export_name: &ModuleExportName) { + match module_export_name { + ModuleExportName::Ident(identifier) => self.convert_identifier(identifier), + ModuleExportName::Str(string_literal) => self.convert_literal_string(string_literal), + } + } + + fn convert_import_specifier(&mut self, import_specifier: &ImportSpecifier) { + match import_specifier { + ImportSpecifier::Named(import_named_specifier) => { + self.convert_import_named_specifier(import_named_specifier) + } + ImportSpecifier::Default(import_default_specifier) => { + self.convert_import_default_specifier(import_default_specifier) + } + ImportSpecifier::Namespace(import_namespace_specifier) => { + self.convert_import_namespace_specifier(import_namespace_specifier) + } + } + } + + fn convert_object_pattern_property(&mut self, object_pattern_property: &ObjectPatProp) { + match object_pattern_property { + ObjectPatProp::Assign(assignment_pattern_property) => { + self.convert_assignment_pattern_property(assignment_pattern_property) + } + ObjectPatProp::KeyValue(key_value_pattern_property) => { + self.convert_key_value_pattern_property(key_value_pattern_property) + } + ObjectPatProp::Rest(rest_pattern) => self.convert_rest_pattern(rest_pattern), + } + } + + fn convert_class_member(&mut self, class_member: &ClassMember) { + match class_member { + ClassMember::ClassProp(class_property) => self.convert_class_property(class_property), + ClassMember::Constructor(constructor) => self.convert_constructor(constructor), + ClassMember::Method(method) => self.convert_method(method), + ClassMember::PrivateMethod(private_method) => self.convert_private_method(private_method), + ClassMember::PrivateProp(private_property) => self.convert_private_property(private_property), + ClassMember::StaticBlock(static_block) => self.convert_static_block(static_block), + ClassMember::TsIndexSignature(_) => { + unimplemented!("Cannot convert ClassMember::TsIndexSignature") + } + ClassMember::Empty(_) => unimplemented!("Cannot convert ClassMember::Empty"), + ClassMember::AutoAccessor(_) => unimplemented!("Cannot convert ClassMember::AutoAccessor"), + } + } + + fn convert_property_or_spread(&mut self, property_or_spread: &PropOrSpread) { + match property_or_spread { + PropOrSpread::Prop(property) => self.convert_property(&**property), + PropOrSpread::Spread(spread_element) => self.convert_spread_element(spread_element), + } + } + + fn convert_property(&mut self, property: &Prop) { + match property { + Prop::Getter(getter_property) => self.convert_getter_property(getter_property), + Prop::KeyValue(key_value_property) => self.convert_key_value_property(key_value_property), + Prop::Method(method_property) => self.convert_method_property(method_property), + Prop::Setter(setter_property) => self.convert_setter_property(setter_property), + Prop::Shorthand(identifier) => self.convert_shorthand_property(identifier), + Prop::Assign(_) => unimplemented!("Cannot convert Prop::Assign"), + } + } + + fn convert_pattern_or_expression(&mut self, pattern_or_expression: &PatOrExpr) { + match pattern_or_expression { + PatOrExpr::Pat(pattern) => { + self.convert_pattern(pattern); + } + PatOrExpr::Expr(expression) => { + self.convert_expression(expression); + } + } + } + + fn convert_parenthesized_expression( + &mut self, + parenthesized_expression: &ParenExpr, + ) -> (u32, u32) { + let start = self.index_converter.convert( + parenthesized_expression.span.lo.0 - 1, + match &*parenthesized_expression.expr { + Expr::Call(_) | Expr::New(_) | Expr::Paren(_) => true, + _ => false, + }, + ); + self.convert_expression(&parenthesized_expression.expr); + let end = self + .index_converter + .convert(parenthesized_expression.span.hi.0 - 1, false); + (start, end) + } + + fn convert_optional_chain_base(&mut self, optional_chain_base: &OptChainBase, is_optional: bool) { + match optional_chain_base { + OptChainBase::Member(member_expression) => { + self.convert_member_expression(&member_expression, is_optional, true) + } + OptChainBase::Call(optional_call) => { + self.convert_optional_call(optional_call, is_optional, true) + } + } + } + + fn convert_call_expression( + &mut self, + call_expression: &CallExpr, + is_optional: bool, + is_chained: bool, + ) { + match &call_expression.callee { + Callee::Import(_) => { + self.store_import_expression(&call_expression.span, &call_expression.args) + } + Callee::Expr(callee_expression) => self.store_call_expression( + &call_expression.span, + is_optional, + &StoredCallee::Expression(&callee_expression), + &call_expression.args, + is_chained, + ), + Callee::Super(callee_super) => self.store_call_expression( + &call_expression.span, + is_optional, + &StoredCallee::Super(&callee_super), + &call_expression.args, + is_chained, + ), + } + } + + fn convert_optional_call( + &mut self, + optional_call: &OptCall, + is_optional: bool, + is_chained: bool, + ) { + self.store_call_expression( + &optional_call.span, + is_optional, + &StoredCallee::Expression(&optional_call.callee), + &optional_call.args, + is_chained, + ); + } + + fn convert_export_declaration(&mut self, export_declaration: &ExportDecl) { + self.store_export_named_declaration( + &export_declaration.span, + &vec![], + None, + Some(&export_declaration.decl), + &None, + ); + } + + fn convert_export_named_declaration(&mut self, export_named_declaration: &NamedExport) { + match export_named_declaration.specifiers.first().unwrap() { + ExportSpecifier::Namespace(export_namespace_specifier) => self.store_export_all_declaration( + &export_named_declaration.span, + export_named_declaration.src.as_ref().unwrap(), + &export_named_declaration.with, + Some(&export_namespace_specifier.name), + ), + ExportSpecifier::Named(_) => self.store_export_named_declaration( + &export_named_declaration.span, + &export_named_declaration.specifiers, + export_named_declaration + .src + .as_ref() + .map(|source| &**source), + None, + &export_named_declaration.with, + ), + ExportSpecifier::Default(_) => panic!("Unexpected default export specifier"), + } + } + + fn convert_for_head(&mut self, for_head: &ForHead) { + match for_head { + ForHead::VarDecl(variable_declaration) => { + self.convert_variable_declaration(variable_declaration) + } + ForHead::Pat(pattern) => { + self.convert_pattern(pattern); + } + ForHead::UsingDecl(_) => unimplemented!("Cannot convert ForHead::UsingDecl"), + } + } + + fn convert_variable_declaration_or_expression( + &mut self, + variable_declaration_or_expression: &VarDeclOrExpr, + ) { + match variable_declaration_or_expression { + VarDeclOrExpr::VarDecl(variable_declaration) => { + self.convert_variable_declaration(variable_declaration); + } + VarDeclOrExpr::Expr(expression) => { + self.convert_expression(expression); + } + } + } + + fn convert_export_all(&mut self, export_all: &ExportAll) { + self.store_export_all_declaration(&export_all.span, &export_all.src, &export_all.with, None); + } + + fn convert_identifier(&mut self, identifier: &Ident) { + self.store_identifier( + identifier.span.lo.0 - 1, + identifier.span.hi.0 - 1, + &identifier.sym, + ); + } + + // === nodes + fn store_program(&mut self, body: ModuleItemsOrStatements) { + let end_position = self.add_type_and_explicit_start(&TYPE_PROGRAM, 0u32); + // reserve annotations + let reference_position = self.reserve_reference_positions(1); + // body + let mut keep_checking_directives = true; + match body { + ModuleItemsOrStatements::ModuleItems(module_items) => { + self.convert_item_list_with_state( + module_items, + &mut keep_checking_directives, + |ast_converter, module_item, can_be_directive| { + if *can_be_directive { + if let ModuleItem::Stmt(Stmt::Expr(expression)) = &*module_item { + if let Expr::Lit(Lit::Str(string)) = &*expression.expr { + ast_converter.convert_expression_statement(expression, Some(&string.value)); + return true; + } + }; + } + *can_be_directive = false; + ast_converter.convert_module_item(module_item); + true + }, + ); + } + ModuleItemsOrStatements::Statements(statements) => { + self.convert_item_list_with_state( + statements, + &mut keep_checking_directives, + |ast_converter, statement, can_be_directive| { + if *can_be_directive { + if let Stmt::Expr(expression) = &*statement { + if let Expr::Lit(Lit::Str(string)) = &*expression.expr { + ast_converter.convert_expression_statement(expression, Some(&string.value)); + return true; + } + }; + } + *can_be_directive = false; + ast_converter.convert_statement(statement); + true + }, + ); + } + } + // end + self.add_explicit_end(end_position, self.code.len() as u32); + // annotations + self.update_reference_position(reference_position); + self.index_converter.invalidate_collected_annotations(); + let invalid_annotations = self.index_converter.take_invalid_annotations(); + self.convert_item_list(&invalid_annotations, |ast_converter, annotation| { + ast_converter.convert_annotation(annotation); + true + }); + } + + fn convert_expression_statement( + &mut self, + expression_statement: &ExprStmt, + directive: Option<&JsWord>, + ) { + let end_position = + self.add_type_and_start(&TYPE_EXPRESSION_STATEMENT, &expression_statement.span); + // reserve directive + let reference_position = self.reserve_reference_positions(1); + // expression + self.convert_expression(&expression_statement.expr); + // directive + directive.map(|directive| { + self.update_reference_position(reference_position); + self.convert_string(directive); + }); + // end + self.add_end(end_position, &expression_statement.span); + } + + fn store_export_named_declaration( + &mut self, + span: &Span, + specifiers: &Vec, + src: Option<&Str>, + declaration: Option<&Decl>, + with: &Option>, + ) { + let end_position = self.add_type_and_start_and_handle_annotations( + &TYPE_EXPORT_NAMED_DECLARATION, + span, + match declaration { + Some(Decl::Fn(_)) => true, + Some(Decl::Var(variable_declaration)) => variable_declaration.kind == VarDeclKind::Const, + _ => false, + }, + ); + // reserve for declaration, src, attributes + let reference_position = self.reserve_reference_positions(3); + // specifiers + self.convert_item_list(specifiers, |ast_converter, specifier| { + ast_converter.convert_export_specifier(specifier); + true + }); + // declaration + declaration.map(|declaration| { + self.update_reference_position(reference_position); + self.convert_declaration(declaration) + }); + // src + src.map(|src| { + self.update_reference_position(reference_position + 4); + self.convert_literal_string(src) + }); + // attributes + self.update_reference_position(reference_position + 8); + self.store_import_attributes(with); + // end + self.add_end(end_position, span); + } + + fn convert_literal_number(&mut self, literal: &Number) { + self.add_type_and_positions(&TYPE_LITERAL_NUMBER, &literal.span); + // reserve for raw + let reference_position = self.reserve_reference_positions(1); + // value, needs to be little endian as we are reading via a DataView + self.buffer.extend_from_slice(&literal.value.to_le_bytes()); + // raw + literal.raw.as_ref().map(|raw| { + self.update_reference_position(reference_position); + self.convert_string(&*raw); + }); + } + + fn convert_literal_string(&mut self, literal: &Str) { + self.add_type_and_positions(&TYPE_LITERAL_STRING, &literal.span); + // reserve for raw + let reference_position = self.reserve_reference_positions(1); + // value + self.convert_string(&literal.value); + // raw + literal.raw.as_ref().map(|raw| { + self.update_reference_position(reference_position); + self.convert_string(&*raw); + }); + } + + fn convert_variable_declaration(&mut self, variable_declaration: &VarDecl) { + let end_position = self.add_type_and_start_and_handle_annotations( + &TYPE_VARIABLE_DECLARATION, + &variable_declaration.span, + match variable_declaration.kind { + VarDeclKind::Const => true, + _ => false, + }, + ); + self + .buffer + .extend_from_slice(match variable_declaration.kind { + VarDeclKind::Var => &STRING_VAR, + VarDeclKind::Let => &STRING_LET, + VarDeclKind::Const => &STRING_CONST, + }); + self.convert_item_list( + &variable_declaration.decls, + |ast_converter, variable_declarator| { + ast_converter.convert_variable_declarator(variable_declarator); + true + }, + ); + // end + self.add_end(end_position, &variable_declaration.span); + } + + fn convert_variable_declarator(&mut self, variable_declarator: &VarDeclarator) { + let end_position = + self.add_type_and_start(&TYPE_VARIABLE_DECLARATOR, &variable_declarator.span); + let forwarded_annotations = match &variable_declarator.init { + Some(expression) => match &**expression { + Expr::Arrow(_) => { + let annotations = self + .index_converter + .take_collected_annotations(AnnotationKind::NoSideEffects); + Some(annotations) + } + _ => None, + }, + None => None, + }; + // reserve for init + let reference_position = self.reserve_reference_positions(1); + // id + self.convert_pattern(&variable_declarator.name); + // init + forwarded_annotations.map(|annotations| { + self.index_converter.add_collected_annotations(annotations); + }); + variable_declarator.init.as_ref().map(|init| { + self.update_reference_position(reference_position); + self.convert_expression(&init); + }); + // end + self.add_end(end_position, &variable_declarator.span); + } + + fn store_identifier(&mut self, start: u32, end: u32, name: &str) { + let end_position = self.add_type_and_explicit_start(&TYPE_IDENTIFIER, start); + // name + self.convert_string(name); + // end + self.add_explicit_end(end_position, end); + } + + fn convert_export_named_specifier(&mut self, export_named_specifier: &ExportNamedSpecifier) { + let end_position = + self.add_type_and_start(&TYPE_EXPORT_SPECIFIER, &export_named_specifier.span); + // reserve for exported + let reference_position = self.reserve_reference_positions(1); + // local + self.convert_module_export_name(&export_named_specifier.orig); + // exported + export_named_specifier.exported.as_ref().map(|exported| { + self.update_reference_position(reference_position); + self.convert_module_export_name(&exported); + }); + // end + self.add_end(end_position, &export_named_specifier.span); + } + + fn convert_import_declaration(&mut self, import_declaration: &ImportDecl) { + let end_position = self.add_type_and_start(&TYPE_IMPORT_DECLARATION, &import_declaration.span); + // reserve for src, attributes + let reference_position = self.reserve_reference_positions(2); + // specifiers + self.convert_item_list( + &import_declaration.specifiers, + |ast_converter, import_specifier| { + ast_converter.convert_import_specifier(import_specifier); + true + }, + ); + // src + self.update_reference_position(reference_position); + self.convert_literal_string(&*import_declaration.src); + // attributes + self.update_reference_position(reference_position + 4); + self.store_import_attributes(&import_declaration.with); + // end + self.add_end(end_position, &import_declaration.span); + } + + fn store_import_attributes(&mut self, with: &Option>) { + match with { + Some(ref with) => { + self.convert_item_list(&with.props, |ast_converter, prop| match prop { + PropOrSpread::Prop(prop) => match &**prop { + Prop::KeyValue(key_value_property) => { + ast_converter.convert_import_attribute(key_value_property); + true + } + _ => panic!("Non key-value property in import declaration attributes"), + }, + PropOrSpread::Spread(_) => panic!("Spread in import declaration attributes"), + }); + } + None => self.buffer.resize(self.buffer.len() + 4, 0), + } + } + + fn store_import_expression(&mut self, span: &Span, arguments: &Vec) { + let end_position = self.add_type_and_start(&TYPE_IMPORT_EXPRESSION, span); + // reserve for options + let reference_position = self.reserve_reference_positions(1); + // source + self.convert_expression(&*arguments.first().unwrap().expr); + // options + arguments.get(1).map(|argument| { + self.update_reference_position(reference_position); + self.convert_expression_or_spread(argument); + }); + // end + self.add_end(end_position, span); + } + + fn store_call_expression( + &mut self, + span: &Span, + is_optional: bool, + callee: &StoredCallee, + arguments: &[ExprOrSpread], + is_chained: bool, + ) { + let end_position = self.add_type_and_start(&TYPE_CALL_EXPRESSION, span); + let annotations = self + .index_converter + .take_collected_annotations(AnnotationKind::Pure); + // optional + self.convert_boolean(is_optional); + // reserve for callee, arguments + let reference_position = self.reserve_reference_positions(2); + // annotations + self.convert_item_list(&annotations, |ast_converter, annotation| { + ast_converter.convert_annotation(annotation); + true + }); + // callee + self.update_reference_position(reference_position); + match callee { + StoredCallee::Expression(Expr::OptChain(optional_chain_expression)) => { + self.convert_optional_chain_expression(optional_chain_expression, is_chained); + } + StoredCallee::Expression(Expr::Call(call_expression)) => { + self.convert_call_expression(call_expression, false, is_chained); + } + StoredCallee::Expression(Expr::Member(member_expression)) => { + self.convert_member_expression(member_expression, false, is_chained); + } + StoredCallee::Expression(callee_expression) => { + self.convert_expression(callee_expression); + } + StoredCallee::Super(callee_super) => self.convert_super(callee_super), + } + // arguments + self.update_reference_position(reference_position + 4); + self.convert_item_list(arguments, |ast_converter, argument| { + ast_converter.convert_expression_or_spread(argument); + true + }); + // end + self.add_end(end_position, span); + } + + fn convert_import_named_specifier(&mut self, import_named_specifier: &ImportNamedSpecifier) { + let end_position = + self.add_type_and_start(&TYPE_IMPORT_SPECIFIER, &import_named_specifier.span); + // reserve for imported, local + let reference_position = self.reserve_reference_positions(2); + // imported + import_named_specifier.imported.as_ref().map(|imported| { + self.update_reference_position(reference_position); + self.convert_module_export_name(&imported); + }); + // local + self.update_reference_position(reference_position + 4); + self.convert_identifier(&import_named_specifier.local); + // end + self.add_end(end_position, &import_named_specifier.span); + } + + fn convert_arrow_expression(&mut self, arrow_expression: &ArrowExpr) { + let end_position = + self.add_type_and_start(&TYPE_ARROW_FUNCTION_EXPRESSION, &arrow_expression.span); + let annotations = self + .index_converter + .take_collected_annotations(AnnotationKind::NoSideEffects); + // async + self.convert_boolean(arrow_expression.is_async); + // generator + self.convert_boolean(arrow_expression.is_generator); + // expression + self.convert_boolean(match &*arrow_expression.body { + BlockStmtOrExpr::BlockStmt(_) => false, + BlockStmtOrExpr::Expr(_) => true, + }); + // reserve for params, body + let reference_position = self.reserve_reference_positions(2); + // annotations + self.convert_item_list(&annotations, |ast_converter, annotation| { + ast_converter.convert_annotation(annotation); + true + }); + // params + self.update_reference_position(reference_position); + self.convert_item_list(&arrow_expression.params, |ast_converter, param| { + ast_converter.convert_pattern(param); + true + }); + // body + self.update_reference_position(reference_position + 4); + match &*arrow_expression.body { + BlockStmtOrExpr::BlockStmt(block_statement) => { + self.convert_block_statement(block_statement, true) + } + BlockStmtOrExpr::Expr(expression) => { + self.convert_expression(expression); + } + } + // end + self.add_end(end_position, &arrow_expression.span); + } + + fn convert_block_statement(&mut self, block_statement: &BlockStmt, check_directive: bool) { + let end_position = self.add_type_and_start(&TYPE_BLOCK_STATEMENT, &block_statement.span); + // body + let mut keep_checking_directives = check_directive; + self.convert_item_list_with_state( + &block_statement.stmts, + &mut keep_checking_directives, + |ast_converter, statement, can_be_directive| { + if *can_be_directive { + if let Stmt::Expr(expression) = &*statement { + if let Expr::Lit(Lit::Str(string)) = &*expression.expr { + ast_converter.convert_expression_statement(expression, Some(&string.value)); + return true; + } + } + } + *can_be_directive = false; + ast_converter.convert_statement(statement); + true + }, + ); + // end + self.add_end(end_position, &block_statement.span); + } + + fn convert_expression_or_spread(&mut self, expression_or_spread: &ExprOrSpread) { + match expression_or_spread.spread { + Some(spread_span) => self.store_spread_element(&spread_span, &expression_or_spread.expr), + None => { + self.convert_expression(&expression_or_spread.expr); + } + } + } + + fn convert_spread_element(&mut self, spread_element: &SpreadElement) { + self.store_spread_element(&spread_element.dot3_token, &spread_element.expr); + } + + fn store_spread_element(&mut self, dot_span: &Span, argument: &Expr) { + let end_position = self.add_type_and_start(&TYPE_SPREAD_ELEMENT, dot_span); + // we need to set the end position to that of the expression + let argument_position = self.buffer.len(); + // argument + self.convert_expression(argument); + let expression_end: [u8; 4] = self.buffer[argument_position + 8..argument_position + 12] + .try_into() + .unwrap(); + self.buffer[end_position..end_position + 4].copy_from_slice(&expression_end); + } + + fn store_member_expression( + &mut self, + span: &Span, + is_optional: bool, + object: &ExpressionOrSuper, + property: MemberOrSuperProp, + is_chained: bool, + ) { + let end_position = self.add_type_and_start(&TYPE_MEMBER_EXPRESSION, span); + // optional + self.convert_boolean(is_optional); + // computed + self.convert_boolean(match property { + MemberOrSuperProp::Computed(_) => true, + _ => false, + }); + // reserve property + let reference_position = self.reserve_reference_positions(1); + // object + match object { + ExpressionOrSuper::Expression(Expr::OptChain(optional_chain_expression)) => { + self.convert_optional_chain_expression(optional_chain_expression, is_chained); + } + ExpressionOrSuper::Expression(Expr::Call(call_expression)) => { + self.convert_call_expression(call_expression, false, is_chained); + } + ExpressionOrSuper::Expression(Expr::Member(member_expression)) => { + self.convert_member_expression(member_expression, false, is_chained); + } + ExpressionOrSuper::Expression(expression) => { + self.convert_expression(expression); + } + ExpressionOrSuper::Super(super_token) => self.convert_super(&super_token), + } + // property + self.update_reference_position(reference_position); + match property { + MemberOrSuperProp::Identifier(ident) => self.convert_identifier(&ident), + MemberOrSuperProp::Computed(computed) => { + self.convert_expression(&computed.expr); + } + MemberOrSuperProp::PrivateName(private_name) => self.convert_private_name(&private_name), + } + // end + self.add_end(end_position, span); + } + + fn convert_member_expression( + &mut self, + member_expression: &MemberExpr, + is_optional: bool, + is_chained: bool, + ) { + self.store_member_expression( + &member_expression.span, + is_optional, + &ExpressionOrSuper::Expression(&member_expression.obj), + match &member_expression.prop { + MemberProp::Ident(identifier) => MemberOrSuperProp::Identifier(identifier), + MemberProp::PrivateName(private_name) => MemberOrSuperProp::PrivateName(private_name), + MemberProp::Computed(computed) => MemberOrSuperProp::Computed(computed), + }, + is_chained, + ); + } + + fn convert_private_name(&mut self, private_name: &PrivateName) { + self.add_type_and_positions(&TYPE_PRIVATE_IDENTIFIER, &private_name.span); + // id + self.convert_string(&private_name.id.sym); + } + + fn convert_import_default_specifier( + &mut self, + import_default_specifier: &ImportDefaultSpecifier, + ) { + let end_position = self.add_type_and_start( + &TYPE_IMPORT_DEFAULT_SPECIFIER, + &import_default_specifier.span, + ); + // local + self.convert_identifier(&import_default_specifier.local); + // end + self.add_end(end_position, &import_default_specifier.span); + } + + fn convert_literal_boolean(&mut self, literal: &Bool) { + self.add_type_and_positions(&TYPE_LITERAL_BOOLEAN, &literal.span); + // value + self.convert_boolean(literal.value); + } + + fn convert_export_default_expression(&mut self, export_default_expression: &ExportDefaultExpr) { + self.store_export_default_declaration( + &export_default_expression.span, + StoredDefaultExportExpression::Expression(&export_default_expression.expr), + ); + } + + fn convert_export_default_declaration(&mut self, export_default_declaration: &ExportDefaultDecl) { + self.store_export_default_declaration( + &export_default_declaration.span, + match &export_default_declaration.decl { + DefaultDecl::Class(class_expression) => { + StoredDefaultExportExpression::Class(&class_expression) + } + DefaultDecl::Fn(function_expression) => { + StoredDefaultExportExpression::Function(&function_expression) + } + DefaultDecl::TsInterfaceDecl(_) => { + unimplemented!("Cannot convert ExportDefaultDeclaration with TsInterfaceDecl") + } + }, + ); + } + + fn store_export_default_declaration( + &mut self, + span: &Span, + expression: StoredDefaultExportExpression, + ) { + let end_position = self.add_type_and_start_and_handle_annotations( + &TYPE_EXPORT_DEFAULT_DECLARATION, + span, + match expression { + StoredDefaultExportExpression::Expression(Expr::Fn(_) | Expr::Arrow(_)) + | StoredDefaultExportExpression::Function(_) => true, + _ => false, + }, + ); + // expression + match expression { + StoredDefaultExportExpression::Expression(expression) => { + self.convert_expression(&expression); + } + StoredDefaultExportExpression::Class(class_expression) => { + self.convert_class_expression(&class_expression, &TYPE_CLASS_DECLARATION) + } + StoredDefaultExportExpression::Function(function_expression) => self.convert_function( + &function_expression.function, + &TYPE_FUNCTION_DECLARATION, + function_expression.ident.as_ref(), + ), + } + // end + self.add_end(end_position, span); + } + + fn convert_literal_null(&mut self, literal: &Null) { + self.add_type_and_positions(&TYPE_LITERAL_NULL, &literal.span); + } + + fn convert_import_namespace_specifier( + &mut self, + import_namespace_specifier: &ImportStarAsSpecifier, + ) { + let end_position = self.add_type_and_start( + &TYPE_IMPORT_NAMESPACE_SPECIFIER, + &import_namespace_specifier.span, + ); + // local + self.convert_identifier(&import_namespace_specifier.local); + // end + self.add_end(end_position, &import_namespace_specifier.span); + } + + fn store_export_all_declaration( + &mut self, + span: &Span, + source: &Str, + attributes: &Option>, + exported: Option<&ModuleExportName>, + ) { + let end_position = self.add_type_and_start(&TYPE_EXPORT_ALL_DECLARATION, span); + // reserve exported, source, attributes + let reference_position = self.reserve_reference_positions(3); + // exported + exported.map(|exported| { + self.update_reference_position(reference_position); + self.convert_module_export_name(exported); + }); + // source + self.update_reference_position(reference_position + 4); + self.convert_literal_string(source); + // attributes + self.update_reference_position(reference_position + 8); + self.store_import_attributes(attributes); + // end + self.add_end(end_position, span); + } + + fn convert_binary_expression(&mut self, binary_expression: &BinExpr) { + let end_position = self.add_type_and_start( + match binary_expression.op { + BinaryOp::LogicalOr | BinaryOp::LogicalAnd | BinaryOp::NullishCoalescing => { + &TYPE_LOGICAL_EXPRESSION + } + _ => &TYPE_BINARY_EXPRESSION, + }, + &binary_expression.span, + ); + // operator + self.buffer.extend_from_slice(match binary_expression.op { + BinaryOp::EqEq => &STRING_EQEQ, + BinaryOp::NotEq => &STRING_NOTEQ, + BinaryOp::EqEqEq => &STRING_EQEQEQ, + BinaryOp::NotEqEq => &STRING_NOTEQEQ, + BinaryOp::Lt => &STRING_LT, + BinaryOp::LtEq => &STRING_LTEQ, + BinaryOp::Gt => &STRING_GT, + BinaryOp::GtEq => &STRING_GTEQ, + BinaryOp::LShift => &STRING_LSHIFT, + BinaryOp::RShift => &STRING_RSHIFT, + BinaryOp::ZeroFillRShift => &STRING_ZEROFILLRSHIFT, + BinaryOp::Add => &STRING_ADD, + BinaryOp::Sub => &STRING_SUB, + BinaryOp::Mul => &STRING_MUL, + BinaryOp::Div => &STRING_DIV, + BinaryOp::Mod => &STRING_MOD, + BinaryOp::BitOr => &STRING_BITOR, + BinaryOp::BitXor => &STRING_BITXOR, + BinaryOp::BitAnd => &STRING_BITAND, + BinaryOp::LogicalOr => &STRING_LOGICALOR, + BinaryOp::LogicalAnd => &STRING_LOGICALAND, + BinaryOp::In => &STRING_IN, + BinaryOp::InstanceOf => &STRING_INSTANCEOF, + BinaryOp::Exp => &STRING_EXP, + BinaryOp::NullishCoalescing => &STRING_NULLISHCOALESCING, + }); + // reserve right + let reference_position = self.reserve_reference_positions(1); + // left + self.convert_expression(&binary_expression.left); + // right + self.update_reference_position(reference_position); + self.convert_expression(&binary_expression.right); + // end + self.add_end(end_position, &binary_expression.span); + } + + fn convert_array_pattern(&mut self, array_pattern: &ArrayPat) { + let end_position = self.add_type_and_start(&TYPE_ARRAY_PATTERN, &array_pattern.span); + // elements + self.convert_item_list( + &array_pattern.elems, + |ast_converter, element| match element { + Some(element) => { + ast_converter.convert_pattern(element); + true + } + None => false, + }, + ); + // end + self.add_end(end_position, &array_pattern.span); + } + + fn convert_object_pattern(&mut self, object_pattern: &ObjectPat) { + let end_position = self.add_type_and_start(&TYPE_OBJECT_PATTERN, &object_pattern.span); + // properties + self.convert_item_list( + &object_pattern.props, + |ast_converter, object_pattern_property| { + ast_converter.convert_object_pattern_property(object_pattern_property); + true + }, + ); + // end + self.add_end(end_position, &object_pattern.span); + } + + fn convert_array_literal(&mut self, array_literal: &ArrayLit) { + let end_position = self.add_type_and_start(&TYPE_ARRAY_EXPRESSION, &array_literal.span); + // elements + self.convert_item_list( + &array_literal.elems, + |ast_converter, element| match element { + Some(element) => { + ast_converter.convert_expression_or_spread(element); + true + } + None => false, + }, + ); + // end + self.add_end(end_position, &array_literal.span); + } + + fn convert_conditional_expression(&mut self, conditional_expression: &CondExpr) { + let end_position = + self.add_type_and_start(&TYPE_CONDITIONAL_EXPRESSION, &conditional_expression.span); + // reserve consequent, alternate + let reference_position = self.reserve_reference_positions(2); + // test + self.convert_expression(&conditional_expression.test); + // consequent + self.update_reference_position(reference_position); + self.convert_expression(&conditional_expression.cons); + // alternate + self.update_reference_position(reference_position + 4); + self.convert_expression(&conditional_expression.alt); + // end + self.add_end(end_position, &conditional_expression.span); + } + + fn convert_function( + &mut self, + function: &Function, + node_type: &[u8; 4], + identifier: Option<&Ident>, + ) { + self.store_function_node( + node_type, + function.span.lo.0 - 1, + function.span.hi.0 - 1, + function.is_async, + function.is_generator, + identifier, + &function.params.iter().map(|param| ¶m.pat).collect(), + function.body.as_ref().unwrap(), + true, + ); + } + + fn convert_class_expression(&mut self, class_expression: &ClassExpr, node_type: &[u8; 4]) { + self.store_class_node( + node_type, + class_expression.ident.as_ref(), + &class_expression.class, + ); + } + + fn convert_class_declaration(&mut self, class_declaration: &ClassDecl) { + self.store_class_node( + &TYPE_CLASS_DECLARATION, + Some(&class_declaration.ident), + &class_declaration.class, + ); + } + + fn store_class_node(&mut self, node_type: &[u8; 4], identifier: Option<&Ident>, class: &Class) { + let end_position = self.add_type_and_start(node_type, &class.span); + // reserve id, super_class, body + let reference_position = self.reserve_reference_positions(3); + let mut body_start_search = class.span.lo.0 - 1; + // id + identifier.map(|identifier| { + self.update_reference_position(reference_position); + self.convert_identifier(identifier); + body_start_search = identifier.span.hi.0 - 1; + }); + // super_class + class.super_class.as_ref().map(|super_class| { + self.update_reference_position(reference_position + 4); + self.convert_expression(super_class); + body_start_search = self.get_expression_span(super_class).hi.0 - 1; + }); + // body + self.update_reference_position(reference_position + 8); + let class_body_start = + find_first_occurrence_outside_comment(self.code, b'{', body_start_search); + self.convert_class_body(&class.body, class_body_start, class.span.hi.0 - 1); + // end + self.add_end(end_position, &class.span); + } + + fn convert_class_body(&mut self, class_members: &Vec, start: u32, end: u32) { + let end_position = self.add_type_and_explicit_start(&TYPE_CLASS_BODY, start); + // body + self.convert_item_list(class_members, |ast_converter, class_member| { + ast_converter.convert_class_member(class_member); + true + }); + // end + self.add_explicit_end(end_position, end); + } + + fn convert_return_statement(&mut self, return_statement: &ReturnStmt) { + let end_position = self.add_type_and_start(&TYPE_RETURN_STATEMENT, &return_statement.span); + // reserve argument + let reference_position = self.reserve_reference_positions(1); + // argument + return_statement.arg.as_ref().map(|argument| { + self.update_reference_position(reference_position); + self.convert_expression(argument) + }); + // end + self.add_end(end_position, &return_statement.span); + } + + fn convert_import_attribute(&mut self, key_value_property: &KeyValueProp) { + // type + self.buffer.extend_from_slice(&TYPE_IMPORT_ATTRIBUTE); + // reserve start, end, value + let reference_position = self.reserve_reference_positions(3); + // key + let key_position = self.buffer.len(); + let key_boundaries = self.convert_property_name(&key_value_property.key); + let start_bytes: [u8; 4] = match key_boundaries { + Some((start, _)) => start.to_ne_bytes(), + None => { + let key_start: [u8; 4] = self.buffer[key_position + 4..key_position + 8] + .try_into() + .unwrap(); + key_start + } + }; + self.buffer[reference_position..reference_position + 4].copy_from_slice(&start_bytes); + // value + self.update_reference_position(reference_position + 8); + let value_position = self.buffer.len(); + let value_boundaries = self.convert_expression(&key_value_property.value); + let end_bytes: [u8; 4] = match value_boundaries { + Some((_, end)) => end.to_ne_bytes(), + None => { + let value_end: [u8; 4] = self.buffer[value_position + 8..value_position + 12] + .try_into() + .unwrap(); + value_end + } + }; + self.buffer[reference_position + 4..reference_position + 8].copy_from_slice(&end_bytes); + } + + fn convert_object_literal(&mut self, object_literal: &ObjectLit) { + let end_position = self.add_type_and_start(&TYPE_OBJECT_EXPRESSION, &object_literal.span); + // properties + self.convert_item_list( + &object_literal.props, + |ast_converter, property_or_spread| { + ast_converter.convert_property_or_spread(property_or_spread); + true + }, + ); + // end + self.add_end(end_position, &object_literal.span); + } + + fn convert_property_name(&mut self, property_name: &PropName) -> Option<(u32, u32)> { + match property_name { + PropName::Computed(computed_property_name) => { + self.convert_expression(computed_property_name.expr.as_ref()) + } + PropName::Ident(ident) => { + self.convert_identifier(ident); + None + } + PropName::Str(string) => { + self.convert_literal_string(&string); + None + } + PropName::Num(number) => { + self.convert_literal_number(&number); + None + } + PropName::BigInt(bigint) => { + self.convert_literal_bigint(&bigint); + None + } + } + } + + fn get_property_name_span(&self, property_name: &PropName) -> Span { + match property_name { + PropName::Computed(computed_property_name) => computed_property_name.span, + PropName::Ident(ident) => ident.span, + PropName::Str(string) => string.span, + PropName::Num(number) => number.span, + PropName::BigInt(bigint) => bigint.span, + } + } + + // TODO SWC property has many different formats that should be merged if possible + fn store_key_value_property(&mut self, property_name: &PropName, value: PatternOrExpression) { + let end_position = self.add_type_and_explicit_start( + &TYPE_PROPERTY, + self.get_property_name_span(property_name).lo.0 - 1, + ); + // kind + self.buffer.extend_from_slice(&STRING_INIT); + // method + self.convert_boolean(false); + // computed + self.convert_boolean(match property_name { + PropName::Computed(_) => true, + _ => false, + }); + // shorthand + self.convert_boolean(false); + // reserve key, value + let reference_position = self.reserve_reference_positions(2); + // key + self.update_reference_position(reference_position); + self.convert_property_name(property_name); + // value + self.update_reference_position(reference_position + 4); + let value_position = self.buffer.len(); + let value_boundaries = match value { + PatternOrExpression::Pattern(pattern) => self.convert_pattern(pattern), + PatternOrExpression::Expression(expression) => self.convert_expression(expression), + }; + // end + let end_bytes: [u8; 4] = match value_boundaries { + Some((_, end)) => end.to_ne_bytes(), + None => { + let value_end: [u8; 4] = self.buffer[value_position + 8..value_position + 12] + .try_into() + .unwrap(); + value_end + } + }; + // TODO SWC avoid copying positions around but use span getters instead + self.buffer[end_position..end_position + 4].copy_from_slice(&end_bytes); + } + + fn convert_key_value_property(&mut self, key_value_property: &KeyValueProp) { + self.store_key_value_property( + &key_value_property.key, + PatternOrExpression::Expression(&key_value_property.value), + ); + } + + fn convert_key_value_pattern_property(&mut self, key_value_pattern_property: &KeyValuePatProp) { + self.store_key_value_property( + &key_value_pattern_property.key, + PatternOrExpression::Pattern(&key_value_pattern_property.value), + ); + } + + // TODO SWC merge with method + fn store_getter_setter_property( + &mut self, + span: &Span, + kind: &[u8; 4], + key: &PropName, + body: &Option, + param: Option<&Pat>, + ) { + let end_position = self.add_type_and_start(&TYPE_PROPERTY, span); + // kind + self.buffer.extend_from_slice(kind); + // method + self.convert_boolean(false); + // computed + self.convert_boolean(match &key { + PropName::Computed(_) => true, + _ => false, + }); + // shorthand + self.convert_boolean(false); + // reserve key, value + let reference_position = self.reserve_reference_positions(2); + // key + self.update_reference_position(reference_position); + self.convert_property_name(key); + let key_end = self.get_property_name_span(&key).hi.0 - 1; + // value + let block_statement = body.as_ref().expect("Getter/setter property without body"); + self.update_reference_position(reference_position + 4); + let parameters = match param { + Some(pattern) => vec![pattern], + None => vec![], + }; + self.store_function_node( + &TYPE_FUNCTION_EXPRESSION, + find_first_occurrence_outside_comment(self.code, b'(', key_end), + block_statement.span.hi.0 - 1, + false, + false, + None, + ¶meters, + block_statement, + false, + ); + // end + self.add_end(end_position, span); + } + + fn convert_getter_property(&mut self, getter_property: &GetterProp) { + self.store_getter_setter_property( + &getter_property.span, + &STRING_GET, + &getter_property.key, + &getter_property.body, + None, + ); + } + + fn convert_setter_property(&mut self, setter_property: &SetterProp) { + self.store_getter_setter_property( + &setter_property.span, + &STRING_SET, + &setter_property.key, + &setter_property.body, + Some(&*setter_property.param), + ); + } + + fn convert_method_property(&mut self, method_property: &MethodProp) { + let end_position = self.add_type_and_start(&TYPE_PROPERTY, &method_property.function.span); + // kind + self.buffer.extend_from_slice(&STRING_INIT); + // method + self.convert_boolean(true); + // computed + self.convert_boolean(match &method_property.key { + PropName::Computed(_) => true, + _ => false, + }); + // shorthand + self.convert_boolean(false); + // reserve key, value + let reference_position = self.reserve_reference_positions(2); + // key + self.update_reference_position(reference_position); + self.convert_property_name(&method_property.key); + let key_end = self.get_property_name_span(&method_property.key).hi.0 - 1; + let function_start = find_first_occurrence_outside_comment(self.code, b'(', key_end); + // value + self.update_reference_position(reference_position + 4); + let function = &method_property.function; + self.store_function_node( + &TYPE_FUNCTION_EXPRESSION, + function_start, + function.span.hi.0 - 1, + function.is_async, + function.is_generator, + None, + &function.params.iter().map(|param| ¶m.pat).collect(), + function.body.as_ref().unwrap(), + false, + ); + // end + self.add_end(end_position, &method_property.function.span); + } + + fn store_shorthand_property( + &mut self, + span: &Span, + key: &Ident, + assignment_value: &Option>, + ) { + let end_position = self.add_type_and_start(&TYPE_PROPERTY, span); + // kind + self.buffer.extend_from_slice(&STRING_INIT); + // method + self.convert_boolean(false); + // computed + self.convert_boolean(false); + // shorthand + self.convert_boolean(true); + // reserve key, value + let reference_position = self.reserve_reference_positions(2); + // value + match assignment_value { + Some(value) => { + // value + self.update_reference_position(reference_position + 4); + let left_position = self.store_assignment_pattern_and_get_left_position( + span, + PatternOrIdentifier::Identifier(key), + value, + ); + // key, reuse identifier to avoid converting positions out of order + self.buffer[reference_position..reference_position + 4] + .copy_from_slice(&left_position.to_ne_bytes()); + } + None => { + // key + self.update_reference_position(reference_position); + self.convert_identifier(key); + } + } + // end + self.add_end(end_position, span); + } + + fn convert_shorthand_property(&mut self, identifier: &Ident) { + self.store_shorthand_property(&identifier.span, identifier, &None); + } + + fn convert_assignment_pattern_property(&mut self, assignment_pattern_property: &AssignPatProp) { + self.store_shorthand_property( + &assignment_pattern_property.span, + &assignment_pattern_property.key, + &assignment_pattern_property.value, + ); + } + + fn convert_assignment_expression(&mut self, assignment_expression: &AssignExpr) { + let end_position = + self.add_type_and_start(&TYPE_ASSIGNMENT_EXPRESSION, &assignment_expression.span); + // operator + self + .buffer + .extend_from_slice(match assignment_expression.op { + AssignOp::Assign => &STRING_ASSIGN, + AssignOp::AddAssign => &STRING_ADDASSIGN, + AssignOp::SubAssign => &STRING_SUBASSIGN, + AssignOp::MulAssign => &STRING_MULASSIGN, + AssignOp::DivAssign => &STRING_DIVASSIGN, + AssignOp::ModAssign => &STRING_MODASSIGN, + AssignOp::LShiftAssign => &STRING_LSHIFTASSIGN, + AssignOp::RShiftAssign => &STRING_RSHIFTASSIGN, + AssignOp::ZeroFillRShiftAssign => &STRING_ZEROFILLRSHIFTASSIGN, + AssignOp::BitOrAssign => &STRING_BITORASSIGN, + AssignOp::BitXorAssign => &STRING_BITXORASSIGN, + AssignOp::BitAndAssign => &STRING_BITANDASSIGN, + AssignOp::ExpAssign => &STRING_EXPASSIGN, + AssignOp::AndAssign => &STRING_ANDASSIGN, + AssignOp::OrAssign => &STRING_ORASSIGN, + AssignOp::NullishAssign => &STRING_NULLISHASSIGN, + }); + // reserve right + let reference_position = self.reserve_reference_positions(1); + // left + self.convert_pattern_or_expression(&assignment_expression.left); + // right + self.update_reference_position(reference_position); + self.convert_expression(&assignment_expression.right); + // end + self.add_end(end_position, &assignment_expression.span); + } + + fn convert_new_expression(&mut self, new_expression: &NewExpr) { + let end_position = self.add_type_and_start(&TYPE_NEW_EXPRESSION, &new_expression.span); + let annotations = self + .index_converter + .take_collected_annotations(AnnotationKind::Pure); + // reserve for callee, args + let reference_position = self.reserve_reference_positions(2); + // annotations + self.convert_item_list(&annotations, |ast_converter, annotation| { + ast_converter.convert_annotation(annotation); + true + }); + // callee + self.update_reference_position(reference_position); + self.convert_expression(&new_expression.callee); + // args + if let Some(expressions_or_spread) = &new_expression.args { + self.update_reference_position(reference_position + 4); + self.convert_item_list( + &expressions_or_spread, + |ast_converter, expression_or_spread| { + ast_converter.convert_expression_or_spread(expression_or_spread); + true + }, + ); + } + // end + self.add_end(end_position, &new_expression.span); + } + + fn store_function_node( + &mut self, + node_type: &[u8; 4], + start: u32, + end: u32, + is_async: bool, + is_generator: bool, + identifier: Option<&Ident>, + parameters: &Vec<&Pat>, + body: &BlockStmt, + observe_annotations: bool, + ) { + let end_position = self.add_type_and_explicit_start(node_type, start); + // async + self.convert_boolean(is_async); + // generator + self.convert_boolean(is_generator); + // reserve id, params, body + let reference_position = self.reserve_reference_positions(3); + // annotations + if observe_annotations { + let annotations = self + .index_converter + .take_collected_annotations(AnnotationKind::NoSideEffects); + self.convert_item_list(&annotations, |ast_converter, annotation| { + ast_converter.convert_annotation(annotation); + true + }); + } else { + self.buffer.extend_from_slice(&0u32.to_ne_bytes()); + } + // id + identifier.map(|ident| { + self.update_reference_position(reference_position); + self.convert_identifier(ident); + }); + // params + self.update_reference_position(reference_position + 4); + self.convert_item_list(parameters, |ast_converter, param| { + ast_converter.convert_pattern(¶m); + true + }); + // body + self.update_reference_position(reference_position + 8); + self.convert_block_statement(body, true); + // end + self.add_explicit_end(end_position, end); + } + + fn convert_throw_statement(&mut self, throw_statement: &ThrowStmt) { + let end_position = self.add_type_and_start(&TYPE_THROW_STATEMENT, &throw_statement.span); + // argument + self.convert_expression(&throw_statement.arg); + // end + self.add_end(end_position, &throw_statement.span); + } + + fn convert_assignment_pattern(&mut self, assignment_pattern: &AssignPat) { + self.store_assignment_pattern_and_get_left_position( + &assignment_pattern.span, + PatternOrIdentifier::Pattern(&assignment_pattern.left), + &assignment_pattern.right, + ); + } + + fn store_assignment_pattern_and_get_left_position( + &mut self, + span: &Span, + left: PatternOrIdentifier, + right: &Expr, + ) -> u32 { + let end_position = self.add_type_and_start(&TYPE_ASSIGNMENT_PATTERN, span); + // reserve right + let reference_position = self.reserve_reference_positions(1); + // left + let left_position = (self.buffer.len() >> 2) as u32; + match left { + PatternOrIdentifier::Pattern(pattern) => { + self.convert_pattern(&pattern); + } + PatternOrIdentifier::Identifier(identifier) => self.convert_identifier(&identifier), + } + // right + self.update_reference_position(reference_position); + self.convert_expression(right); + // end + self.add_end(end_position, span); + left_position + } + + fn convert_await_expression(&mut self, await_expression: &AwaitExpr) { + let end_position = self.add_type_and_start(&TYPE_AWAIT_EXPRESSION, &await_expression.span); + // argument + self.convert_expression(&await_expression.arg); + // end + self.add_end(end_position, &await_expression.span); + } + + fn convert_labeled_statement(&mut self, labeled_statement: &LabeledStmt) { + let end_position = self.add_type_and_start(&TYPE_LABELED_STATEMENT, &labeled_statement.span); + // reserve body + let reference_position = self.reserve_reference_positions(1); + // label + self.convert_identifier(&labeled_statement.label); + // body + self.update_reference_position(reference_position); + self.convert_statement(&labeled_statement.body); + // end + self.add_end(end_position, &labeled_statement.span); + } + + fn convert_break_statement(&mut self, break_statement: &BreakStmt) { + let end_position = self.add_type_and_start(&TYPE_BREAK_STATEMENT, &break_statement.span); + // reserve label + let reference_position = self.reserve_reference_positions(1); + // label + break_statement.label.as_ref().map(|label| { + self.update_reference_position(reference_position); + self.convert_identifier(label); + }); + // end + self.add_end(end_position, &break_statement.span); + } + + fn convert_try_statement(&mut self, try_statement: &TryStmt) { + let end_position = self.add_type_and_start(&TYPE_TRY_STATEMENT, &try_statement.span); + // reserve handler, finalizer + let reference_position = self.reserve_reference_positions(2); + // block + self.convert_block_statement(&try_statement.block, false); + // handler + try_statement.handler.as_ref().map(|catch_clause| { + self.update_reference_position(reference_position); + self.convert_catch_clause(catch_clause); + }); + // finalizer + try_statement.finalizer.as_ref().map(|block_statement| { + self.update_reference_position(reference_position + 4); + self.convert_block_statement(block_statement, false); + }); + // end + self.add_end(end_position, &try_statement.span); + } + + fn convert_catch_clause(&mut self, catch_clause: &CatchClause) { + let end_position = self.add_type_and_start(&TYPE_CATCH_CLAUSE, &catch_clause.span); + // reserve param, body + let reference_position = self.reserve_reference_positions(2); + // param + catch_clause.param.as_ref().map(|pattern| { + self.update_reference_position(reference_position); + self.convert_pattern(pattern); + }); + // body + self.update_reference_position(reference_position + 4); + self.convert_block_statement(&catch_clause.body, false); + // end + self.add_end(end_position, &catch_clause.span); + } + + fn convert_optional_chain_expression( + &mut self, + optional_chain_expression: &OptChainExpr, + is_chained: bool, + ) { + if is_chained { + self.convert_optional_chain_base( + &optional_chain_expression.base, + optional_chain_expression.optional, + ); + } else { + let end_position = + self.add_type_and_start(&TYPE_CHAIN_EXPRESSION, &optional_chain_expression.span); + // expression + self.convert_optional_chain_base( + &optional_chain_expression.base, + optional_chain_expression.optional, + ); + // end + self.add_end(end_position, &optional_chain_expression.span); + } + } + + fn convert_while_statement(&mut self, while_statement: &WhileStmt) { + let end_position = self.add_type_and_start(&TYPE_WHILE_STATEMENT, &while_statement.span); + // reserve body + let reference_position = self.reserve_reference_positions(1); + // test + self.convert_expression(&while_statement.test); + // body + self.update_reference_position(reference_position); + self.convert_statement(&while_statement.body); + // end + self.add_end(end_position, &while_statement.span); + } + + fn convert_continue_statement(&mut self, continue_statement: &ContinueStmt) { + let end_position = self.add_type_and_start(&TYPE_CONTINUE_STATEMENT, &continue_statement.span); + // reserve label + let reference_position = self.reserve_reference_positions(1); + // label + continue_statement.label.as_ref().map(|label| { + self.update_reference_position(reference_position); + self.convert_identifier(label); + }); + // end + self.add_end(end_position, &continue_statement.span); + } + + fn convert_do_while_statement(&mut self, do_while_statement: &DoWhileStmt) { + let end_position = self.add_type_and_start(&TYPE_DO_WHILE_STATEMENT, &do_while_statement.span); + // reserve test + let reference_position = self.reserve_reference_positions(1); + // body + self.convert_statement(&do_while_statement.body); + // test + self.update_reference_position(reference_position); + self.convert_expression(&do_while_statement.test); + // end + self.add_end(end_position, &do_while_statement.span); + } + + fn convert_debugger_statement(&mut self, debugger_statement: &DebuggerStmt) { + self.add_type_and_positions(&TYPE_DEBUGGER_STATEMENT, &debugger_statement.span); + } + + fn convert_empty_statement(&mut self, empty_statement: &EmptyStmt) { + self.add_type_and_positions(&TYPE_EMPTY_STATEMENT, &empty_statement.span); + } + + fn convert_for_in_statement(&mut self, for_in_statement: &ForInStmt) { + let end_position = self.add_type_and_start(&TYPE_FOR_IN_STATEMENT, &for_in_statement.span); + // reserve right, body + let reference_position = self.reserve_reference_positions(2); + // left + self.convert_for_head(&for_in_statement.left); + // right + self.update_reference_position(reference_position); + self.convert_expression(&for_in_statement.right); + // body + self.update_reference_position(reference_position + 4); + self.convert_statement(&for_in_statement.body); + // end + self.add_end(end_position, &for_in_statement.span); + } + + fn convert_for_of_statement(&mut self, for_of_statement: &ForOfStmt) { + let end_position = self.add_type_and_start(&TYPE_FOR_OF_STATEMENT, &for_of_statement.span); + // await + self.convert_boolean(for_of_statement.is_await); + // reserve right, body + let reference_position = self.reserve_reference_positions(2); + // left + self.convert_for_head(&for_of_statement.left); + // right + self.update_reference_position(reference_position); + self.convert_expression(&for_of_statement.right); + // body + self.update_reference_position(reference_position + 4); + self.convert_statement(&for_of_statement.body); + // end + self.add_end(end_position, &for_of_statement.span); + } + + fn convert_for_statement(&mut self, for_statement: &ForStmt) { + let end_position = self.add_type_and_start(&TYPE_FOR_STATEMENT, &for_statement.span); + // reserve init, test, update, body + let reference_position = self.reserve_reference_positions(4); + // init + for_statement.init.as_ref().map(|init| { + self.update_reference_position(reference_position); + self.convert_variable_declaration_or_expression(init); + }); + // test + for_statement.test.as_ref().map(|test| { + self.update_reference_position(reference_position + 4); + self.convert_expression(test); + }); + // update + for_statement.update.as_ref().map(|update| { + self.update_reference_position(reference_position + 8); + self.convert_expression(update); + }); + // body + self.update_reference_position(reference_position + 12); + self.convert_statement(&for_statement.body); + // end + self.add_end(end_position, &for_statement.span); + } + + fn convert_if_statement(&mut self, if_statement: &IfStmt) { + let end_position = self.add_type_and_start(&TYPE_IF_STATEMENT, &if_statement.span); + // reserve consequent, alternate + let reference_position = self.reserve_reference_positions(2); + // test + self.convert_expression(&if_statement.test); + // consequent + self.update_reference_position(reference_position); + self.convert_statement(&if_statement.cons); + // alternate + if_statement.alt.as_ref().map(|alt| { + self.update_reference_position(reference_position + 4); + self.convert_statement(alt); + }); + // end + self.add_end(end_position, &if_statement.span); + } + + fn convert_literal_regex(&mut self, regex: &Regex) { + self.add_type_and_positions(&TYPE_LITERAL_REGEXP, ®ex.span); + // reserve pattern + let reference_position = self.reserve_reference_positions(1); + // flags + self.convert_string(®ex.flags); + // pattern + self.update_reference_position(reference_position); + self.convert_string(®ex.exp); + } + + fn convert_literal_bigint(&mut self, bigint: &BigInt) { + self.add_type_and_positions(&TYPE_LITERAL_BIGINT, &bigint.span); + // reserve value + let reference_position = self.reserve_reference_positions(1); + // raw + self.convert_string(bigint.raw.as_ref().unwrap()); + // value + self.update_reference_position(reference_position); + self.convert_string(&bigint.value.to_str_radix(10)); + } + + fn convert_meta_property(&mut self, meta_property_expression: &MetaPropExpr) { + let end_position = self.add_type_and_start(&TYPE_META_PROPERTY, &meta_property_expression.span); + // reserve property + let reference_position = self.reserve_reference_positions(1); + match meta_property_expression.kind { + MetaPropKind::ImportMeta => { + // meta + self.store_identifier( + meta_property_expression.span.lo.0 - 1, + meta_property_expression.span.lo.0 + 5, + "import", + ); + // property + self.update_reference_position(reference_position); + self.store_identifier( + meta_property_expression.span.hi.0 - 5, + meta_property_expression.span.hi.0 - 1, + "meta", + ); + } + MetaPropKind::NewTarget => { + // meta + self.store_identifier( + meta_property_expression.span.lo.0 - 1, + meta_property_expression.span.lo.0 + 2, + "new", + ); + // property + self.update_reference_position(reference_position); + self.store_identifier( + meta_property_expression.span.hi.0 - 7, + meta_property_expression.span.hi.0 - 1, + "target", + ); + } + } + // end + self.add_end(end_position, &meta_property_expression.span); + } + + fn convert_constructor(&mut self, constructor: &Constructor) { + let end_position = self.add_type_and_start(&TYPE_METHOD_DEFINITION, &constructor.span); + // kind + self.buffer.extend_from_slice(&STRING_CONSTRUCTOR); + // computed + self.convert_boolean(false); + // static + self.convert_boolean(false); + // reserve value + let reference_position = self.reserve_reference_positions(1); + // key + self.convert_property_name(&constructor.key); + // value + match &constructor.body { + Some(block_statement) => { + self.update_reference_position(reference_position); + let key_end = self.get_property_name_span(&constructor.key).hi.0 - 1; + let function_start = find_first_occurrence_outside_comment(self.code, b'(', key_end); + self.store_function_node( + &TYPE_FUNCTION_EXPRESSION, + function_start, + block_statement.span.hi.0 - 1, + false, + false, + None, + &constructor + .params + .iter() + .map(|param| match param { + ParamOrTsParamProp::Param(param) => ¶m.pat, + ParamOrTsParamProp::TsParamProp(_) => panic!("TsParamProp in constructor"), + }) + .collect(), + block_statement, + false, + ); + } + None => { + panic!("Getter property without body"); + } + } + // end + self.add_end(end_position, &constructor.span); + } + + fn convert_method(&mut self, method: &ClassMethod) { + self.store_method_definition( + &method.span, + &method.kind, + method.is_static, + PropOrPrivateName::PropName(&method.key), + match method.key { + PropName::Computed(_) => true, + _ => false, + }, + &method.function, + ); + } + + fn convert_private_method(&mut self, private_method: &PrivateMethod) { + self.store_method_definition( + &private_method.span, + &private_method.kind, + private_method.is_static, + PropOrPrivateName::PrivateName(&private_method.key), + false, + &private_method.function, + ); + } + + fn store_method_definition( + &mut self, + span: &Span, + kind: &MethodKind, + is_static: bool, + key: PropOrPrivateName, + is_computed: bool, + function: &Function, + ) { + let end_position = self.add_type_and_start(&TYPE_METHOD_DEFINITION, span); + // kind + self.buffer.extend_from_slice(match kind { + MethodKind::Method => &STRING_METHOD, + MethodKind::Getter => &STRING_GET, + MethodKind::Setter => &STRING_SET, + }); + // computed + self.convert_boolean(is_computed); + // static + self.convert_boolean(is_static); + // reserve value + let reference_position = self.reserve_reference_positions(1); + // key + let key_end = match key { + PropOrPrivateName::PropName(prop_name) => { + self.convert_property_name(&prop_name); + self.get_property_name_span(&prop_name).hi.0 - 1 + } + PropOrPrivateName::PrivateName(private_name) => { + self.convert_private_name(&private_name); + private_name.id.span.hi.0 - 1 + } + }; + let function_start = find_first_occurrence_outside_comment(self.code, b'(', key_end); + // value + self.update_reference_position(reference_position); + self.store_function_node( + &TYPE_FUNCTION_EXPRESSION, + function_start, + function.span.hi.0 - 1, + function.is_async, + function.is_generator, + None, + &function.params.iter().map(|param| ¶m.pat).collect(), + function.body.as_ref().unwrap(), + false, + ); + // end + self.add_end(end_position, span); + } + + fn store_property_definition( + &mut self, + span: &Span, + is_computed: bool, + is_static: bool, + key: PropOrPrivateName, + value: &Option<&Expr>, + ) { + let end_position = self.add_type_and_start(&TYPE_PROPERTY_DEFINITION, span); + // computed + self.convert_boolean(is_computed); + // static + self.convert_boolean(is_static); + // reserve value + let reference_position = self.reserve_reference_positions(1); + // key + match key { + PropOrPrivateName::PropName(prop_name) => { + self.convert_property_name(&prop_name); + } + PropOrPrivateName::PrivateName(private_name) => self.convert_private_name(&private_name), + } + // value + value.map(|expression| { + self.update_reference_position(reference_position); + self.convert_expression(expression); + }); + // end + self.add_end(end_position, span); + } + + fn convert_class_property(&mut self, class_property: &ClassProp) { + self.store_property_definition( + &class_property.span, + match &class_property.key { + PropName::Computed(_) => true, + _ => false, + }, + class_property.is_static, + PropOrPrivateName::PropName(&class_property.key), + &class_property + .value + .as_ref() + .map(|expression| &**expression), + ); + } + + fn convert_private_property(&mut self, private_property: &PrivateProp) { + self.store_property_definition( + &private_property.span, + false, + private_property.is_static, + PropOrPrivateName::PrivateName(&private_property.key), + &private_property + .value + .as_ref() + .map(|expression| &**expression), + ); + } + + fn convert_this_expression(&mut self, this_expression: &ThisExpr) { + self.add_type_and_positions(&TYPE_THIS_EXPRESSION, &this_expression.span); + } + + fn convert_static_block(&mut self, static_block: &StaticBlock) { + let end_position = self.add_type_and_start(&TYPE_STATIC_BLOCK, &static_block.span); + // body + self.convert_item_list(&static_block.body.stmts, |ast_converter, statement| { + ast_converter.convert_statement(statement); + true + }); + // end + self.add_end(end_position, &static_block.span); + } + + fn convert_super_property(&mut self, super_property: &SuperPropExpr) { + self.store_member_expression( + &super_property.span, + false, + &ExpressionOrSuper::Super(&super_property.obj), + match &super_property.prop { + SuperProp::Ident(identifier) => MemberOrSuperProp::Identifier(&identifier), + SuperProp::Computed(computed_property_name) => { + MemberOrSuperProp::Computed(&computed_property_name) + } + }, + false, + ); + } + + fn convert_super(&mut self, super_token: &Super) { + self.add_type_and_positions(&TYPE_SUPER, &super_token.span); + } + + fn convert_rest_pattern(&mut self, rest_pattern: &RestPat) { + let end_position = + self.add_type_and_explicit_start(&TYPE_REST_ELEMENT, rest_pattern.dot3_token.lo.0 - 1); + // argument + self.convert_pattern(&rest_pattern.arg); + // end + self.add_explicit_end(end_position, rest_pattern.span.hi.0 - 1); + } + + fn convert_sequence_expression(&mut self, sequence_expression: &SeqExpr) { + let end_position = + self.add_type_and_start(&TYPE_SEQUENCE_EXPRESSION, &sequence_expression.span); + // expressions + self.convert_item_list(&sequence_expression.exprs, |ast_converter, expression| { + ast_converter.convert_expression(expression); + true + }); + // end + self.add_end(end_position, &sequence_expression.span); + } + + fn convert_switch_statement(&mut self, switch_statement: &SwitchStmt) { + let end_position = self.add_type_and_start(&TYPE_SWITCH_STATEMENT, &switch_statement.span); + // reserve cases + let reference_position = self.reserve_reference_positions(1); + // discriminant + self.convert_expression(&switch_statement.discriminant); + // cases + self.update_reference_position(reference_position); + self.convert_item_list(&switch_statement.cases, |ast_converter, switch_case| { + ast_converter.convert_switch_case(switch_case); + true + }); + // end + self.add_end(end_position, &switch_statement.span); + } + + fn convert_switch_case(&mut self, switch_case: &SwitchCase) { + let end_position = self.add_type_and_start(&TYPE_SWITCH_CASE, &switch_case.span); + // reserve test, consequent + let reference_position = self.reserve_reference_positions(2); + // test + switch_case.test.as_ref().map(|expression| { + self.update_reference_position(reference_position); + self.convert_expression(expression) + }); + // consequent + self.update_reference_position(reference_position + 4); + self.convert_item_list(&switch_case.cons, |ast_converter, statement| { + ast_converter.convert_statement(statement); + true + }); + // end + self.add_end(end_position, &switch_case.span); + } + + fn convert_tagged_template_expression(&mut self, tagged_template: &TaggedTpl) { + let end_position = + self.add_type_and_start(&TYPE_TAGGED_TEMPLATE_EXPRESSION, &tagged_template.span); + // reserve quasi + let reference_position = self.reserve_reference_positions(1); + // tag + self.convert_expression(&tagged_template.tag); + // quasi + self.update_reference_position(reference_position); + self.convert_template_literal(&tagged_template.tpl); + // end + self.add_end(end_position, &tagged_template.span); + } + + fn convert_template_literal(&mut self, template_literal: &Tpl) { + let end_position = self.add_type_and_start(&TYPE_TEMPLATE_LITERAL, &template_literal.span); + // reserve expressions + let reference_position = self.reserve_reference_positions(1); + // quasis, we manually do an item list here + self + .buffer + .extend_from_slice(&(template_literal.quasis.len() as u32).to_ne_bytes()); + let mut next_quasi_position = self.buffer.len(); + // make room for the positions of the quasis + self + .buffer + .resize(self.buffer.len() + template_literal.quasis.len() * 4, 0); + let mut quasis = template_literal.quasis.iter(); + // convert first quasi + let first_quasi = quasis.next().unwrap(); + let insert_position = (self.buffer.len() as u32) >> 2; + self.convert_template_element(first_quasi); + self.buffer[next_quasi_position..next_quasi_position + 4] + .copy_from_slice(&insert_position.to_ne_bytes()); + next_quasi_position += 4; + // now convert expressions, interleaved with quasis + self.update_reference_position(reference_position); + self + .buffer + .extend_from_slice(&(template_literal.exprs.len() as u32).to_ne_bytes()); + let mut next_expression_position = self.buffer.len(); + // make room for the positions of the expressions + self + .buffer + .resize(self.buffer.len() + template_literal.exprs.len() * 4, 0); + for expression in template_literal.exprs.as_slice() { + // convert expression + let insert_position = (self.buffer.len() as u32) >> 2; + self.convert_expression(&expression); + self.buffer[next_expression_position..next_expression_position + 4] + .copy_from_slice(&insert_position.to_ne_bytes()); + next_expression_position += 4; + // convert next quasi + let next_quasi = quasis.next().unwrap(); + let insert_position = (self.buffer.len() as u32) >> 2; + self.convert_template_element(next_quasi); + self.buffer[next_quasi_position..next_quasi_position + 4] + .copy_from_slice(&insert_position.to_ne_bytes()); + next_quasi_position += 4; + } + // end + self.add_end(end_position, &template_literal.span); + } + + fn convert_template_element(&mut self, template_element: &TplElement) { + self.add_type_and_positions(&TYPE_TEMPLATE_ELEMENT, &template_element.span); + // tail + self.convert_boolean(template_element.tail); + // reserve cooked + let reference_position = self.reserve_reference_positions(1); + // raw + self.convert_string(&template_element.raw); + // cooked + template_element.cooked.as_ref().map(|cooked| { + self.update_reference_position(reference_position); + self.convert_string(cooked) + }); + } + + fn convert_unary_expression(&mut self, unary_expression: &UnaryExpr) { + let end_position = self.add_type_and_start(&TYPE_UNARY_EXPRESSION, &unary_expression.span); + // operator + self.buffer.extend_from_slice(match unary_expression.op { + UnaryOp::Minus => &STRING_MINUS, + UnaryOp::Plus => &STRING_PLUS, + UnaryOp::Bang => &STRING_BANG, + UnaryOp::Tilde => &STRING_TILDE, + UnaryOp::TypeOf => &STRING_TYPEOF, + UnaryOp::Void => &STRING_VOID, + UnaryOp::Delete => &STRING_DELETE, + }); + // argument + self.convert_expression(&unary_expression.arg); + // end + self.add_end(end_position, &unary_expression.span); + } + + fn convert_update_expression(&mut self, update_expression: &UpdateExpr) { + let end_position = self.add_type_and_start(&TYPE_UPDATE_EXPRESSION, &update_expression.span); + // prefix + self.convert_boolean(update_expression.prefix); + // operator + self.buffer.extend_from_slice(match update_expression.op { + UpdateOp::PlusPlus => &STRING_PLUSPLUS, + UpdateOp::MinusMinus => &STRING_MINUSMINUS, + }); + // argument + self.convert_expression(&update_expression.arg); + // end + self.add_end(end_position, &update_expression.span); + } + + fn convert_yield_expression(&mut self, yield_expression: &YieldExpr) { + let end_position = self.add_type_and_start(&TYPE_YIELD_EXPRESSION, &yield_expression.span); + // delegate + self.convert_boolean(yield_expression.delegate); + // reserve argument + let reference_position = self.reserve_reference_positions(1); + // argument + yield_expression.arg.as_ref().map(|expression| { + self.update_reference_position(reference_position); + self.convert_expression(expression) + }); + // end + self.add_end(end_position, &yield_expression.span); + } + + fn convert_annotation(&mut self, annotation: &ConvertedAnnotation) { + // start + self + .buffer + .extend_from_slice(&annotation.start.to_ne_bytes()); + // end + self.buffer.extend_from_slice(&annotation.end.to_ne_bytes()); + // kind + self.buffer.extend_from_slice(match annotation.kind { + AnnotationKind::Pure => &STRING_PURE, + AnnotationKind::NoSideEffects => &STRING_NOSIDEEFFECTS, + AnnotationKind::SourceMappingUrl => &STRING_SOURCEMAP, + }); + } +} + +pub fn convert_string(buffer: &mut Vec, string: &str) { + let length = string.len(); + let additional_length = ((length + 3) & !3) - length; + buffer.extend_from_slice(&(length as u32).to_ne_bytes()); + buffer.extend_from_slice(string.as_bytes()); + buffer.resize(buffer.len() + additional_length, 0); +} + +enum StoredCallee<'a> { + Expression(&'a Expr), + Super(&'a Super), +} + +enum StoredDefaultExportExpression<'a> { + Expression(&'a Expr), + Class(&'a ClassExpr), + Function(&'a FnExpr), +} + +enum PropOrPrivateName<'a> { + PropName(&'a PropName), + PrivateName(&'a PrivateName), +} + +enum ExpressionOrSuper<'a> { + Expression(&'a Expr), + Super(&'a Super), +} + +enum MemberOrSuperProp<'a> { + Identifier(&'a Ident), + PrivateName(&'a PrivateName), + Computed(&'a ComputedPropName), +} + +enum PatternOrIdentifier<'a> { + Pattern(&'a Pat), + Identifier(&'a Ident), +} + +enum PatternOrExpression<'a> { + Pattern(&'a Pat), + Expression(&'a Expr), +} + +enum ModuleItemsOrStatements<'a> { + ModuleItems(&'a Vec), + Statements(&'a Vec), +} diff --git a/rust/parse_ast/src/convert_ast/converter/analyze_code.rs b/rust/parse_ast/src/convert_ast/converter/analyze_code.rs new file mode 100644 index 000000000..d2fb985df --- /dev/null +++ b/rust/parse_ast/src/convert_ast/converter/analyze_code.rs @@ -0,0 +1,40 @@ +pub fn find_first_occurrence_outside_comment(code: &[u8], search_byte: u8, start: u32) -> u32 { + let mut search_pos = start as usize; + let mut comment_type = CommentType::None; + loop { + match comment_type { + CommentType::SingleLine => { + if code[search_pos] == b'\n' { + comment_type = CommentType::None; + } + } + CommentType::MultiLine => { + if code[search_pos] == b'*' && code[search_pos + 1] == b'/' { + comment_type = CommentType::None; + search_pos += 1; + } + } + CommentType::None => { + if code[search_pos] == b'/' && code[search_pos + 1] == b'/' { + comment_type = CommentType::SingleLine; + search_pos += 1; + } else if code[search_pos] == b'/' && code[search_pos + 1] == b'*' { + comment_type = CommentType::MultiLine; + search_pos += 1; + } else if code[search_pos] == search_byte { + return search_pos as u32; + } + } + } + search_pos += 1; + if search_pos >= code.len() { + return code.len().try_into().unwrap(); + } + } +} + +enum CommentType { + SingleLine, + MultiLine, + None, +} diff --git a/rust/parse_ast/src/convert_ast/converter/node_types.rs b/rust/parse_ast/src/convert_ast/converter/node_types.rs new file mode 100644 index 000000000..0a26646ee --- /dev/null +++ b/rust/parse_ast/src/convert_ast/converter/node_types.rs @@ -0,0 +1,78 @@ +// These need to reflect the order in the JavaScript decoder +pub const TYPE_ARRAY_EXPRESSION: [u8; 4] = 0u32.to_ne_bytes(); +pub const TYPE_ARRAY_PATTERN: [u8; 4] = 1u32.to_ne_bytes(); +pub const TYPE_ARROW_FUNCTION_EXPRESSION: [u8; 4] = 2u32.to_ne_bytes(); +pub const TYPE_ASSIGNMENT_EXPRESSION: [u8; 4] = 3u32.to_ne_bytes(); +pub const TYPE_ASSIGNMENT_PATTERN: [u8; 4] = 4u32.to_ne_bytes(); +pub const TYPE_AWAIT_EXPRESSION: [u8; 4] = 5u32.to_ne_bytes(); +pub const TYPE_BINARY_EXPRESSION: [u8; 4] = 6u32.to_ne_bytes(); +pub const TYPE_BLOCK_STATEMENT: [u8; 4] = 7u32.to_ne_bytes(); +pub const TYPE_BREAK_STATEMENT: [u8; 4] = 8u32.to_ne_bytes(); +pub const TYPE_CALL_EXPRESSION: [u8; 4] = 9u32.to_ne_bytes(); +pub const TYPE_CATCH_CLAUSE: [u8; 4] = 10u32.to_ne_bytes(); +pub const TYPE_CHAIN_EXPRESSION: [u8; 4] = 11u32.to_ne_bytes(); +pub const TYPE_CLASS_BODY: [u8; 4] = 12u32.to_ne_bytes(); +pub const TYPE_CLASS_DECLARATION: [u8; 4] = 13u32.to_ne_bytes(); +pub const TYPE_CLASS_EXPRESSION: [u8; 4] = 14u32.to_ne_bytes(); +pub const TYPE_CONDITIONAL_EXPRESSION: [u8; 4] = 15u32.to_ne_bytes(); +pub const TYPE_CONTINUE_STATEMENT: [u8; 4] = 16u32.to_ne_bytes(); +pub const TYPE_DEBUGGER_STATEMENT: [u8; 4] = 17u32.to_ne_bytes(); +pub const TYPE_DO_WHILE_STATEMENT: [u8; 4] = 18u32.to_ne_bytes(); +pub const TYPE_EMPTY_STATEMENT: [u8; 4] = 19u32.to_ne_bytes(); +pub const TYPE_EXPORT_ALL_DECLARATION: [u8; 4] = 20u32.to_ne_bytes(); +pub const TYPE_EXPORT_DEFAULT_DECLARATION: [u8; 4] = 21u32.to_ne_bytes(); +pub const TYPE_EXPORT_NAMED_DECLARATION: [u8; 4] = 22u32.to_ne_bytes(); +pub const TYPE_EXPORT_SPECIFIER: [u8; 4] = 23u32.to_ne_bytes(); +pub const TYPE_EXPRESSION_STATEMENT: [u8; 4] = 24u32.to_ne_bytes(); +pub const TYPE_FOR_IN_STATEMENT: [u8; 4] = 25u32.to_ne_bytes(); +pub const TYPE_FOR_OF_STATEMENT: [u8; 4] = 26u32.to_ne_bytes(); +pub const TYPE_FOR_STATEMENT: [u8; 4] = 27u32.to_ne_bytes(); +pub const TYPE_FUNCTION_DECLARATION: [u8; 4] = 28u32.to_ne_bytes(); +pub const TYPE_FUNCTION_EXPRESSION: [u8; 4] = 29u32.to_ne_bytes(); +pub const TYPE_IDENTIFIER: [u8; 4] = 30u32.to_ne_bytes(); +pub const TYPE_IF_STATEMENT: [u8; 4] = 31u32.to_ne_bytes(); +pub const TYPE_IMPORT_ATTRIBUTE: [u8; 4] = 32u32.to_ne_bytes(); +pub const TYPE_IMPORT_DECLARATION: [u8; 4] = 33u32.to_ne_bytes(); +pub const TYPE_IMPORT_DEFAULT_SPECIFIER: [u8; 4] = 34u32.to_ne_bytes(); +pub const TYPE_IMPORT_EXPRESSION: [u8; 4] = 35u32.to_ne_bytes(); +pub const TYPE_IMPORT_NAMESPACE_SPECIFIER: [u8; 4] = 36u32.to_ne_bytes(); +pub const TYPE_IMPORT_SPECIFIER: [u8; 4] = 37u32.to_ne_bytes(); +pub const TYPE_LABELED_STATEMENT: [u8; 4] = 38u32.to_ne_bytes(); +pub const TYPE_LITERAL_STRING: [u8; 4] = 39u32.to_ne_bytes(); +pub const TYPE_LITERAL_BOOLEAN: [u8; 4] = 40u32.to_ne_bytes(); +pub const TYPE_LITERAL_NUMBER: [u8; 4] = 41u32.to_ne_bytes(); +pub const TYPE_LITERAL_NULL: [u8; 4] = 42u32.to_ne_bytes(); +pub const TYPE_LITERAL_REGEXP: [u8; 4] = 43u32.to_ne_bytes(); +pub const TYPE_LITERAL_BIGINT: [u8; 4] = 44u32.to_ne_bytes(); +pub const TYPE_LOGICAL_EXPRESSION: [u8; 4] = 45u32.to_ne_bytes(); +pub const TYPE_MEMBER_EXPRESSION: [u8; 4] = 46u32.to_ne_bytes(); +pub const TYPE_META_PROPERTY: [u8; 4] = 47u32.to_ne_bytes(); +pub const TYPE_METHOD_DEFINITION: [u8; 4] = 48u32.to_ne_bytes(); +pub const TYPE_NEW_EXPRESSION: [u8; 4] = 49u32.to_ne_bytes(); +pub const TYPE_OBJECT_EXPRESSION: [u8; 4] = 50u32.to_ne_bytes(); +pub const TYPE_OBJECT_PATTERN: [u8; 4] = 51u32.to_ne_bytes(); +pub const TYPE_PRIVATE_IDENTIFIER: [u8; 4] = 52u32.to_ne_bytes(); +pub const TYPE_PROGRAM: [u8; 4] = 53u32.to_ne_bytes(); +pub const TYPE_PROPERTY: [u8; 4] = 54u32.to_ne_bytes(); +pub const TYPE_PROPERTY_DEFINITION: [u8; 4] = 55u32.to_ne_bytes(); +pub const TYPE_REST_ELEMENT: [u8; 4] = 56u32.to_ne_bytes(); +pub const TYPE_RETURN_STATEMENT: [u8; 4] = 57u32.to_ne_bytes(); +pub const TYPE_SEQUENCE_EXPRESSION: [u8; 4] = 58u32.to_ne_bytes(); +pub const TYPE_SPREAD_ELEMENT: [u8; 4] = 59u32.to_ne_bytes(); +pub const TYPE_STATIC_BLOCK: [u8; 4] = 60u32.to_ne_bytes(); +pub const TYPE_SUPER: [u8; 4] = 61u32.to_ne_bytes(); +pub const TYPE_SWITCH_CASE: [u8; 4] = 62u32.to_ne_bytes(); +pub const TYPE_SWITCH_STATEMENT: [u8; 4] = 63u32.to_ne_bytes(); +pub const TYPE_TAGGED_TEMPLATE_EXPRESSION: [u8; 4] = 64u32.to_ne_bytes(); +pub const TYPE_TEMPLATE_ELEMENT: [u8; 4] = 65u32.to_ne_bytes(); +pub const TYPE_TEMPLATE_LITERAL: [u8; 4] = 66u32.to_ne_bytes(); +pub const TYPE_THIS_EXPRESSION: [u8; 4] = 67u32.to_ne_bytes(); +pub const TYPE_THROW_STATEMENT: [u8; 4] = 68u32.to_ne_bytes(); +pub const TYPE_TRY_STATEMENT: [u8; 4] = 69u32.to_ne_bytes(); +pub const TYPE_UNARY_EXPRESSION: [u8; 4] = 70u32.to_ne_bytes(); +pub const TYPE_UPDATE_EXPRESSION: [u8; 4] = 71u32.to_ne_bytes(); +pub const TYPE_VARIABLE_DECLARATION: [u8; 4] = 72u32.to_ne_bytes(); +pub const TYPE_VARIABLE_DECLARATOR: [u8; 4] = 73u32.to_ne_bytes(); +pub const TYPE_WHILE_STATEMENT: [u8; 4] = 74u32.to_ne_bytes(); +pub const TYPE_YIELD_EXPRESSION: [u8; 4] = 75u32.to_ne_bytes(); +pub const TYPE_PARSE_ERROR: [u8; 4] = 76u32.to_ne_bytes(); diff --git a/rust/parse_ast/src/convert_ast/converter/string_constants.rs b/rust/parse_ast/src/convert_ast/converter/string_constants.rs new file mode 100644 index 000000000..5163c0242 --- /dev/null +++ b/rust/parse_ast/src/convert_ast/converter/string_constants.rs @@ -0,0 +1,62 @@ +// These need to correspond to the positions in convert-ast-strings.ts +pub const STRING_VAR: [u8; 4] = 0u32.to_ne_bytes(); // var +pub const STRING_LET: [u8; 4] = 1u32.to_ne_bytes(); // let +pub const STRING_CONST: [u8; 4] = 2u32.to_ne_bytes(); // const +pub const STRING_INIT: [u8; 4] = 3u32.to_ne_bytes(); // init +pub const STRING_GET: [u8; 4] = 4u32.to_ne_bytes(); // get +pub const STRING_SET: [u8; 4] = 5u32.to_ne_bytes(); // set +pub const STRING_CONSTRUCTOR: [u8; 4] = 6u32.to_ne_bytes(); // constructor +pub const STRING_METHOD: [u8; 4] = 7u32.to_ne_bytes(); // method +pub const STRING_MINUS: [u8; 4] = 8u32.to_ne_bytes(); // - +pub const STRING_PLUS: [u8; 4] = 9u32.to_ne_bytes(); // + +pub const STRING_BANG: [u8; 4] = 10u32.to_ne_bytes(); // ! +pub const STRING_TILDE: [u8; 4] = 11u32.to_ne_bytes(); // ~ +pub const STRING_TYPEOF: [u8; 4] = 12u32.to_ne_bytes(); // typeof +pub const STRING_VOID: [u8; 4] = 13u32.to_ne_bytes(); // void +pub const STRING_DELETE: [u8; 4] = 14u32.to_ne_bytes(); // delete +pub const STRING_PLUSPLUS: [u8; 4] = 15u32.to_ne_bytes(); // ++ +pub const STRING_MINUSMINUS: [u8; 4] = 16u32.to_ne_bytes(); // -- +pub const STRING_EQEQ: [u8; 4] = 17u32.to_ne_bytes(); // == +pub const STRING_NOTEQ: [u8; 4] = 18u32.to_ne_bytes(); // != +pub const STRING_EQEQEQ: [u8; 4] = 19u32.to_ne_bytes(); // === +pub const STRING_NOTEQEQ: [u8; 4] = 20u32.to_ne_bytes(); // !== +pub const STRING_LT: [u8; 4] = 21u32.to_ne_bytes(); // < +pub const STRING_LTEQ: [u8; 4] = 22u32.to_ne_bytes(); // <= +pub const STRING_GT: [u8; 4] = 23u32.to_ne_bytes(); // > +pub const STRING_GTEQ: [u8; 4] = 24u32.to_ne_bytes(); // >= +pub const STRING_LSHIFT: [u8; 4] = 25u32.to_ne_bytes(); // << +pub const STRING_RSHIFT: [u8; 4] = 26u32.to_ne_bytes(); // >> +pub const STRING_ZEROFILLRSHIFT: [u8; 4] = 27u32.to_ne_bytes(); // >>> +pub const STRING_ADD: [u8; 4] = 28u32.to_ne_bytes(); // + +pub const STRING_SUB: [u8; 4] = 29u32.to_ne_bytes(); // - +pub const STRING_MUL: [u8; 4] = 30u32.to_ne_bytes(); // * +pub const STRING_DIV: [u8; 4] = 31u32.to_ne_bytes(); // / +pub const STRING_MOD: [u8; 4] = 32u32.to_ne_bytes(); // % +pub const STRING_BITOR: [u8; 4] = 33u32.to_ne_bytes(); // | +pub const STRING_BITXOR: [u8; 4] = 34u32.to_ne_bytes(); // ^ +pub const STRING_BITAND: [u8; 4] = 35u32.to_ne_bytes(); // & +pub const STRING_LOGICALOR: [u8; 4] = 36u32.to_ne_bytes(); // || +pub const STRING_LOGICALAND: [u8; 4] = 37u32.to_ne_bytes(); // && +pub const STRING_IN: [u8; 4] = 38u32.to_ne_bytes(); // in +pub const STRING_INSTANCEOF: [u8; 4] = 39u32.to_ne_bytes(); // instanceof +pub const STRING_EXP: [u8; 4] = 40u32.to_ne_bytes(); // ** +pub const STRING_NULLISHCOALESCING: [u8; 4] = 41u32.to_ne_bytes(); // ?? +pub const STRING_ASSIGN: [u8; 4] = 42u32.to_ne_bytes(); // = +pub const STRING_ADDASSIGN: [u8; 4] = 43u32.to_ne_bytes(); // += +pub const STRING_SUBASSIGN: [u8; 4] = 44u32.to_ne_bytes(); // -= +pub const STRING_MULASSIGN: [u8; 4] = 45u32.to_ne_bytes(); // *= +pub const STRING_DIVASSIGN: [u8; 4] = 46u32.to_ne_bytes(); // /= +pub const STRING_MODASSIGN: [u8; 4] = 47u32.to_ne_bytes(); // %= +pub const STRING_LSHIFTASSIGN: [u8; 4] = 48u32.to_ne_bytes(); // <<= +pub const STRING_RSHIFTASSIGN: [u8; 4] = 49u32.to_ne_bytes(); // >>= +pub const STRING_ZEROFILLRSHIFTASSIGN: [u8; 4] = 50u32.to_ne_bytes(); // ">>>= +pub const STRING_BITORASSIGN: [u8; 4] = 51u32.to_ne_bytes(); // |= +pub const STRING_BITXORASSIGN: [u8; 4] = 52u32.to_ne_bytes(); // ^= +pub const STRING_BITANDASSIGN: [u8; 4] = 53u32.to_ne_bytes(); // &= +pub const STRING_EXPASSIGN: [u8; 4] = 54u32.to_ne_bytes(); // **= +pub const STRING_ANDASSIGN: [u8; 4] = 55u32.to_ne_bytes(); // &&= +pub const STRING_ORASSIGN: [u8; 4] = 56u32.to_ne_bytes(); // ||= +pub const STRING_NULLISHASSIGN: [u8; 4] = 57u32.to_ne_bytes(); // ??= +pub const STRING_PURE: [u8; 4] = 58u32.to_ne_bytes(); // pure +pub const STRING_NOSIDEEFFECTS: [u8; 4] = 59u32.to_ne_bytes(); // noSideEffects +pub const STRING_SOURCEMAP: [u8; 4] = 60u32.to_ne_bytes(); // sourcemap diff --git a/rust/parse_ast/src/convert_ast/converter/utf16_positions.rs b/rust/parse_ast/src/convert_ast/converter/utf16_positions.rs new file mode 100644 index 000000000..73a930066 --- /dev/null +++ b/rust/parse_ast/src/convert_ast/converter/utf16_positions.rs @@ -0,0 +1,142 @@ +use std::mem; +use std::slice::Iter; +use std::str::Chars; + +use crate::convert_ast::annotations::{AnnotationKind, AnnotationWithType}; + +pub struct Utf8ToUtf16ByteIndexConverterAndAnnotationHandler<'a> { + current_utf8_index: u32, + current_utf16_index: u32, + character_iterator: Chars<'a>, + next_annotation: Option<&'a AnnotationWithType>, + next_annotation_start: u32, + annotation_iterator: Iter<'a, AnnotationWithType>, + collected_annotations: Vec, + invalid_annotations: Vec, + keep_annotations: bool, +} + +#[derive(Debug)] +pub struct ConvertedAnnotation { + pub start: u32, + pub end: u32, + pub kind: AnnotationKind, +} + +impl<'a> Utf8ToUtf16ByteIndexConverterAndAnnotationHandler<'a> { + pub fn new(code: &'a str, annotations: &'a Vec) -> Self { + let mut annotation_iterator = annotations.iter(); + let current_annotation = annotation_iterator.next(); + Self { + current_utf8_index: 0, + current_utf16_index: 0, + character_iterator: code.chars(), + next_annotation: current_annotation, + next_annotation_start: get_annotation_start(current_annotation), + annotation_iterator, + collected_annotations: Vec::new(), + invalid_annotations: Vec::with_capacity(annotations.len()), + keep_annotations: false, + } + } + + /// Converts the given UTF-8 byte index to a UTF-16 byte index. + /// + /// To be performant, this method assumes that the given index is not smaller + /// than the previous index. Additionally, it handles "annotations" like + /// `@__PURE__` comments in the process. + /// + /// The logic for those comments is as follows: + /// - If the current index is at the start of an annotation, the annotation + /// is collected and the index is advanced to the end of the annotation. + /// - Otherwise, we check if the next character is a white-space character. + /// If not, we invalidate all collected annotations. + /// This is to ensure that we only collect annotations that directly precede + /// an expression and are not e.g. separated by a comma. + /// - If annotations are relevant for an expression, it can "take" the + /// collected annotations by calling `take_collected_annotations`. This + /// clears the internal buffer and returns the collected annotations. + /// - Invalidated annotations are attached to the Program node so that they + /// can all be removed from the source code later. + /// - If an annotation can influence a child that is separated by some + /// non-whitespace from the annotation, `keep_annotations_for_next` will + /// prevent annotations from being invalidated when the next position is + /// converted. + pub fn convert(&mut self, utf8_index: u32, keep_annotations_for_next: bool) -> u32 { + if self.current_utf8_index > utf8_index { + panic!( + "Cannot convert positions backwards: {} < {}", + utf8_index, self.current_utf8_index + ); + } + while self.current_utf8_index < utf8_index { + if self.current_utf8_index == self.next_annotation_start { + let start = self.current_utf16_index; + let (next_annotation_end, next_annotation_kind) = self + .next_annotation + .map(|a| (a.comment.span.hi.0 - 1, a.kind.clone())) + .unwrap(); + while self.current_utf8_index < next_annotation_end { + let character = self.character_iterator.next().unwrap(); + self.current_utf8_index += character.len_utf8() as u32; + self.current_utf16_index += character.len_utf16() as u32; + } + self.collected_annotations.push(ConvertedAnnotation { + start, + end: self.current_utf16_index, + kind: next_annotation_kind, + }); + self.next_annotation = self.annotation_iterator.next(); + self.next_annotation_start = get_annotation_start(self.next_annotation); + } else { + let character = self.character_iterator.next().unwrap(); + if !(self.keep_annotations || self.collected_annotations.is_empty()) { + match character { + ' ' | '\t' | '\r' | '\n' => {} + _ => { + self.invalidate_collected_annotations(); + } + } + } + self.current_utf8_index += character.len_utf8() as u32; + self.current_utf16_index += character.len_utf16() as u32; + } + } + self.keep_annotations = keep_annotations_for_next; + self.current_utf16_index + } + + pub fn take_collected_annotations(&mut self, kind: AnnotationKind) -> Vec { + let mut relevant_annotations = Vec::new(); + for annotation in self.collected_annotations.drain(..) { + if annotation.kind == kind { + relevant_annotations.push(annotation); + } else { + self.invalid_annotations.push(annotation); + } + } + relevant_annotations + } + + pub fn add_collected_annotations(&mut self, annotations: Vec) { + self.collected_annotations.extend(annotations); + self.keep_annotations = true; + } + + pub fn invalidate_collected_annotations(&mut self) { + self + .invalid_annotations + .extend(self.collected_annotations.drain(..)); + } + + pub fn take_invalid_annotations(&mut self) -> Vec { + let invalid_annotations = mem::replace(&mut self.invalid_annotations, Vec::new()); + invalid_annotations + } +} + +fn get_annotation_start(annotation: Option<&AnnotationWithType>) -> u32 { + annotation + .map(|a| a.comment.span.lo.0 - 1) + .unwrap_or(u32::MAX) +} diff --git a/rust/parse_ast/src/error_emit.rs b/rust/parse_ast/src/error_emit.rs new file mode 100644 index 000000000..f444ca859 --- /dev/null +++ b/rust/parse_ast/src/error_emit.rs @@ -0,0 +1,129 @@ +use std::{io::Write, mem::take, sync::Arc}; + +use anyhow::Error; +use parking_lot::Mutex; +use swc_common::{ + errors::{DiagnosticBuilder, Emitter, Handler, Level, HANDLER}, + Mark, SourceMap, SyntaxContext, +}; +use swc_ecma_ast::{EsVersion, Program}; +use swc_ecma_lints::{rule::Rule, rules, rules::LintParams}; +use swc_ecma_transforms_base::resolver; +use swc_ecma_visit::VisitMutWith; + +use crate::convert_ast::converter::{convert_string, node_types::TYPE_PARSE_ERROR}; + +#[derive(Clone, Default)] +struct Writer(Arc>>); + +impl Write for Writer { + fn write(&mut self, buf: &[u8]) -> std::io::Result { + let mut lock = self.0.lock(); + + lock.extend_from_slice(buf); + + Ok(buf.len()) + } + fn flush(&mut self) -> std::io::Result<()> { + Ok(()) + } +} + +pub struct ErrorEmitter { + wr: Box, +} + +impl Emitter for ErrorEmitter { + fn emit(&mut self, db: &DiagnosticBuilder<'_>) { + if db.level == Level::Error { + let mut buffer = Vec::new(); + let mut pos: u32 = 0; + if let Some(span) = db.span.primary_span() { + pos = span.lo.0 - 1; + }; + let message = &db.message[0].0; + buffer.extend_from_slice(&(pos as u32).to_ne_bytes()); + convert_string(&mut buffer, message); + let _ = self.wr.write(&buffer); + } + } +} + +pub fn try_with_handler( + code: &str, + cm: &Arc, + es_version: EsVersion, + op: F, +) -> Result> +where + F: FnOnce(&Handler) -> Result, +{ + let wr = Box::::default(); + + let emitter = ErrorEmitter { wr: wr.clone() }; + + let handler = Handler::with_emitter(true, false, Box::new(emitter)); + + let result = HANDLER.set(&handler, || op(&handler)); + + match result { + Ok(mut program) => { + let unresolved_mark = Mark::new(); + let top_level_mark = Mark::new(); + let unresolved_ctxt = SyntaxContext::empty().apply_mark(unresolved_mark); + let top_level_ctxt = SyntaxContext::empty().apply_mark(top_level_mark); + + program.visit_mut_with(&mut resolver(unresolved_mark, top_level_mark, false)); + + let mut rules = rules::all(LintParams { + program: &program, + lint_config: &Default::default(), + unresolved_ctxt, + top_level_ctxt, + es_version, + source_map: cm.clone(), + }); + + HANDLER.set(&handler, || match &program { + Program::Module(m) => { + rules.lint_module(m); + } + Program::Script(s) => { + rules.lint_script(s); + } + }); + + if handler.has_errors() { + let buffer = create_error_buffer(&wr, code); + Err(buffer) + } else { + Ok(program) + } + } + Err(_) => { + if handler.has_errors() { + let buffer = create_error_buffer(&wr, code); + Err(buffer) + } else { + panic!("Unexpected error in parse") + } + } + } +} + +fn create_error_buffer(wr: &Box, code: &str) -> Vec { + let mut buffer = TYPE_PARSE_ERROR.to_vec(); + let mut lock = wr.0.lock(); + let mut error_buffer = take(&mut *lock); + let pos = u32::from_ne_bytes(error_buffer[0..4].try_into().unwrap()); + let mut utf_16_pos: u32 = 0; + for (utf_8_pos, char) in code.char_indices() { + if (utf_8_pos as u32) == pos { + break; + } + utf_16_pos += char.len_utf16() as u32; + } + error_buffer[0..4].copy_from_slice(&utf_16_pos.to_ne_bytes()); + buffer.extend_from_slice(&error_buffer); + buffer +} diff --git a/rust/parse_ast/src/lib.rs b/rust/parse_ast/src/lib.rs new file mode 100644 index 000000000..2138546b3 --- /dev/null +++ b/rust/parse_ast/src/lib.rs @@ -0,0 +1,69 @@ +#![feature(ptr_internals)] +use std::sync::Arc; + +use swc::config::IsModule::Unknown; +use swc::{config::ParseOptions, Compiler}; +use swc_common::sync::Lrc; +use swc_common::{FileName, FilePathMapping, Globals, SourceMap, GLOBALS}; +use swc_ecma_ast::EsVersion; +use swc_ecma_parser::{EsConfig, Syntax}; + +use convert_ast::converter::AstConverter; + +use crate::convert_ast::annotations::SequentialComments; + +mod convert_ast; + +use error_emit::try_with_handler; + +mod error_emit; + +fn get_compiler() -> Arc { + let cm = Arc::new(SourceMap::new(FilePathMapping::empty())); + Arc::new(Compiler::new(cm)) +} + +pub fn parse_ast(code: String) -> Vec { + let compiler = get_compiler(); + let compiler_options = ParseOptions { + syntax: Syntax::Es(EsConfig { + import_attributes: true, + ..Default::default() + }), + target: EsVersion::EsNext, + is_module: Unknown, + comments: false, + }; + let filename = FileName::Anon; + let file = compiler.cm.new_source_file(filename, code); + let code_reference = Lrc::clone(&file.src); + let comments = SequentialComments::default(); + GLOBALS.set(&Globals::default(), || { + compiler.run(|| { + let result = try_with_handler( + &code_reference, + &compiler.cm, + compiler_options.target, + |handler| { + compiler.parse_js( + file, + handler, + compiler_options.target, + compiler_options.syntax, + compiler_options.is_module, + Some(&comments), + ) + }, + ); + match result { + Err(buffer) => buffer, + Ok(program) => { + let annotations = comments.take_annotations(); + let converter = AstConverter::new(&code_reference, &annotations); + let buffer = converter.convert_ast_to_buffer(&program); + buffer + } + } + }) + }) +} diff --git a/rust/rustfmt.toml b/rust/rustfmt.toml new file mode 100644 index 000000000..cab5731ed --- /dev/null +++ b/rust/rustfmt.toml @@ -0,0 +1,2 @@ +tab_spaces = 2 +edition = "2021" diff --git a/scripts/check-release.js b/scripts/check-release.js index 165633c6f..ba767b9f6 100755 --- a/scripts/check-release.js +++ b/scripts/check-release.js @@ -3,5 +3,6 @@ import { env, exit } from 'node:process'; if (env.ROLLUP_RELEASE !== 'releasing') { + console.error('This script should only be run as part of the release process.'); exit(1); } diff --git a/scripts/colors.js b/scripts/colors.js index 6713d2ff9..e584ecefc 100644 --- a/scripts/colors.js +++ b/scripts/colors.js @@ -3,6 +3,6 @@ import { createColors } from 'colorette'; // @see https://no-color.org // @see https://www.npmjs.com/package/chalk -export const { bold, cyan, green, red } = createColors({ +export const { bold, cyan, green, red, yellow, blue, magenta } = createColors({ useColor: env.FORCE_COLOR !== '0' && !env.NO_COLOR }); diff --git a/scripts/helpers.js b/scripts/helpers.js index 94773a83d..df55a90a3 100644 --- a/scripts/helpers.js +++ b/scripts/helpers.js @@ -1,27 +1,35 @@ import { spawn } from 'node:child_process'; -import { bold, cyan, green } from './colors.js'; +import { readFile } from 'node:fs/promises'; +import { blue, bold, cyan, green, magenta, red, yellow } from './colors.js'; + +const colors = [cyan, yellow, blue, red, green, magenta]; +let nextColorIndex = 0; export function runWithEcho(command, parameters, options) { + const color = colors[nextColorIndex]; + nextColorIndex = (nextColorIndex + 1) % colors.length; return new Promise((resolve, reject) => { const cmdString = formatCommand(command, parameters); - console.error(bold(`\n${cyan`Run>`} ${cmdString}`)); - - const childProcess = spawn(command, parameters, options); + console.error(bold(`\n${color`Run>`} ${cmdString}`)); - childProcess.stdout.pipe(process.stdout); - childProcess.stderr.pipe(process.stderr); + const childProcess = spawn(command, parameters, { stdio: 'inherit', ...options }); childProcess.on('close', code => { if (code) { reject(new Error(`"${cmdString}" exited with code ${code}.`)); } else { - console.error(bold(`${green`Finished>`} ${cmdString}\n`)); + console.error(bold(`${color`Finished>`} ${cmdString}\n`)); resolve(); } }); }); } +/** + * @param {string} command + * @param {string[]} parameters + * @return {Promise} + */ export function runAndGetStdout(command, parameters) { return new Promise((resolve, reject) => { const childProcess = spawn(command, parameters); @@ -43,3 +51,12 @@ export function runAndGetStdout(command, parameters) { function formatCommand(command, parameters) { return [command, ...parameters].join(' '); } + +/** + * @param {string} file + * @returns {Promise>} + */ +export async function readJson(file) { + const content = await readFile(file, 'utf8'); + return JSON.parse(content); +} diff --git a/scripts/postpublish.js b/scripts/postpublish.js new file mode 100644 index 000000000..aab24b9a9 --- /dev/null +++ b/scripts/postpublish.js @@ -0,0 +1,91 @@ +import { readFile } from 'node:fs/promises'; +import { env } from 'node:process'; +import GitHub from 'github-api'; +import semverPreRelease from 'semver/functions/prerelease.js'; +import { cyan } from './colors.js'; +import { CHANGELOG } from './release-constants.js'; +import { + getCurrentCommitMessage, + getFirstChangelogEntry, + getGitTag, + getIncludedPRs +} from './release-helpers.js'; + +console.log( + `------------------------------------------------------------------------------- +This script will create the release in GitHub and post comments to all released +PRs and resolved issues. It is only run from CI. +-------------------------------------------------------------------------------` +); + +if (!(env.CI && env.ROLLUP_RELEASE && env.GITHUB_TOKEN)) { + throw new Error('This script is only intended to be run from CI.'); +} + +const gh = new GitHub({ token: env.GITHUB_TOKEN }); +const [newVersion, changelog, repo, issues] = await Promise.all([ + getCurrentCommitMessage(), + readFile(CHANGELOG, 'utf8'), + gh.getRepo('rollup', 'rollup'), + gh.getIssues('rollup', 'rollup') +]); + +const matched = /^\d+\.\d+\.\d+(-\d+)?$/.exec(newVersion); +if (!matched) { + throw new Error(`The last commit message "${newVersion}" does not contain a version.`); +} + +const isPreRelease = !!matched[1]; + +const firstEntry = getFirstChangelogEntry(changelog); +const [previousVersion, changelogEntry] = + firstEntry.currentVersion === newVersion + ? [firstEntry.previousVersion, firstEntry.text] + : [firstEntry.currentVersion, null]; +const includedPRs = await getIncludedPRs( + `v${previousVersion}`, + `v${newVersion}`, + repo, + null, + isPreRelease +); + +if (changelogEntry) { + await createReleaseNotes(changelogEntry, getGitTag(newVersion)); +} +await postReleaseComments(includedPRs, issues, newVersion); + +function createReleaseNotes(changelog, tag) { + return repo.createRelease({ + body: changelog, + name: tag, + tag_name: tag + }); +} + +function postReleaseComments(includedPRs, issues, version) { + const isPreRelease = semverPreRelease(version); + const installNote = isPreRelease + ? `Note that this is a pre-release, so to test it, you need to install Rollup via \`npm install rollup@${version}\` or \`npm install rollup@beta\`. It will likely become part of a regular release later.` + : 'You can test it via `npm install rollup`.'; + return Promise.all( + includedPRs.map(({ pr, closed }) => + Promise.all([ + issues + .createIssueComment( + pr, + `This PR has been released as part of rollup@${version}. ${installNote}` + ) + .then(() => console.log(cyan(`Added release comment to #${pr}.`))), + ...closed.map(closedPr => + issues + .createIssueComment( + closedPr, + `This issue has been resolved via #${pr} as part of rollup@${version}. ${installNote}` + ) + .then(() => console.log(cyan(`Added fix comment to #${closedPr} via #${pr}.`))) + ) + ]) + ) + ); +} diff --git a/scripts/release.js b/scripts/prepare-release.js similarity index 53% rename from scripts/release.js rename to scripts/prepare-release.js index c34b96710..eebfaee32 100755 --- a/scripts/release.js +++ b/scripts/prepare-release.js @@ -3,88 +3,80 @@ import { readFile, writeFile } from 'node:fs/promises'; import { chdir, exit } from 'node:process'; import { fileURLToPath } from 'node:url'; -import GitHub from 'github-api'; import inquirer from 'inquirer'; import semverInc from 'semver/functions/inc.js'; import semverParse from 'semver/functions/parse.js'; import semverPreRelease from 'semver/functions/prerelease.js'; import { cyan } from './colors.js'; -import { runAndGetStdout, runWithEcho } from './helpers.js'; +import { readJson, runAndGetStdout, runWithEcho } from './helpers.js'; +import { + BROWSER_PACKAGE, + CHANGELOG, + DOCUMENTATION_BRANCH, + MAIN_BRANCH, + MAIN_LOCKFILE, + MAIN_PACKAGE +} from './release-constants.js'; +import { + getFirstChangelogEntry, + getGithubApi, + getGitTag, + getIncludedPRs +} from './release-helpers.js'; + +console.log( + `----------------------------------------------------------------------------- +This script will create a release tag for you and guide you through writing a +CHANGELOG entry for non-beta releases. The actual release will be performed +by GitHub Actions once this script completes successfully. +-----------------------------------------------------------------------------` +); // We execute everything from the main directory chdir(fileURLToPath(new URL('..', import.meta.url))); -const MAIN_BRANCH = 'master'; -const MAIN_PACKAGE = 'package.json'; -const MAIN_LOCKFILE = 'package-lock.json'; -const BROWSER_PACKAGE = 'browser/package.json'; -const CHANGELOG = 'CHANGELOG.md'; -const DOCUMENTATION_BRANCH = 'documentation-published'; - const [gh, currentBranch] = await Promise.all([ getGithubApi(), runAndGetStdout('git', ['branch', '--show-current']), runWithEcho('git', ['pull', '--ff-only']) ]); -const [mainPackage, mainLockFile, browserPackage, repo, issues, changelog] = await Promise.all([ +const [mainPackage, mainLockFile, browserPackage, repo, changelog] = await Promise.all([ readJson(MAIN_PACKAGE), readJson(MAIN_LOCKFILE), readJson(BROWSER_PACKAGE), gh.getRepo('rollup', 'rollup'), - gh.getIssues('rollup', 'rollup'), readFile(CHANGELOG, 'utf8') ]); const isMainBranch = currentBranch === MAIN_BRANCH; const [newVersion, includedPRs] = await Promise.all([ getNewVersion(mainPackage, isMainBranch), - getIncludedPRs(changelog, repo, currentBranch, isMainBranch) + getIncludedPRs( + `v${getFirstChangelogEntry(changelog).currentVersion}`, + 'HEAD', + repo, + currentBranch, + !isMainBranch + ) ]); -let changelogEntry, gitTag; +const gitTag = getGitTag(newVersion); try { if (isMainBranch) { await addStubChangelogEntry(newVersion, repo, changelog, includedPRs); } await updatePackages(mainPackage, mainLockFile, browserPackage, newVersion); - await installDependenciesBuildAndTest(); - changelogEntry = isMainBranch ? await waitForChangelogUpdate(newVersion) : ''; - gitTag = `v${newVersion}`; + await installDependenciesAndLint(); + if (isMainBranch) { + await waitForChangelogUpdate(newVersion); + } await commitChanges(newVersion, gitTag, isMainBranch); } catch (error) { console.error(`Error during release, rolling back changes: ${error.message}`); - await runWithEcho('git', ['reset', '--hard']); + console.error('Run `git reset --hard` to roll back changes.'); throw error; } -await releasePackages(newVersion); await pushChanges(gitTag); -if (changelogEntry) { - await createReleaseNotes(changelogEntry, gitTag); -} -await postReleaseComments(includedPRs, issues, newVersion); - -async function getGithubApi() { - const GITHUB_TOKEN = '.github_token'; - try { - const token = (await readFile(GITHUB_TOKEN, 'utf8')).trim(); - return new GitHub({ token }); - } catch (error) { - if (error.code === 'ENOENT') { - console.error( - `Could not find GitHub token file. Please create "${GITHUB_TOKEN}" containing a token with the following permissions: -- public_repo` - ); - exit(1); - } else { - throw error; - } - } -} - -async function readJson(file) { - const content = await readFile(file, 'utf8'); - return JSON.parse(content); -} async function getNewVersion(mainPackage, isMainBranch) { const { version } = mainPackage; @@ -136,64 +128,6 @@ breaking changes in the release while the tests are running.`) ); } -function getFirstChangelogEntry(changelog) { - const match = changelog.match( - /(?## (?\d+\.\d+\.\d+)[\S\s]*?)\n+## (?\d+\.\d+\.\d+)/ - ); - if (!match) { - throw new Error('Could not detect any changelog entry.'); - } - const { - groups: { text, currentVersion, previousVersion }, - index - } = match; - return { currentVersion, index, previousVersion, text }; -} - -async function getIncludedPRs(changelog, repo, currentBranch, isMainBranch) { - const { currentVersion } = getFirstChangelogEntry(changelog); - const commits = await runAndGetStdout('git', [ - '--no-pager', - 'log', - `v${currentVersion}..HEAD`, - '--pretty=tformat:%s' - ]); - const getPrRegExp = /^(.+)\s\(#(\d+)\)$/gm; - const prs = []; - let match; - while ((match = getPrRegExp.exec(commits))) { - prs.push({ pr: match[2], text: match[1].split('\n')[0] }); - } - - if (!isMainBranch) { - const { data: basePrs } = await repo.listPullRequests({ - head: `rollup:${currentBranch}`, - state: 'open' - }); - for (const { number, title } of basePrs) { - prs.push({ pr: number, text: title }); - } - } - prs.sort((a, b) => (a.pr > b.pr ? 1 : -1)); - return Promise.all( - prs.map(async ({ pr, text }) => { - const { data } = await repo.getPullRequest(pr); - const bodyWithoutComments = data.body.replace(//g, ''); - const closedIssuesRegexp = /([Ff]ix(es|ed)?|([Cc]lose|[Rr]esolve)[ds]?) #(\d+)/g; - const closed = []; - while ((match = closedIssuesRegexp.exec(bodyWithoutComments))) { - closed.push(match[4]); - } - return { - author: data.user.login, - closed, - pr, - text - }; - }) - ); -} - function getNewLogEntry(version, prs) { if (prs.length === 0) { throw new Error(`Release does not contain any PRs`); @@ -230,13 +164,12 @@ function getDummyLogSection(headline, pr) { `; } -async function installDependenciesBuildAndTest() { - await Promise.all([runWithEcho('npm', ['ci']), runWithEcho('npm', ['audit'])]); +async function installDependenciesAndLint() { await Promise.all([ - runWithEcho('npm', ['run', 'ci:lint']), - runWithEcho('npm', ['run', 'build:bootstrap']) + runWithEcho('npm', ['ci', '--ignore-scripts']), + runWithEcho('npm', ['audit']) ]); - await runWithEcho('npm', ['run', 'test:all']); + await runWithEcho('npm', ['run', 'ci:lint']); } async function waitForChangelogUpdate(version) { @@ -260,8 +193,6 @@ async function waitForChangelogUpdate(version) { } ]); } - - return changelogEntry; } function updatePackages(mainPackage, mainLockFile, browserPackage, newVersion) { @@ -296,22 +227,6 @@ async function commitChanges(newVersion, gitTag, isMainBranch) { isMainBranch && (await runWithEcho('git', ['branch', DOCUMENTATION_BRANCH, '--force', gitTag])); } -function releasePackages(newVersion) { - const releaseEnvironment = { ...process.env, ROLLUP_RELEASE: 'releasing' }; - const releaseTag = semverPreRelease(newVersion) ? ['--tag', 'beta'] : []; - const parameters = ['publish', '--access', 'public', ...releaseTag]; - return Promise.all([ - runWithEcho('npm', parameters, { - cwd: new URL('..', import.meta.url), - env: releaseEnvironment - }), - runWithEcho('npm', parameters, { - cwd: new URL('../browser', import.meta.url), - env: releaseEnvironment - }) - ]); -} - function pushChanges(gitTag) { return Promise.all([ runWithEcho('git', ['push', 'origin', 'HEAD']), @@ -319,38 +234,3 @@ function pushChanges(gitTag) { isMainBranch && runWithEcho('git', ['push', '--force', 'origin', DOCUMENTATION_BRANCH]) ]); } - -function createReleaseNotes(changelog, tag) { - return repo.createRelease({ - body: changelog, - name: tag, - tag_name: tag - }); -} - -function postReleaseComments(includedPRs, issues, version) { - const isPreRelease = semverPreRelease(newVersion); - const installNote = isPreRelease - ? `Note that this is a pre-release, so to test it, you need to install Rollup via \`npm install rollup@${newVersion}\` or \`npm install rollup@beta\`. It will likely become part of a regular release later.` - : 'You can test it via `npm install rollup`.'; - return Promise.all( - includedPRs.map(({ pr, closed }) => - Promise.all([ - issues - .createIssueComment( - pr, - `This PR has been released as part of rollup@${version}. ${installNote}` - ) - .then(() => console.log(cyan(`Added release comment to #${pr}.`))), - ...closed.map(closedPr => - issues - .createIssueComment( - closedPr, - `This issue has been resolved via #${pr} as part of rollup@${version}. ${installNote}` - ) - .then(() => console.log(cyan(`Added fix comment to #${closedPr} via #${pr}.`))) - ) - ]) - ) - ); -} diff --git a/scripts/prepublish.js b/scripts/prepublish.js new file mode 100755 index 000000000..d43a85977 --- /dev/null +++ b/scripts/prepublish.js @@ -0,0 +1,65 @@ +#!/usr/bin/env node + +import { readFile, writeFile } from 'node:fs/promises'; +import { resolve } from 'node:path'; +import { chdir } from 'node:process'; +import { fileURLToPath } from 'node:url'; +import { readJson, runWithEcho } from './helpers.js'; +import publishWasmNodePackage from './publish-wasm-node-package.js'; +import { CHANGELOG, MAIN_PACKAGE } from './release-constants.js'; +import { getCurrentCommitMessage, getFirstChangelogEntry } from './release-helpers.js'; + +// We execute everything from the main directory +chdir(fileURLToPath(new URL('..', import.meta.url))); + +const version = await getCurrentCommitMessage(); +const matched = /^\d+\.\d+\.\d+(-\d+)?$/.exec(version); + +if (!matched) { + throw new Error( + `The commit message "${version}" does not satisfy the patterns 0.0.0 or 0.0.0-0.` + ); +} +const isPreRelease = !!matched[1]; +await verifyChangelog(isPreRelease); + +await runWithEcho('npm', ['publish'], { cwd: resolve('browser') }); +await publishWasmNodePackage(); + +const { optionalDependencies } = await readJson(MAIN_PACKAGE); +await runWithEcho('npm', ['run', 'prepublish:napi']); +const mainPackage = await readJson(MAIN_PACKAGE); +await writeFile( + MAIN_PACKAGE, + JSON.stringify( + { + ...mainPackage, + optionalDependencies: { ...optionalDependencies, ...mainPackage.optionalDependencies } + }, + null, + 2 + ) +); + +/** + * @param {boolean} isPreRelease + * @return {Promise} + */ +async function verifyChangelog(isPreRelease) { + const changelog = await readFile(CHANGELOG, 'utf8'); + const { currentVersion, text } = getFirstChangelogEntry(changelog); + if (currentVersion !== version) { + if (isPreRelease) { + console.log( + `There is no changelog entry for version "${version}", the last entry is for version "${currentVersion}". This is OK for a pre-release.` + ); + return; + } + throw new Error( + `There is no changelog entry for version "${version}", the last entry is for version "${currentVersion}".` + ); + } + if (text.includes('[replace me]')) { + throw new Error(`The changelog entry must not contain placeholders. The text was:\n${text}`); + } +} diff --git a/scripts/publish-wasm-node-package.js b/scripts/publish-wasm-node-package.js new file mode 100644 index 000000000..45426fa88 --- /dev/null +++ b/scripts/publish-wasm-node-package.js @@ -0,0 +1,54 @@ +import fs from 'node:fs/promises'; +import { resolve } from 'node:path'; + +import { readJson, runWithEcho } from './helpers.js'; +import { MAIN_PACKAGE } from './release-constants.js'; + +const WASM_NODE_PACKAGE_INFO = { + description: 'Next-generation ES module bundler with Node wasm', + name: '@rollup/wasm-node' +}; +const COPIED_FILES_OR_DIRS = ['LICENSE.md', 'dist']; +const PACKAGE_DIR = 'wasm-node-package'; +const NATIVE_JS_CONTENT = ` +const { parse } = require('./wasm-node/bindings_wasm.js'); + +exports.parse = parse +`; + +function getPath(...arguments_) { + return resolve(PACKAGE_DIR, ...arguments_); +} + +export default async function publishWasmNodePackage() { + await fs.mkdir(PACKAGE_DIR); + + const mainPackage = await readJson(MAIN_PACKAGE); + mainPackage.files.unshift('dist/wasm-node/*.wasm'); + delete mainPackage.napi; + delete mainPackage.scripts; + + await Promise.all([ + ...COPIED_FILES_OR_DIRS.map(file => fs.cp(file, getPath(file), { recursive: true })), + fs.writeFile( + getPath('package.json'), + JSON.stringify( + { + ...mainPackage, + ...WASM_NODE_PACKAGE_INFO + }, + undefined, + 2 + ) + ) + ]); + + await Promise.all([ + fs.writeFile(getPath('dist', 'native.js'), NATIVE_JS_CONTENT.trimStart()), + fs.cp('artifacts/bindings-wasm-node/wasm-node', getPath('dist', 'wasm-node'), { + recursive: true + }) + ]); + + await runWithEcho('npm', ['publish'], { cwd: resolve(PACKAGE_DIR) }); +} diff --git a/scripts/release-constants.js b/scripts/release-constants.js new file mode 100644 index 000000000..869fbf965 --- /dev/null +++ b/scripts/release-constants.js @@ -0,0 +1,6 @@ +export const MAIN_BRANCH = 'master'; +export const MAIN_PACKAGE = 'package.json'; +export const MAIN_LOCKFILE = 'package-lock.json'; +export const BROWSER_PACKAGE = 'browser/package.json'; +export const CHANGELOG = 'CHANGELOG.md'; +export const DOCUMENTATION_BRANCH = 'documentation-published'; diff --git a/scripts/release-helpers.js b/scripts/release-helpers.js new file mode 100644 index 000000000..925eaed66 --- /dev/null +++ b/scripts/release-helpers.js @@ -0,0 +1,111 @@ +import { readFile } from 'node:fs/promises'; +import { exit } from 'node:process'; +import GitHub from 'github-api'; +import { runAndGetStdout } from './helpers.js'; + +/** + * @param {string} changelog + * @returns {{ currentVersion: string, index: number, previousVersion: string, text: string }} + */ +export function getFirstChangelogEntry(changelog) { + const match = changelog.match( + /(?## (?\d+\.\d+\.\d+(-\d+)?)[\S\s]*?)\n+## (?\d+\.\d+\.\d+)/ + ); + if (!match) { + throw new Error('Could not detect any changelog entry.'); + } + const { + groups: { text, currentVersion, previousVersion }, + index + } = match; + return { currentVersion, index, previousVersion, text }; +} + +/** + * @param {string} fromVersion + * @param {string} toVersion + * @param repo + * @param {string|null} currentBranch We only have a branch when locally prepare a release, otherwise we use the sha to find the PR + * @param {boolean} isPreRelease + * @returns {Promise<{ author: string, closed: string[], pr: string, text: string }[]>} + */ +export async function getIncludedPRs(fromVersion, toVersion, repo, currentBranch, isPreRelease) { + const [commits, commitSha] = await Promise.all([ + runAndGetStdout('git', [ + '--no-pager', + 'log', + `${fromVersion}..${toVersion}`, + '--pretty=tformat:%s' + ]), + runAndGetStdout('git', ['rev-parse', toVersion]) + ]); + const getPrRegExp = /^(.+)\s\(#(\d+)\)$/gm; + const prs = []; + let match; + while ((match = getPrRegExp.exec(commits))) { + prs.push({ pr: Number(match[2]), text: match[1].split('\n')[0] }); + } + + if (isPreRelease) { + const { data: basePrs } = await repo.listPullRequests({ + state: 'open', + ...(currentBranch ? { head: `rollup:${currentBranch}` } : {}) + }); + for (const { + number, + title, + head: { sha } + } of basePrs) { + if (currentBranch || sha === commitSha) { + prs.push({ pr: number, text: title }); + } + } + } + prs.sort((a, b) => (a.pr > b.pr ? 1 : -1)); + return Promise.all( + prs.map(async ({ pr, text }) => { + const { data } = await repo.getPullRequest(pr); + const bodyWithoutComments = data.body.replace(//g, ''); + const closedIssuesRegexp = /([Ff]ix(es|ed)?|([Cc]lose|[Rr]esolve)[ds]?) #(\d+)/g; + const closed = []; + while ((match = closedIssuesRegexp.exec(bodyWithoutComments))) { + closed.push(match[4]); + } + return { + author: data.user.login, + closed, + pr, + text + }; + }) + ); +} + +export async function getGithubApi() { + const GITHUB_TOKEN = '.github_token'; + try { + const token = (await readFile(GITHUB_TOKEN, 'utf8')).trim(); + return new GitHub({ token }); + } catch (error) { + if (error.code === 'ENOENT') { + console.error( + `Could not find GitHub token file. Please create "${GITHUB_TOKEN}" containing a token with the following permissions: +- public_repo` + ); + exit(1); + } else { + throw error; + } + } +} + +export function getGitTag(version) { + return `v${version}`; +} + +/** + * @return {Promise} + */ +export function getCurrentCommitMessage() { + return runAndGetStdout('git', ['--no-pager', 'log', '-1', '--pretty=%B']); +} diff --git a/scripts/test-options.js b/scripts/test-options.js index 907c55a72..4ece8ce95 100644 --- a/scripts/test-options.js +++ b/scripts/test-options.js @@ -1,4 +1,5 @@ import { readFile } from 'node:fs/promises'; +import { exit } from 'node:process'; const [optionsText, helpText, commandReferenceText] = await Promise.all([ readFile(new URL('../docs/configuration-options/index.md', import.meta.url), 'utf8'), @@ -48,7 +49,7 @@ for (const { long, short } of allCliOptions) { } if (failed) { - process.exit(1); + exit(1); } let current = null; @@ -58,7 +59,7 @@ for (const [long, short] of cliOptionsInHelp) { console.error( `Options in help.md are not sorted properly. "${long}" should occur before "${current}".` ); - process.exit(1); + exit(1); } current = long; } @@ -68,7 +69,7 @@ const splitHelpText = helpText.split('\n'); for (const line of splitHelpText) { if (line.length > 80) { console.error(`The following line in help.md exceeds the limit of 80 characters:\n${line}`); - process.exit(1); + exit(1); } } @@ -88,6 +89,6 @@ for (const [index, line] of helpOptionLines.entries()) { console.error( `The command lines in command-line-interface/index.md do not match help.md. Expected line:\n${line}\n\nReceived line:\n${optionListLine}` ); - process.exit(1); + exit(1); } } diff --git a/src/Bundle.ts b/src/Bundle.ts index ca721d3d7..883af627b 100644 --- a/src/Bundle.ts +++ b/src/Bundle.ts @@ -150,9 +150,7 @@ export default class Bundle { for (const file of Object.values(bundle)) { if ('code' in file) { try { - this.graph.contextParse(file.code, { - ecmaVersion: 'latest' - }); + this.graph.contextParse(file.code); } catch (error_: any) { this.inputOptions.onLog(LOGLEVEL_WARN, logChunkInvalid(file, error_)); } diff --git a/src/Chunk.ts b/src/Chunk.ts index df3c26a09..dd9327397 100644 --- a/src/Chunk.ts +++ b/src/Chunk.ts @@ -95,7 +95,7 @@ export type ResolvedDynamicImport = ( ) & { node: ImportExpression }; export interface ChunkDependency { - assertions: string | null; + attributes: string | null; defaultVariableName: string | undefined; globalName: string | false | undefined; importPath: string; @@ -947,17 +947,17 @@ export default class Chunk { ); } - private getDynamicImportStringAndAssertions( + private getDynamicImportStringAndAttributes( resolution: ExternalModule | string | null, fileName: string - ): [importPath: string, assertions: string | null | true] { + ): [importPath: string, attributes: string | null | true] { if (resolution instanceof ExternalModule) { const chunk = this.externalChunkByModule.get(resolution)!; - return [`'${chunk.getImportPath(fileName)}'`, chunk.getImportAssertions(this.snippets)]; + return [`'${chunk.getImportPath(fileName)}'`, chunk.getImportAttributes(this.snippets)]; } return [ resolution || '', - (this.outputOptions.format === 'es' && this.outputOptions.externalImportAssertions) || null + (this.outputOptions.format === 'es' && this.outputOptions.externalImportAttributes) || null ]; } @@ -1140,7 +1140,7 @@ export default class Chunk { const importPath = dep.getImportPath(fileName); renderedDependencies.set(dep, { - assertions: dep instanceof ExternalChunk ? dep.getImportAssertions(this.snippets) : null, + attributes: dep instanceof ExternalChunk ? dep.getImportAttributes(this.snippets) : null, defaultVariableName: dep.defaultVariableName, globalName: dep instanceof ExternalChunk && @@ -1299,7 +1299,7 @@ export default class Chunk { } } else { const { node, resolution } = resolvedDynamicImport; - const [resolutionString, assertions] = this.getDynamicImportStringAndAssertions( + const [resolutionString, attributes] = this.getDynamicImportStringAndAttributes( resolution, fileName ); @@ -1312,7 +1312,7 @@ export default class Chunk { accessedGlobalsByScope, resolutionString, false, - assertions + attributes ); } } diff --git a/src/ExternalChunk.ts b/src/ExternalChunk.ts index 231b797f7..41d442629 100644 --- a/src/ExternalChunk.ts +++ b/src/ExternalChunk.ts @@ -13,7 +13,7 @@ export default class ExternalChunk { variableName = ''; private fileName: string | null = null; - private importAssertions: string | null = null; + private importAttributes: string | null = null; private moduleInfo: ModuleInfo; private renormalizeRenderPath: boolean; @@ -38,11 +38,11 @@ export default class ExternalChunk { (this.renormalizeRenderPath ? normalize(relative(this.inputBase, this.id)) : this.id)); } - getImportAssertions(snippets: GenerateCodeSnippets): string | null { - return (this.importAssertions ||= formatAssertions( + getImportAttributes(snippets: GenerateCodeSnippets): string | null { + return (this.importAttributes ||= formatAttributes( this.options.format === 'es' && - this.options.externalImportAssertions && - this.moduleInfo.assertions, + this.options.externalImportAttributes && + this.moduleInfo.attributes, snippets )); } @@ -56,14 +56,14 @@ export default class ExternalChunk { } } -function formatAssertions( - assertions: Record | null | void | false, +function formatAttributes( + attributes: Record | null | void | false, { getObject }: GenerateCodeSnippets ): string | null { - if (!assertions) { + if (!attributes) { return null; } - const assertionEntries: [key: string, value: string][] = Object.entries(assertions).map( + const assertionEntries: [key: string, value: string][] = Object.entries(attributes).map( ([key, value]) => [key, `'${value}'`] ); if (assertionEntries.length > 0) { diff --git a/src/ExternalModule.ts b/src/ExternalModule.ts index 4a76b4c20..33b1a7c1f 100644 --- a/src/ExternalModule.ts +++ b/src/ExternalModule.ts @@ -26,14 +26,14 @@ export default class ExternalModule { moduleSideEffects: boolean | 'no-treeshake', meta: CustomPluginOptions, public readonly renormalizeRenderPath: boolean, - assertions: Record + attributes: Record ) { this.suggestedVariableName = makeLegal(id.split(/[/\\]/).pop()!); const { importers, dynamicImporters } = this; const info: ModuleInfo = (this.info = { - assertions, ast: null, + attributes, code: null, dynamicallyImportedIdResolutions: EMPTY_ARRAY, dynamicallyImportedIds: EMPTY_ARRAY, diff --git a/src/Graph.ts b/src/Graph.ts index 9932970fd..80bf42a46 100644 --- a/src/Graph.ts +++ b/src/Graph.ts @@ -1,11 +1,12 @@ -import * as acorn from 'acorn'; import flru from 'flru'; +import native from '../native'; import type ExternalModule from './ExternalModule'; import Module from './Module'; import { ModuleLoader, type UnresolvedModule } from './ModuleLoader'; import GlobalScope from './ast/scopes/GlobalScope'; import { PathTracker } from './ast/utils/PathTracker'; import type { + AstNode, ModuleInfo, ModuleJSON, NormalizedInputOptions, @@ -17,8 +18,9 @@ import type { import { PluginDriver } from './utils/PluginDriver'; import Queue from './utils/Queue'; import { BuildPhase } from './utils/buildPhase'; -import { addAnnotations } from './utils/commentAnnotations'; +import { convertProgram } from './utils/convert-ast'; import { analyseModuleExecution } from './utils/executionOrder'; +import getReadStringFunction from './utils/getReadStringFunction'; import { LOGLEVEL_WARN } from './utils/logging'; import { error, @@ -53,8 +55,7 @@ function normalizeEntryModules( } export default class Graph { - readonly acornParser: typeof acorn.Parser; - readonly astLru = flru(5); + readonly astLru = flru(5); readonly cachedModules = new Map(); readonly deoptimizationTracker = new PathTracker(); entryModules: Module[] = []; @@ -100,7 +101,6 @@ export default class Graph { watcher.onCurrentRun('close', handleClose); } this.pluginDriver = new PluginDriver(this, options, options.plugins, this.pluginCache); - this.acornParser = acorn.Parser.extend(...(options.acornInjectPlugins as any[])); this.moduleLoader = new ModuleLoader(this, this.modulesById, this.options, this.pluginDriver); this.fileOperationQueue = new Queue(options.maxParallelFileOps); this.pureFunctions = getPureFunctions(options); @@ -123,32 +123,10 @@ export default class Graph { this.phase = BuildPhase.GENERATE; } - contextParse(code: string, options: Partial = {}): acorn.Node { - const onCommentOrig = options.onComment; - const comments: acorn.Comment[] = []; - - options.onComment = - onCommentOrig && typeof onCommentOrig == 'function' - ? (block, text, start, end, ...parameters) => { - comments.push({ end, start, type: block ? 'Block' : 'Line', value: text }); - return onCommentOrig.call(options, block, text, start, end, ...parameters); - } - : comments; - - const ast = this.acornParser.parse(code, { - ...(this.options.acorn as unknown as acorn.Options), - ...options - }); - - if (typeof onCommentOrig == 'object') { - onCommentOrig.push(...comments); - } - - options.onComment = onCommentOrig; - - addAnnotations(comments, ast, code); - - return ast; + contextParse(code: string): AstNode { + const astBuffer = native.parse(code); + const readString = getReadStringFunction(astBuffer); + return convertProgram(astBuffer.buffer, readString); } getCache(): RollupCache { diff --git a/src/Module.ts b/src/Module.ts index 9b0ae660f..224345c29 100644 --- a/src/Module.ts +++ b/src/Module.ts @@ -1,5 +1,4 @@ import { extractAssignedNames } from '@rollup/pluginutils'; -import type * as acorn from 'acorn'; import { locate } from 'locate-character'; import MagicString from 'magic-string'; import ExternalModule from './ExternalModule'; @@ -29,6 +28,7 @@ import NamespaceVariable from './ast/variables/NamespaceVariable'; import SyntheticNamedExportVariable from './ast/variables/SyntheticNamedExportVariable'; import type Variable from './ast/variables/Variable'; import type { + AstNode, CustomPluginOptions, DecodedSourceMapOrMissing, EmittedFile, @@ -59,7 +59,7 @@ import { error, logAmbiguousExternalNamespaces, logCircularReexport, - logInconsistentImportAssertions, + logInconsistentImportAttributes, logInvalidFormatForTopLevelAwait, logInvalidSourcemapForError, logMissingExport, @@ -70,9 +70,9 @@ import { warnDeprecation } from './utils/logs'; import { - doAssertionsDiffer, - getAssertionsFromImportExportDeclaration -} from './utils/parseAssertions'; + doAttributesDiffer, + getAttributesFromImportExportDeclaration +} from './utils/parseImportAttributes'; import { basename, extname } from './utils/path'; import type { PureFunctions } from './utils/pureFunctions'; import type { RenderOptions } from './utils/renderHelpers'; @@ -235,7 +235,7 @@ export default class Module { declare scope: ModuleScope; readonly sideEffectDependenciesByVariable = new Map>(); declare sourcemapChain: DecodedSourceMapOrMissing[]; - readonly sourcesWithAssertions = new Map>(); + readonly sourcesWithAttributes = new Map>(); declare transformFiles?: EmittedFile[]; private allExportNames: Set | null = null; @@ -267,7 +267,7 @@ export default class Module { moduleSideEffects: boolean | 'no-treeshake', syntheticNamedExports: boolean | string, meta: CustomPluginOptions, - assertions: Record + attributes: Record ) { this.excludeFromSourcemap = /\0/.test(id); this.context = options.moduleContext(id); @@ -284,12 +284,12 @@ export default class Module { implicitlyLoadedBefore, importers, reexportDescriptions, - sourcesWithAssertions + sourcesWithAttributes } = this; this.info = { - assertions, ast: null, + attributes, code: null, get dynamicallyImportedIdResolutions() { return dynamicImports @@ -352,7 +352,7 @@ export default class Module { get importedIdResolutions() { // eslint-disable-next-line unicorn/prefer-spread return Array.from( - sourcesWithAssertions.keys(), + sourcesWithAttributes.keys(), source => module.resolvedIds[source] ).filter(Boolean); }, @@ -361,7 +361,7 @@ export default class Module { // dependencies are populated // eslint-disable-next-line unicorn/prefer-spread return Array.from( - sourcesWithAssertions.keys(), + sourcesWithAttributes.keys(), source => module.resolvedIds[source]?.id ).filter(Boolean); }, @@ -910,8 +910,8 @@ export default class Module { toJSON(): ModuleJSON { return { - assertions: this.info.assertions, ast: this.info.ast!, + attributes: this.info.attributes, code: this.info.code!, customTransformCache: this.customTransformCache, // eslint-disable-next-line unicorn/prefer-spread @@ -1166,18 +1166,18 @@ export default class Module { source: string, declaration: ImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration ) { - const parsedAssertions = getAssertionsFromImportExportDeclaration(declaration.assertions); - const existingAssertions = this.sourcesWithAssertions.get(source); - if (existingAssertions) { - if (doAssertionsDiffer(existingAssertions, parsedAssertions)) { + const parsedAttributes = getAttributesFromImportExportDeclaration(declaration.attributes); + const existingAttributes = this.sourcesWithAttributes.get(source); + if (existingAttributes) { + if (doAttributesDiffer(existingAttributes, parsedAttributes)) { this.log( LOGLEVEL_WARN, - logInconsistentImportAssertions(existingAssertions, parsedAssertions, source, this.id), + logInconsistentImportAttributes(existingAttributes, parsedAttributes, source, this.id), declaration.start ); } } else { - this.sourcesWithAssertions.set(source, parsedAssertions); + this.sourcesWithAttributes.set(source, parsedAttributes); } } @@ -1332,7 +1332,7 @@ export default class Module { this.exports.set(name, MISSING_EXPORT_SHIM_DESCRIPTION); } - private tryParse(): acorn.Node { + private tryParse(): AstNode { try { return this.graph.contextParse(this.info.code!); } catch (error_: any) { diff --git a/src/ModuleLoader.ts b/src/ModuleLoader.ts index 402e05ff3..2c8a5442b 100644 --- a/src/ModuleLoader.ts +++ b/src/ModuleLoader.ts @@ -1,8 +1,8 @@ -import type * as acorn from 'acorn'; import ExternalModule from './ExternalModule'; import type Graph from './Graph'; import Module, { type DynamicImport } from './Module'; import type { + AstNode, CustomPluginOptions, EmittedChunk, HasModuleSideEffects, @@ -27,14 +27,17 @@ import { logExternalModulesCannotBeTransformedToModules, logExternalSyntheticExports, logImplicitDependantCannotBeExternal, - logInconsistentImportAssertions, + logInconsistentImportAttributes, logInternalIdCannotBeExternal, logUnresolvedEntry, logUnresolvedImplicitDependant, logUnresolvedImport, logUnresolvedImportTreatedAsExternal } from './utils/logs'; -import { doAssertionsDiffer, getAssertionsFromImportExpression } from './utils/parseAssertions'; +import { + doAttributesDiffer, + getAttributesFromImportExpression +} from './utils/parseImportAttributes'; import { isAbsolute, isRelative, resolve } from './utils/path'; import relativeId from './utils/relativeId'; import { resolveId } from './utils/resolveId'; @@ -52,7 +55,7 @@ export type ModuleLoaderResolveId = ( importer: string | undefined, customOptions: CustomPluginOptions | undefined, isEntry: boolean | undefined, - assertions: Record, + attributes: Record, skip?: readonly { importer: string | undefined; plugin: Plugin; source: string }[] | null ) => Promise; @@ -208,7 +211,7 @@ export class ModuleLoader { importer, customOptions, isEntry, - assertions, + attributes, skip = null ) => this.getResolvedIdWithDefaults( @@ -224,12 +227,12 @@ export class ModuleLoader { skip, customOptions, typeof isEntry === 'boolean' ? isEntry : !importer, - assertions + attributes ), importer, source ), - assertions + attributes ); private addEntryWithImplicitDependants( @@ -368,17 +371,17 @@ export class ModuleLoader { // its dependencies to be loaded. // Otherwise, it returns immediately. private async fetchModule( - { assertions, id, meta, moduleSideEffects, syntheticNamedExports }: ResolvedId, + { attributes, id, meta, moduleSideEffects, syntheticNamedExports }: ResolvedId, importer: string | undefined, isEntry: boolean, isPreload: PreloadType ): Promise { const existingModule = this.modulesById.get(id); if (existingModule instanceof Module) { - if (importer && doAssertionsDiffer(assertions, existingModule.info.assertions)) { + if (importer && doAttributesDiffer(attributes, existingModule.info.attributes)) { this.options.onLog( LOGLEVEL_WARN, - logInconsistentImportAssertions(existingModule.info.assertions, assertions, id, importer) + logInconsistentImportAttributes(existingModule.info.attributes, attributes, id, importer) ); } await this.handleExistingModule(existingModule, isEntry, isPreload); @@ -397,7 +400,7 @@ export class ModuleLoader { moduleSideEffects, syntheticNamedExports, meta, - assertions + attributes ); this.modulesById.set(id, module); this.graph.watchFiles[id] = true; @@ -447,7 +450,7 @@ export class ModuleLoader { resolvedId: ResolvedId ): Promise { if (resolvedId.external) { - const { assertions, external, id, moduleSideEffects, meta } = resolvedId; + const { attributes, external, id, moduleSideEffects, meta } = resolvedId; let externalModule = this.modulesById.get(id); if (!externalModule) { externalModule = new ExternalModule( @@ -456,17 +459,17 @@ export class ModuleLoader { moduleSideEffects, meta, external !== 'absolute' && isAbsolute(id), - assertions + attributes ); this.modulesById.set(id, externalModule); } else if (!(externalModule instanceof ExternalModule)) { return error(logInternalIdCannotBeExternal(source, importer)); - } else if (doAssertionsDiffer(externalModule.info.assertions, assertions)) { + } else if (doAttributesDiffer(externalModule.info.attributes, attributes)) { this.options.onLog( LOGLEVEL_WARN, - logInconsistentImportAssertions( - externalModule.info.assertions, - assertions, + logInconsistentImportAttributes( + externalModule.info.attributes, + attributes, source, importer ) @@ -555,7 +558,7 @@ export class ModuleLoader { ? dynamicImport.argument : dynamicImport.argument.esTreeNode!, module.id, - getAssertionsFromImportExpression(dynamicImport.node) + getAttributesFromImportExpression(dynamicImport.node) ); if (resolvedId && typeof resolvedId === 'object') { dynamicImport.id = resolvedId.id; @@ -567,17 +570,17 @@ export class ModuleLoader { private getResolveStaticDependencyPromises(module: Module): ResolveStaticDependencyPromise[] { // eslint-disable-next-line unicorn/prefer-spread return Array.from( - module.sourcesWithAssertions, - async ([source, assertions]) => + module.sourcesWithAttributes, + async ([source, attributes]) => [ source, (module.resolvedIds[source] = module.resolvedIds[source] || this.handleInvalidResolvedId( - await this.resolveId(source, module.id, EMPTY_OBJECT, false, assertions), + await this.resolveId(source, module.id, EMPTY_OBJECT, false, attributes), source, module.id, - assertions + attributes )) ] as const ); @@ -585,14 +588,14 @@ export class ModuleLoader { private getResolvedIdWithDefaults( resolvedId: NormalizedResolveIdWithoutDefaults | null, - assertions: Record + attributes: Record ): ResolvedId | null { if (!resolvedId) { return null; } const external = resolvedId.external || false; return { - assertions: resolvedId.assertions || assertions, + attributes: resolvedId.attributes || attributes, external, id: resolvedId.id, meta: resolvedId.meta || {}, @@ -625,7 +628,7 @@ export class ModuleLoader { resolvedId: ResolvedId | null, source: string, importer: string, - assertions: Record + attributes: Record ): ResolvedId { if (resolvedId === null) { if (isRelative(source)) { @@ -633,7 +636,7 @@ export class ModuleLoader { } this.options.onLog(LOGLEVEL_WARN, logUnresolvedImportTreatedAsExternal(source, importer)); return { - assertions, + attributes, external: true, id: source, meta: {}, @@ -697,14 +700,14 @@ export class ModuleLoader { private async resolveDynamicImport( module: Module, - specifier: string | acorn.Node, + specifier: string | AstNode, importer: string, - assertions: Record + attributes: Record ): Promise { const resolution = await this.pluginDriver.hookFirst('resolveDynamicImport', [ specifier, importer, - { assertions } + { attributes } ]); if (typeof specifier !== 'string') { if (typeof resolution === 'string') { @@ -715,18 +718,18 @@ export class ModuleLoader { } return this.getResolvedIdWithDefaults( resolution as NormalizedResolveIdWithoutDefaults, - assertions + attributes ); } if (resolution == null) { const existingResolution = module.resolvedIds[specifier]; if (existingResolution) { - if (doAssertionsDiffer(existingResolution.assertions, assertions)) { + if (doAttributesDiffer(existingResolution.attributes, attributes)) { this.options.onLog( LOGLEVEL_WARN, - logInconsistentImportAssertions( - existingResolution.assertions, - assertions, + logInconsistentImportAttributes( + existingResolution.attributes, + attributes, specifier, importer ) @@ -735,20 +738,20 @@ export class ModuleLoader { return existingResolution; } return (module.resolvedIds[specifier] = this.handleInvalidResolvedId( - await this.resolveId(specifier, module.id, EMPTY_OBJECT, false, assertions), + await this.resolveId(specifier, module.id, EMPTY_OBJECT, false, attributes), specifier, module.id, - assertions + attributes )); } return this.handleInvalidResolvedId( this.getResolvedIdWithDefaults( this.getNormalizedResolvedIdWithoutDefaults(resolution, importer, specifier), - assertions + attributes ), specifier, importer, - assertions + attributes ); } } diff --git a/src/ast/keys.ts b/src/ast/keys.ts index 32764a3aa..e9f9d4379 100644 --- a/src/ast/keys.ts +++ b/src/ast/keys.ts @@ -3,9 +3,6 @@ import type { GenericEsTreeNode } from './nodes/shared/Node'; export const keys: { [name: string]: string[]; } = { - // TODO this should be removed once ImportExpression follows official ESTree - // specs with "null" as default - ImportExpression: ['arguments'], Literal: [], Program: ['body'] }; diff --git a/src/ast/nodes/BinaryExpression.ts b/src/ast/nodes/BinaryExpression.ts index 4d5e1924b..f11538690 100644 --- a/src/ast/nodes/BinaryExpression.ts +++ b/src/ast/nodes/BinaryExpression.ts @@ -112,6 +112,10 @@ export default class BinaryExpression extends NodeBase implements DeoptimizableE return type !== INTERACTION_ACCESSED || path.length > 1; } + removeAnnotations(code: MagicString) { + this.left.removeAnnotations(code); + } + render( code: MagicString, options: RenderOptions, diff --git a/src/ast/nodes/ChainExpression.ts b/src/ast/nodes/ChainExpression.ts index e2aa0a610..2dd05a259 100644 --- a/src/ast/nodes/ChainExpression.ts +++ b/src/ast/nodes/ChainExpression.ts @@ -1,3 +1,4 @@ +import type MagicString from 'magic-string'; import type { DeoptimizableEntity } from '../DeoptimizableEntity'; import type { HasEffectsContext } from '../ExecutionContext'; import type { ObjectPath, PathTracker } from '../utils/PathTracker'; @@ -27,4 +28,8 @@ export default class ChainExpression extends NodeBase implements DeoptimizableEn if (this.expression.isSkippedAsOptional(this)) return false; return this.expression.hasEffects(context); } + + removeAnnotations(code: MagicString) { + this.expression.removeAnnotations(code); + } } diff --git a/src/ast/nodes/ConditionalExpression.ts b/src/ast/nodes/ConditionalExpression.ts index c8969d5f9..94800c20e 100644 --- a/src/ast/nodes/ConditionalExpression.ts +++ b/src/ast/nodes/ConditionalExpression.ts @@ -6,7 +6,6 @@ import { findNonWhiteSpace, removeLineBreaks } from '../../utils/renderHelpers'; -import { removeAnnotations } from '../../utils/treeshakeNode'; import type { DeoptimizableEntity } from '../DeoptimizableEntity'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../NodeInteractions'; @@ -156,6 +155,10 @@ export default class ConditionalExpression extends NodeBase implements Deoptimiz } } + removeAnnotations(code: MagicString) { + this.test.removeAnnotations(code); + } + render( code: MagicString, options: RenderOptions, @@ -186,7 +189,7 @@ export default class ConditionalExpression extends NodeBase implements Deoptimiz if (this.consequent.included) { code.remove(colonPos, this.end); } - removeAnnotations(this, code); + this.test.removeAnnotations(code); usedBranch!.render(code, options, { isCalleeOfRenderedParent, preventASI: true, diff --git a/src/ast/nodes/ExportAllDeclaration.ts b/src/ast/nodes/ExportAllDeclaration.ts index bd01cf451..271e36d7a 100644 --- a/src/ast/nodes/ExportAllDeclaration.ts +++ b/src/ast/nodes/ExportAllDeclaration.ts @@ -7,7 +7,7 @@ import type * as NodeType from './NodeType'; import { NodeBase } from './shared/Node'; export default class ExportAllDeclaration extends NodeBase { - declare assertions: ImportAttribute[]; + declare attributes: ImportAttribute[]; declare exported: Identifier | null; declare needsBoundaries: true; declare source: Literal; diff --git a/src/ast/nodes/ExportDefaultDeclaration.ts b/src/ast/nodes/ExportDefaultDeclaration.ts index 7a6266676..b6bf1d32b 100644 --- a/src/ast/nodes/ExportDefaultDeclaration.ts +++ b/src/ast/nodes/ExportDefaultDeclaration.ts @@ -60,6 +60,10 @@ export default class ExportDefaultDeclaration extends NodeBase { this.context.addExport(this); } + removeAnnotations(code: MagicString) { + this.declaration.removeAnnotations(code); + } + render(code: MagicString, options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void { const { start, end } = nodeRenderOptions as { end: number; start: number }; const declarationStart = getDeclarationStart(code.original, this.start); diff --git a/src/ast/nodes/ExportNamedDeclaration.ts b/src/ast/nodes/ExportNamedDeclaration.ts index 55c0f1f29..a63ea59e2 100644 --- a/src/ast/nodes/ExportNamedDeclaration.ts +++ b/src/ast/nodes/ExportNamedDeclaration.ts @@ -11,7 +11,7 @@ import type VariableDeclaration from './VariableDeclaration'; import { type Node, NodeBase } from './shared/Node'; export default class ExportNamedDeclaration extends NodeBase { - declare assertions: ImportAttribute[]; + declare attributes: ImportAttribute[]; declare declaration: FunctionDeclaration | ClassDeclaration | VariableDeclaration | null; declare needsBoundaries: true; declare source: Literal | null; @@ -31,6 +31,10 @@ export default class ExportNamedDeclaration extends NodeBase { this.context.addExport(this); } + removeAnnotations(code: MagicString) { + this.declaration?.removeAnnotations(code); + } + render(code: MagicString, options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void { const { start, end } = nodeRenderOptions as { end: number; start: number }; if (this.declaration === null) { diff --git a/src/ast/nodes/ExpressionStatement.ts b/src/ast/nodes/ExpressionStatement.ts index 67e545195..e1bb6847e 100644 --- a/src/ast/nodes/ExpressionStatement.ts +++ b/src/ast/nodes/ExpressionStatement.ts @@ -25,9 +25,15 @@ export default class ExpressionStatement extends StatementBase { } } + removeAnnotations(code: MagicString) { + this.expression.removeAnnotations(code); + } + render(code: MagicString, options: RenderOptions): void { super.render(code, options); - if (this.included) this.insertSemicolon(code); + if (code.original[this.end - 1] !== ';') { + code.appendLeft(this.end, ';'); + } } shouldBeIncluded(context: InclusionContext): boolean { diff --git a/src/ast/nodes/Identifier.ts b/src/ast/nodes/Identifier.ts index fdecf19a1..0ab953826 100644 --- a/src/ast/nodes/Identifier.ts +++ b/src/ast/nodes/Identifier.ts @@ -2,7 +2,6 @@ import isReference, { type NodeWithFieldDefinition } from 'is-reference'; import type MagicString from 'magic-string'; import type { NormalizedTreeshakingOptions } from '../../rollup/types'; import { BLANK } from '../../utils/blank'; -import { logIllegalImportReassignment } from '../../utils/logs'; import { PureFunctionKey } from '../../utils/pureFunctions'; import type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers'; import type { DeoptimizableEntity } from '../DeoptimizableEntity'; @@ -107,9 +106,6 @@ export default class Identifier extends NodeBase implements PatternNode { } deoptimizePath(path: ObjectPath): void { - if (path.length === 0 && !this.scope.contains(this.name)) { - this.disallowImportReassignment(); - } // We keep conditional chaining because an unknown Node could have an // Identifier as property that might be deoptimized by default this.variable?.deoptimizePath(path); @@ -279,13 +275,6 @@ export default class Identifier extends NodeBase implements PatternNode { } } - private disallowImportReassignment(): never { - return this.context.error( - logIllegalImportReassignment(this.name, this.context.module.id), - this.start - ); - } - private getVariableRespectingTDZ(): ExpressionEntity | null { if (this.isPossibleTDZ()) { return UNKNOWN_EXPRESSION; diff --git a/src/ast/nodes/ImportDeclaration.ts b/src/ast/nodes/ImportDeclaration.ts index acf317b40..41fc90fc5 100644 --- a/src/ast/nodes/ImportDeclaration.ts +++ b/src/ast/nodes/ImportDeclaration.ts @@ -9,13 +9,13 @@ import type * as NodeType from './NodeType'; import { NodeBase } from './shared/Node'; export default class ImportDeclaration extends NodeBase { - declare assertions?: ImportAttribute[]; + declare attributes: ImportAttribute[]; declare needsBoundaries: true; declare source: Literal; declare specifiers: (ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier)[]; declare type: NodeType.tImportDeclaration; - // Do not bind specifiers or assertions + // Do not bind specifiers or attributes bind(): void {} hasEffects(): boolean { diff --git a/src/ast/nodes/ImportExpression.ts b/src/ast/nodes/ImportExpression.ts index c37976a78..386ca5042 100644 --- a/src/ast/nodes/ImportExpression.ts +++ b/src/ast/nodes/ImportExpression.ts @@ -21,7 +21,6 @@ import FunctionExpression from './FunctionExpression'; import Identifier from './Identifier'; import MemberExpression from './MemberExpression'; import type * as NodeType from './NodeType'; -import type ObjectExpression from './ObjectExpression'; import ObjectPattern from './ObjectPattern'; import VariableDeclarator from './VariableDeclarator'; import { @@ -36,21 +35,19 @@ interface DynamicImportMechanism { right: string; } -// TODO once ImportExpression follows official ESTree specs with "null" as -// default, keys.ts should be updated export default class ImportExpression extends NodeBase { - declare arguments: ObjectExpression[] | undefined; + declare options: ExpressionNode | null; inlineNamespace: NamespaceVariable | null = null; declare source: ExpressionNode; declare type: NodeType.tImportExpression; - private assertions: string | null | true = null; + private attributes: string | null | true = null; private mechanism: DynamicImportMechanism | null = null; private namespaceExportName: string | false | undefined = undefined; private resolution: Module | ExternalModule | string | null = null; private resolutionString: string | null = null; - // Do not bind assertions + // Do not bind attributes bind(): void { this.source.bind(); } @@ -209,14 +206,14 @@ export default class ImportExpression extends NodeBase { } else { this.source.render(code, options); } - if (this.assertions !== true) { - if (this.arguments) { + if (this.attributes !== true) { + if (this.options) { code.overwrite(this.source.end, this.end - 1, '', { contentOnly: true }); } - if (this.assertions) { + if (this.attributes) { code.appendLeft( this.end - 1, - `,${_}${getObject([['assert', this.assertions]], { + `,${_}${getObject([['assert', this.attributes]], { lineBreakIndent: null })}` ); @@ -233,14 +230,14 @@ export default class ImportExpression extends NodeBase { accessedGlobalsByScope: Map>, resolutionString: string, namespaceExportName: string | false | undefined, - assertions: string | null | true + attributes: string | null | true ): void { const { format } = options; this.inlineNamespace = null; this.resolution = resolution; this.resolutionString = resolutionString; this.namespaceExportName = namespaceExportName; - this.assertions = assertions; + this.attributes = attributes; const accessedGlobals = [...(accessedImportGlobals[format] || [])]; let helper: string | null; ({ helper, mechanism: this.mechanism } = this.getDynamicImportMechanismAndHelper( diff --git a/src/ast/nodes/LogicalExpression.ts b/src/ast/nodes/LogicalExpression.ts index 757d8286f..25c5fa7ea 100644 --- a/src/ast/nodes/LogicalExpression.ts +++ b/src/ast/nodes/LogicalExpression.ts @@ -7,7 +7,6 @@ import { removeLineBreaks, type RenderOptions } from '../../utils/renderHelpers'; -import { removeAnnotations } from '../../utils/treeshakeNode'; import type { DeoptimizableEntity } from '../DeoptimizableEntity'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../NodeInteractions'; @@ -160,6 +159,10 @@ export default class LogicalExpression extends NodeBase implements Deoptimizable } } + removeAnnotations(code: MagicString) { + this.left.removeAnnotations(code); + } + render( code: MagicString, options: RenderOptions, @@ -182,10 +185,10 @@ export default class LogicalExpression extends NodeBase implements Deoptimizable if (preventASI) { removeLineBreaks(code, removePos, this.right.start); } + this.left.removeAnnotations(code); } else { code.remove(operatorPos, this.end); } - removeAnnotations(this, code); this.getUsedBranch()!.render(code, options, { isCalleeOfRenderedParent, preventASI, diff --git a/src/ast/nodes/SequenceExpression.ts b/src/ast/nodes/SequenceExpression.ts index af12d2729..8ca3f731d 100644 --- a/src/ast/nodes/SequenceExpression.ts +++ b/src/ast/nodes/SequenceExpression.ts @@ -80,6 +80,10 @@ export default class SequenceExpression extends NodeBase { } } + removeAnnotations(code: MagicString) { + this.expressions[0].removeAnnotations(code); + } + render( code: MagicString, options: RenderOptions, diff --git a/src/ast/nodes/VariableDeclaration.ts b/src/ast/nodes/VariableDeclaration.ts index 0265bae99..f6846527d 100644 --- a/src/ast/nodes/VariableDeclaration.ts +++ b/src/ast/nodes/VariableDeclaration.ts @@ -85,6 +85,10 @@ export default class VariableDeclaration extends NodeBase { } } + removeAnnotations(code: MagicString) { + this.declarations[0].removeAnnotations(code); + } + render( code: MagicString, options: RenderOptions, diff --git a/src/ast/nodes/VariableDeclarator.ts b/src/ast/nodes/VariableDeclarator.ts index 2308c248f..33b22a0ca 100644 --- a/src/ast/nodes/VariableDeclarator.ts +++ b/src/ast/nodes/VariableDeclarator.ts @@ -46,6 +46,10 @@ export default class VariableDeclarator extends NodeBase { } } + removeAnnotations(code: MagicString) { + this.init?.removeAnnotations(code); + } + render(code: MagicString, options: RenderOptions): void { const { exportNamesByVariable, diff --git a/src/ast/nodes/shared/Node.ts b/src/ast/nodes/shared/Node.ts index 8a3827dcd..47ca814dc 100644 --- a/src/ast/nodes/shared/Node.ts +++ b/src/ast/nodes/shared/Node.ts @@ -1,10 +1,9 @@ -import type * as acorn from 'acorn'; import { locate, type Location } from 'locate-character'; import type MagicString from 'magic-string'; import type { AstContext } from '../../../Module'; -import type { NormalizedTreeshakingOptions } from '../../../rollup/types'; -import type { RollupAnnotation } from '../../../utils/commentAnnotations'; -import { ANNOTATION_KEY, INVALID_COMMENT_KEY } from '../../../utils/commentAnnotations'; +import type { AstNode, NormalizedTreeshakingOptions } from '../../../rollup/types'; +import type { RollupAnnotation } from '../../../utils/convert-ast'; +import { ANNOTATION_KEY, INVALID_ANNOTATION_KEY } from '../../../utils/convert-ast'; import type { NodeRenderOptions, RenderOptions } from '../../../utils/renderHelpers'; import type { DeoptimizableEntity } from '../../DeoptimizableEntity'; import type { Entity } from '../../Entity'; @@ -23,7 +22,7 @@ import type * as NodeType from '../NodeType'; import type { InclusionOptions } from './Expression'; import { ExpressionEntity } from './Expression'; -export interface GenericEsTreeNode extends acorn.Node { +export interface GenericEsTreeNode extends AstNode { [key: string]: any; } @@ -31,7 +30,7 @@ export const INCLUDE_PARAMETERS = 'variables' as const; export type IncludeChildren = boolean | typeof INCLUDE_PARAMETERS; export interface Node extends Entity { - annotations?: acorn.Comment[]; + annotations?: RollupAnnotation[]; context: AstContext; end: number; esTreeNode: GenericEsTreeNode | null; @@ -95,6 +94,8 @@ export interface Node extends Entity { deoptimizeAccess: boolean ): void; + removeAnnotations(code: MagicString): void; + render(code: MagicString, options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void; /** @@ -134,7 +135,7 @@ export class NodeBase extends ExpressionEntity implements ExpressionNode { context: AstContext; declare end: number; - esTreeNode: acorn.Node | null; + esTreeNode: AstNode | null; keys: string[]; parent: Node | { context: AstContext; type: string }; declare scope: ChildScope; @@ -257,12 +258,6 @@ export class NodeBase extends ExpressionEntity implements ExpressionNode { */ initialise(): void {} - insertSemicolon(code: MagicString): void { - if (code.original[this.end - 1] !== ';') { - code.appendLeft(this.end, ';'); - } - } - parseNode(esTreeNode: GenericEsTreeNode, keepEsTreeNodeKeys?: string[]): void { for (const [key, value] of Object.entries(esTreeNode)) { // That way, we can override this function to add custom initialisation and then call super.parseNode @@ -273,12 +268,12 @@ export class NodeBase extends ExpressionEntity implements ExpressionNode { this.annotations = annotations; if ((this.context.options.treeshake as NormalizedTreeshakingOptions).annotations) { this.annotationNoSideEffects = annotations.some( - comment => comment.annotationType === 'noSideEffects' + comment => comment.type === 'noSideEffects' ); - this.annotationPure = annotations.some(comment => comment.annotationType === 'pure'); + this.annotationPure = annotations.some(comment => comment.type === 'pure'); } - } else if (key === INVALID_COMMENT_KEY) { - for (const { start, end } of value as acorn.Comment[]) + } else if (key === INVALID_ANNOTATION_KEY) { + for (const { start, end } of value as RollupAnnotation[]) this.context.magicString.remove(start, end); } } else if (typeof value !== 'object' || value === null) { @@ -308,6 +303,14 @@ export class NodeBase extends ExpressionEntity implements ExpressionNode { } } + removeAnnotations(code: MagicString): void { + if (this.annotations) { + for (const annotation of this.annotations) { + code.remove(annotation.start, annotation.end); + } + } + } + render(code: MagicString, options: RenderOptions): void { for (const key of this.keys) { const value = (this as GenericEsTreeNode)[key]; diff --git a/src/finalisers/es.ts b/src/finalisers/es.ts index ac49a9113..372109e4c 100644 --- a/src/finalisers/es.ts +++ b/src/finalisers/es.ts @@ -37,8 +37,8 @@ function getImportBlock( { _ }: GenerateCodeSnippets ): string[] { const importBlock: string[] = []; - for (const { importPath, reexports, imports, name, assertions } of dependencies) { - const assertion = assertions ? `${_}assert${_}${assertions}` : ''; + for (const { importPath, reexports, imports, name, attributes } of dependencies) { + const assertion = attributes ? `${_}assert${_}${attributes}` : ''; const pathWithAssertion = `'${importPath}'${assertion};`; if (!reexports && !imports) { importBlock.push(`import${_}${pathWithAssertion}`); diff --git a/src/rollup/rollup.ts b/src/rollup/rollup.ts index 2abf6c0e9..e642f92c6 100644 --- a/src/rollup/rollup.ts +++ b/src/rollup/rollup.ts @@ -5,6 +5,7 @@ import type { PluginDriver } from '../utils/PluginDriver'; import { getSortedValidatedPlugins } from '../utils/PluginDriver'; import { mkdir, writeFile } from '../utils/fs'; import { catchUnfinishedHookActions } from '../utils/hookActions'; +import initWasm from '../utils/initWasm'; import { getLogHandler } from '../utils/logHandler'; import { getLogger } from '../utils/logger'; import { LOGLEVEL_DEBUG, LOGLEVEL_INFO, LOGLEVEL_WARN } from '../utils/logging'; @@ -51,6 +52,8 @@ export async function rollupInternal( ); initialiseTimers(inputOptions); + await initWasm(); + const graph = new Graph(inputOptions, watcher); // remove the cache object from the memory after graph creation (cache is not used anymore) diff --git a/src/rollup/types.d.ts b/src/rollup/types.d.ts index 2f2ceb5d4..1a446a9d2 100644 --- a/src/rollup/types.d.ts +++ b/src/rollup/types.d.ts @@ -93,20 +93,20 @@ export interface SourceMap { export type SourceMapInput = ExistingRawSourceMap | string | null | { mappings: '' }; interface ModuleOptions { - assertions: Record; + attributes: Record; meta: CustomPluginOptions; moduleSideEffects: boolean | 'no-treeshake'; syntheticNamedExports: boolean | string; } export interface SourceDescription extends Partial> { - ast?: AcornNode; + ast?: AstNode; code: string; map?: SourceMapInput; } export interface TransformModuleJSON { - ast?: AcornNode; + ast?: AstNode; code: string; // note if plugins use new this.cache to opt-out auto transform cache customTransformCache: boolean; @@ -117,7 +117,7 @@ export interface TransformModuleJSON { } export interface ModuleJSON extends TransformModuleJSON, ModuleOptions { - ast: AcornNode; + ast: AstNode; dependencies: string[]; id: string; resolvedIds: ResolvedIdMap; @@ -173,7 +173,7 @@ export type EmittedFile = EmittedAsset | EmittedChunk | EmittedPrebuiltChunk; export type EmitFile = (emittedFile: EmittedFile) => string; interface ModuleInfo extends ModuleOptions { - ast: AcornNode | null; + ast: AstNode | null; code: string | null; dynamicImporters: readonly string[]; dynamicallyImportedIdResolutions: readonly ResolvedId[]; @@ -221,12 +221,12 @@ export interface PluginContext extends MinimalPluginContext { ) => Promise; /** @deprecated Use `this.getModuleIds` instead */ moduleIds: IterableIterator; - parse: (input: string, options?: any) => AcornNode; + parse: (input: string) => AstNode; resolve: ( source: string, importer?: string, options?: { - assertions?: Record; + attributes?: Record; custom?: CustomPluginOptions; isEntry?: boolean; skipSelf?: boolean; @@ -265,13 +265,13 @@ export type ResolveIdHook = ( this: PluginContext, source: string, importer: string | undefined, - options: { assertions: Record; custom?: CustomPluginOptions; isEntry: boolean } + options: { attributes: Record; custom?: CustomPluginOptions; isEntry: boolean } ) => ResolveIdResult; export type ShouldTransformCachedModuleHook = ( this: PluginContext, options: { - ast: AcornNode; + ast: AstNode; code: string; id: string; meta: CustomPluginOptions; @@ -323,9 +323,9 @@ export type RenderChunkHook = ( export type ResolveDynamicImportHook = ( this: PluginContext, - specifier: string | AcornNode, + specifier: string | AstNode, importer: string, - options: { assertions: Record } + options: { attributes: Record } ) => ResolveIdResult; export type ResolveImportMetaHook = ( @@ -566,8 +566,6 @@ export type SourcemapIgnoreListOption = ( export type InputPluginOption = MaybePromise; export interface InputOptions { - acorn?: Record; - acornInjectPlugins?: ((...arguments_: any[]) => unknown)[] | ((...arguments_: any[]) => unknown); cache?: boolean | RollupCache; context?: string; experimentalCacheExpiry?: number; @@ -603,8 +601,6 @@ export interface InputOptionsWithPlugins extends InputOptions { } export interface NormalizedInputOptions { - acorn: Record; - acornInjectPlugins: (() => unknown)[]; cache: false | undefined | RollupCache; context: string; experimentalCacheExpiry: number; @@ -713,7 +709,9 @@ export interface OutputOptions { experimentalMinChunkSize?: number; exports?: 'default' | 'named' | 'none' | 'auto'; extend?: boolean; + /** @deprecated Use "externalImportAttributes" instead. */ externalImportAssertions?: boolean; + externalImportAttributes?: boolean; externalLiveBindings?: boolean; // only required for bundle.write file?: string; @@ -770,7 +768,9 @@ export interface NormalizedOutputOptions { experimentalMinChunkSize: number; exports: 'default' | 'named' | 'none' | 'auto'; extend: boolean; + /** @deprecated Use "externalImportAttributes" instead. */ externalImportAssertions: boolean; + externalImportAttributes: boolean; externalLiveBindings: boolean; file: string | undefined; footer: AddonFunction; @@ -997,7 +997,7 @@ export type RollupWatcher = AwaitingEventEmitter<{ export function watch(config: RollupWatchOptions | RollupWatchOptions[]): RollupWatcher; -interface AcornNode { +interface AstNode { end: number; start: number; type: string; diff --git a/src/utils/PluginContext.ts b/src/utils/PluginContext.ts index a00c262cb..4bde06fd8 100644 --- a/src/utils/PluginContext.ts +++ b/src/utils/PluginContext.ts @@ -99,13 +99,13 @@ export function getPluginContext( return wrappedModuleIds(); }, parse: graph.contextParse.bind(graph), - resolve(source, importer, { assertions, custom, isEntry, skipSelf } = BLANK) { + resolve(source, importer, { attributes, custom, isEntry, skipSelf } = BLANK) { return graph.moduleLoader.resolveId( source, importer, custom, isEntry, - assertions || EMPTY_OBJECT, + attributes || EMPTY_OBJECT, skipSelf ? [{ importer, plugin, source }] : null ); }, diff --git a/src/utils/commentAnnotations.ts b/src/utils/commentAnnotations.ts deleted file mode 100644 index ad77451b4..000000000 --- a/src/utils/commentAnnotations.ts +++ /dev/null @@ -1,212 +0,0 @@ -import type * as acorn from 'acorn'; -import { base as basicWalker } from 'acorn-walk'; -import { - ArrowFunctionExpression, - BinaryExpression, - CallExpression, - ChainExpression, - ConditionalExpression, - ExportDefaultDeclaration, - ExportNamedDeclaration, - ExpressionStatement, - FunctionDeclaration, - LogicalExpression, - NewExpression, - SequenceExpression, - VariableDeclaration, - VariableDeclarator -} from '../ast/nodes/NodeType'; -import { SOURCEMAPPING_URL_RE } from './sourceMappingURL'; - -export type AnnotationType = 'noSideEffects' | 'pure'; - -export interface RollupAnnotation extends acorn.Comment { - annotationType: AnnotationType; -} - -interface CommentState { - annotationIndex: number; - annotations: RollupAnnotation[]; - code: string; -} - -export const ANNOTATION_KEY = '_rollupAnnotations'; -export const INVALID_COMMENT_KEY = '_rollupRemoved'; - -interface NodeWithComments extends acorn.Node { - [ANNOTATION_KEY]?: acorn.Comment[]; - [INVALID_COMMENT_KEY]?: acorn.Comment[]; -} - -function handlePureAnnotationsOfNode( - node: acorn.Node, - state: CommentState, - type = node.type -): void { - const { annotations, code } = state; - // eslint-disable-next-line unicorn/consistent-destructuring - let comment = annotations[state.annotationIndex]; - while (comment && node.start >= comment.end) { - markPureNode(node, comment, code); - comment = annotations[++state.annotationIndex]; - } - if (comment && comment.end <= node.end) { - basicWalker[type](node, state, handlePureAnnotationsOfNode); - // eslint-disable-next-line unicorn/consistent-destructuring - while ((comment = annotations[state.annotationIndex]) && comment.end <= node.end) { - ++state.annotationIndex; - annotateNode(node, comment, false); - } - } -} - -const neitherWithespaceNorBrackets = /[^\s(]/g; -const noWhitespace = /\S/g; - -function markPureNode(node: NodeWithComments, comment: acorn.Comment, code: string): void { - const annotatedNodes: NodeWithComments[] = []; - let invalidAnnotation: boolean | undefined; - const codeInBetween = code.slice(comment.end, node.start); - if (doesNotMatchOutsideComment(codeInBetween, neitherWithespaceNorBrackets)) { - const parentStart = node.start; - while (true) { - annotatedNodes.push(node); - switch (node.type) { - case ExpressionStatement: - case ChainExpression: { - node = (node as any).expression; - continue; - } - case SequenceExpression: { - // if there are parentheses, the annotation would apply to the entire expression - if (doesNotMatchOutsideComment(code.slice(parentStart, node.start), noWhitespace)) { - node = (node as any).expressions[0]; - continue; - } - invalidAnnotation = true; - break; - } - case ConditionalExpression: { - // if there are parentheses, the annotation would apply to the entire expression - if (doesNotMatchOutsideComment(code.slice(parentStart, node.start), noWhitespace)) { - node = (node as any).test; - continue; - } - invalidAnnotation = true; - break; - } - case LogicalExpression: - case BinaryExpression: { - // if there are parentheses, the annotation would apply to the entire expression - if (doesNotMatchOutsideComment(code.slice(parentStart, node.start), noWhitespace)) { - node = (node as any).left; - continue; - } - invalidAnnotation = true; - break; - } - case ExportNamedDeclaration: - case ExportDefaultDeclaration: { - node = (node as any).declaration; - continue; - } - case VariableDeclaration: { - // case: /*#__PURE__*/ const foo = () => {} - const declaration = node as any; - if (declaration.kind === 'const') { - // jsdoc only applies to the first declaration - node = declaration.declarations[0].init; - continue; - } - invalidAnnotation = true; - break; - } - case VariableDeclarator: { - node = (node as any).init; - continue; - } - case FunctionDeclaration: - case ArrowFunctionExpression: - case CallExpression: - case NewExpression: { - break; - } - default: { - invalidAnnotation = true; - } - } - break; - } - } else { - invalidAnnotation = true; - } - if (invalidAnnotation) { - annotateNode(node, comment, false); - } else { - for (const node of annotatedNodes) { - annotateNode(node, comment, true); - } - } -} - -function doesNotMatchOutsideComment(code: string, forbiddenChars: RegExp): boolean { - let nextMatch: RegExpExecArray | null; - while ((nextMatch = forbiddenChars.exec(code)) !== null) { - if (nextMatch[0] === '/') { - const charCodeAfterSlash = code.charCodeAt(forbiddenChars.lastIndex); - if (charCodeAfterSlash === 42 /*"*"*/) { - forbiddenChars.lastIndex = code.indexOf('*/', forbiddenChars.lastIndex + 1) + 2; - continue; - } else if (charCodeAfterSlash === 47 /*"/"*/) { - forbiddenChars.lastIndex = code.indexOf('\n', forbiddenChars.lastIndex + 1) + 1; - continue; - } - } - forbiddenChars.lastIndex = 0; - return false; - } - return true; -} - -const annotationsRegexes: [AnnotationType, RegExp][] = [ - ['pure', /[#@]__PURE__/], - ['noSideEffects', /[#@]__NO_SIDE_EFFECTS__/] -]; - -export function addAnnotations( - comments: readonly acorn.Comment[], - esTreeAst: acorn.Node, - code: string -): void { - const annotations: RollupAnnotation[] = []; - const sourceMappingComments: acorn.Comment[] = []; - for (const comment of comments) { - for (const [annotationType, regex] of annotationsRegexes) { - if (regex.test(comment.value)) { - annotations.push({ ...comment, annotationType }); - } - } - if (SOURCEMAPPING_URL_RE.test(comment.value)) { - sourceMappingComments.push(comment); - } - } - for (const comment of sourceMappingComments) { - annotateNode(esTreeAst, comment, false); - } - - handlePureAnnotationsOfNode(esTreeAst, { - annotationIndex: 0, - annotations, - code - }); -} - -function annotateNode(node: NodeWithComments, comment: acorn.Comment, valid: boolean): void { - const key = valid ? ANNOTATION_KEY : INVALID_COMMENT_KEY; - const property = node[key]; - if (property) { - property.push(comment); - } else { - node[key] = [comment]; - } -} diff --git a/src/utils/convert-ast-strings.ts b/src/utils/convert-ast-strings.ts new file mode 100644 index 000000000..381bb3743 --- /dev/null +++ b/src/utils/convert-ast-strings.ts @@ -0,0 +1,62 @@ +export const FIXED_STRINGS = [ + 'var', + 'let', + 'const', + 'init', + 'get', + 'set', + 'constructor', + 'method', + '-', + '+', + '!', + '~', + 'typeof', + 'void', + 'delete', + '++', + '--', + '==', + '!=', + '===', + '!==', + '<', + '<=', + '>', + '>=', + '<<', + '>>', + '>>>', + '+', + '-', + '*', + '/', + '%', + '|', + '^', + '&', + '||', + '&&', + 'in', + 'instanceof', + '**', + '??', + '=', + '+=', + '-=', + '*=', + '/=', + '%=', + '<<=', + '>>=', + '>>>=', + '|=', + '^=', + '&=', + '**=', + '&&=', + '||=', + '??=', + 'pure', + 'noSideEffects' +]; diff --git a/src/utils/convert-ast.ts b/src/utils/convert-ast.ts new file mode 100644 index 000000000..608fb518f --- /dev/null +++ b/src/utils/convert-ast.ts @@ -0,0 +1,1235 @@ +import type * as estree from 'estree'; +import type { AstNode } from '../rollup/types'; +import { FIXED_STRINGS } from './convert-ast-strings'; +import { error } from './logs'; + +type ReadString = (start: number, length: number) => string; + +export const convertProgram = (buffer: ArrayBuffer, readString: ReadString): any => + convertNode(0, new Uint32Array(buffer), readString); + +const convertNode = (position: number, buffer: Uint32Array, readString: ReadString): any => { + const nodeType = buffer[position]; + const converter = nodeConverters[nodeType]; + /* istanbul ignore if: This should never be executed but is a safeguard against faulty buffers */ + if (!converter) { + console.trace(); + throw new Error(`Unknown node type: ${nodeType}`); + } + return converter(position + 1, buffer, readString); +}; + +/* eslint-disable sort-keys */ +const nodeConverters: ((position: number, buffer: Uint32Array, readString: ReadString) => any)[] = [ + // index:0; ArrayExpression + (position, buffer, readString): estree.ArrayExpression & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const elements = convertNodeList(position, buffer, readString); + return { + type: 'ArrayExpression', + start, + end, + elements + }; + }, + // index:1; ArrayPattern + (position, buffer, readString): estree.ArrayPattern & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const elements = convertNodeList(position, buffer, readString); + return { + type: 'ArrayPattern', + start, + end, + elements + }; + }, + // index:2; ArrowFunctionExpression + (position, buffer, readString): ArrowFunctionExpression & AstNode & { id: null } => { + const start = buffer[position++]; + const end = buffer[position++]; + const async = !!buffer[position++]; + const generator = !!buffer[position++]; + const expression = !!buffer[position++]; + const parameters = convertNodeList(buffer[position++], buffer, readString); + const body = convertNode(buffer[position++], buffer, readString); + const annotations = convertAnnotationList(position, buffer); + return { + type: 'ArrowFunctionExpression', + start, + end, + async, + body, + expression, + generator, + id: null, + params: parameters, + _rollupAnnotations: annotations + }; + }, + // index:3; AssignmentExpression + (position, buffer, readString): estree.AssignmentExpression & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const operator = FIXED_STRINGS[buffer[position++]] as estree.AssignmentOperator; + const right = convertNode(buffer[position++], buffer, readString); + const left = convertNode(position, buffer, readString); + return { + type: 'AssignmentExpression', + start, + end, + left, + operator, + right + }; + }, + // index:4; AssignmentPattern + (position, buffer, readString): estree.AssignmentPattern & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const right = convertNode(buffer[position++], buffer, readString); + const left = convertNode(position, buffer, readString); + return { + type: 'AssignmentPattern', + start, + end, + left, + right + }; + }, + // index:5; AwaitExpression + (position, buffer, readString): estree.AwaitExpression & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const argument = convertNode(position, buffer, readString); + return { + type: 'AwaitExpression', + start, + argument, + end + }; + }, + // index:6; BinaryExpression + (position, buffer, readString): estree.BinaryExpression & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const operator = FIXED_STRINGS[buffer[position++]] as estree.BinaryOperator; + const right = convertNode(buffer[position++], buffer, readString); + const left = convertNode(position, buffer, readString); + return { + type: 'BinaryExpression', + start, + end, + left, + operator, + right + }; + }, + // index:7; BlockStatement + (position, buffer, readString): estree.BlockStatement & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const body = convertNodeList(position, buffer, readString); + return { + type: 'BlockStatement', + start, + body, + end + }; + }, + // index:8; BreakStatement + (position, buffer, readString): estree.BreakStatement & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const labelPosition = buffer[position++]; + return { + type: 'BreakStatement', + start, + end, + label: labelPosition ? convertNode(labelPosition, buffer, readString) : null + }; + }, + // index:9; CallExpression + (position, buffer, readString): CallExpression & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const optional = !!buffer[position++]; + const callee = convertNode(buffer[position++], buffer, readString); + const argumentsList = convertNodeList(buffer[position++], buffer, readString); + const annotations = convertAnnotationList(position, buffer); + return { + type: 'CallExpression', + start, + end, + arguments: argumentsList, + callee, + optional, + ...(annotations.length > 0 ? { _rollupAnnotations: annotations } : {}) + }; + }, + // index:10; CatchClause + (position, buffer, readString): estree.CatchClause & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const parameterPosition = buffer[position++]; + const body = convertNode(buffer[position], buffer, readString); + return { + type: 'CatchClause', + start, + end, + body, + param: parameterPosition ? convertNode(parameterPosition, buffer, readString) : null + }; + }, + // index:11; ChainExpression + (position, buffer, readString): estree.ChainExpression & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const expression = convertNode(position, buffer, readString); + return { + type: 'ChainExpression', + start, + end, + expression + }; + }, + // index:12; ClassBody + (position, buffer, readString): estree.ClassBody & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const body = convertNodeList(position, buffer, readString); + return { + type: 'ClassBody', + start, + end, + body + }; + }, + // index:13; ClassDeclaration + (position, buffer, readString): estree.ClassDeclaration & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const idPosition = buffer[position++]; + const superClassPosition = buffer[position++]; + const body = convertNode(buffer[position], buffer, readString); + return { + type: 'ClassDeclaration', + start, + end, + body, + id: idPosition ? convertNode(idPosition, buffer, readString) : null, + superClass: superClassPosition ? convertNode(superClassPosition, buffer, readString) : null + }; + }, + // index:14; ClassExpression + (position, buffer, readString): estree.ClassExpression & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const idPosition = buffer[position++]; + const superClassPosition = buffer[position++]; + const body = convertNode(buffer[position], buffer, readString); + return { + type: 'ClassExpression', + start, + end, + body, + id: idPosition ? convertNode(idPosition, buffer, readString) : null, + superClass: superClassPosition ? convertNode(superClassPosition, buffer, readString) : null + }; + }, + // index:15; ConditionalExpression + (position, buffer, readString): estree.ConditionalExpression & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const consequent = convertNode(buffer[position++], buffer, readString); + const alternate = convertNode(buffer[position++], buffer, readString); + const test = convertNode(position, buffer, readString); + return { + type: 'ConditionalExpression', + start, + end, + alternate, + consequent, + test + }; + }, + // index:16; ContinueStatement + (position, buffer, readString): estree.ContinueStatement & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const labelPosition = buffer[position]; + return { + type: 'ContinueStatement', + start, + end, + label: labelPosition ? convertNode(labelPosition, buffer, readString) : null + }; + }, + // index:17; DebuggerStatement + (position, buffer): estree.DebuggerStatement & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + return { + type: 'DebuggerStatement', + start, + end + }; + }, + // index:18; DoWhileStatement + (position, buffer, readString): estree.DoWhileStatement & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const test = convertNode(buffer[position++], buffer, readString); + const body = convertNode(position, buffer, readString); + return { + type: 'DoWhileStatement', + start, + end, + body, + test + }; + }, + // index:19; EmptyStatement + (position, buffer): estree.EmptyStatement & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + return { + type: 'EmptyStatement', + start, + end + }; + }, + // index:20; ExportAllDeclaration + (position, buffer, readString): ExportAllDeclaration & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const exportedPosition = buffer[position++]; + const source = convertNode(buffer[position++], buffer, readString); + const attributes = convertNodeList(buffer[position], buffer, readString); + return { + type: 'ExportAllDeclaration', + start, + end, + exported: exportedPosition ? convertNode(exportedPosition, buffer, readString) : null, + source, + attributes + }; + }, + // index:21; ExportDefaultDeclaration + (position, buffer, readString): estree.ExportDefaultDeclaration & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const declaration = convertNode(position, buffer, readString); + return { + type: 'ExportDefaultDeclaration', + start, + end, + declaration + }; + }, + // index:22; ExportNamedDeclaration + (position, buffer, readString): ExportNamedDeclaration & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const declarationPosition = buffer[position++]; + const sourcePosition = buffer[position++]; + const attributes = convertNodeList(buffer[position++], buffer, readString); + const specifiers = convertNodeList(position, buffer, readString); + return { + type: 'ExportNamedDeclaration', + start, + end, + declaration: declarationPosition + ? convertNode(declarationPosition, buffer, readString) + : null, + source: sourcePosition ? convertNode(sourcePosition, buffer, readString) : null, + specifiers, + attributes + }; + }, + // index:23; ExportSpecifier + (position, buffer, readString): estree.ExportSpecifier & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const exportedPosition = buffer[position++]; + const local = convertNode(position, buffer, readString); + const exported = exportedPosition ? convertNode(exportedPosition, buffer, readString) : local; + return { + type: 'ExportSpecifier', + start, + end, + exported, + local + }; + }, + // index:24; ExpressionStatement + (position, buffer, readString): estree.ExpressionStatement & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const directivePosition = buffer[position++]; + const expression = convertNode(position, buffer, readString); + return { + type: 'ExpressionStatement', + start, + end, + expression, + ...(directivePosition + ? { directive: convertString(directivePosition, buffer, readString) } + : {}) + }; + }, + // index:25; ForInStatement + (position, buffer, readString): estree.ForInStatement & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const right = convertNode(buffer[position++], buffer, readString); + const body = convertNode(buffer[position++], buffer, readString); + const left = convertNode(position, buffer, readString); + return { + type: 'ForInStatement', + start, + end, + body, + left, + right + }; + }, + // index:26; ForOfStatement + (position, buffer, readString): estree.ForOfStatement & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const awaited = !!buffer[position++]; + const right = convertNode(buffer[position++], buffer, readString); + const body = convertNode(buffer[position++], buffer, readString); + const left = convertNode(position, buffer, readString); + return { + type: 'ForOfStatement', + start, + end, + await: awaited, + body, + left, + right + }; + }, + // index:27; ForStatement + (position, buffer, readString): estree.ForStatement & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const initPosition = buffer[position++]; + const testPosition = buffer[position++]; + const updatePosition = buffer[position++]; + const body = convertNode(buffer[position], buffer, readString); + return { + type: 'ForStatement', + start, + end, + body, + init: initPosition ? convertNode(initPosition, buffer, readString) : null, + test: testPosition ? convertNode(testPosition, buffer, readString) : null, + update: updatePosition ? convertNode(updatePosition, buffer, readString) : null + }; + }, + // index:28; FunctionDeclaration + (position, buffer, readString): FunctionDeclaration & AstNode & { expression: false } => { + const start = buffer[position++]; + const end = buffer[position++]; + const async = !!buffer[position++]; + const generator = !!buffer[position++]; + const idPosition = buffer[position++]; + const parameters = convertNodeList(buffer[position++], buffer, readString); + const body = convertNode(buffer[position++], buffer, readString); + const annotations = convertAnnotationList(position, buffer); + return { + type: 'FunctionDeclaration', + start, + end, + async, + body, + expression: false, + generator, + id: idPosition ? convertNode(idPosition, buffer, readString) : null, + params: parameters, + _rollupAnnotations: annotations + }; + }, + // index:29; FunctionExpression + (position, buffer, readString): FunctionExpression & AstNode & { expression: false } => { + const start = buffer[position++]; + const end = buffer[position++]; + const async = !!buffer[position++]; + const generator = !!buffer[position++]; + const idPosition = buffer[position++]; + const parameters = convertNodeList(buffer[position++], buffer, readString); + const body = convertNode(buffer[position++], buffer, readString); + const annotations = convertAnnotationList(position, buffer); + return { + type: 'FunctionExpression', + start, + end, + async, + body, + expression: false, + generator, + id: idPosition ? convertNode(idPosition, buffer, readString) : null, + params: parameters, + _rollupAnnotations: annotations + }; + }, + // index:30; Identifier + (position, buffer, readString): estree.Identifier & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const name = convertString(position, buffer, readString); + return { + type: 'Identifier', + start, + end, + name + }; + }, + // index:31; IfStatement + (position, buffer, readString): estree.IfStatement & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const consequent = convertNode(buffer[position++], buffer, readString); + const alternatePosition = buffer[position++]; + const test = convertNode(position, buffer, readString); + return { + type: 'IfStatement', + start, + end, + alternate: alternatePosition ? convertNode(alternatePosition, buffer, readString) : null, + consequent, + test + }; + }, + // index:32; ImportAttribute + (position, buffer, readString): ImportAttribute & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const value = convertNode(buffer[position++], buffer, readString); + const key = convertNode(position, buffer, readString); + return { + type: 'ImportAttribute', + start, + end, + key, + value + }; + }, + // index:33; ImportDeclaration + (position, buffer, readString): ImportDeclaration & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const source = convertNode(buffer[position++], buffer, readString); + const attributes = convertNodeList(buffer[position++], buffer, readString); + const specifiers = convertNodeList(position, buffer, readString); + return { + type: 'ImportDeclaration', + start, + end, + source, + specifiers, + attributes + }; + }, + // index:34; ImportDefaultSpecifier + (position, buffer, readString): estree.ImportDefaultSpecifier & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const local = convertNode(position, buffer, readString); + return { + type: 'ImportDefaultSpecifier', + start, + end, + local + }; + }, + // index:35; ImportExpression + (position, buffer, readString): ImportExpression & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const optionsPosition = buffer[position++]; + const source = convertNode(position, buffer, readString); + return { + type: 'ImportExpression', + start, + end, + source, + options: optionsPosition ? convertNode(optionsPosition, buffer, readString) : null + }; + }, + // index:36; ImportNamespaceSpecifier + (position, buffer, readString): estree.ImportNamespaceSpecifier & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const local = convertNode(position, buffer, readString); + return { + type: 'ImportNamespaceSpecifier', + start, + end, + local + }; + }, + // index:37; ImportSpecifier + (position, buffer, readString): estree.ImportSpecifier & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const importedPosition = buffer[position++]; + const local = convertNode(buffer[position], buffer, readString); + const imported = importedPosition ? convertNode(importedPosition, buffer, readString) : local; + return { + type: 'ImportSpecifier', + start, + end, + imported, + local + }; + }, + // index:38; LabeledStatement + (position, buffer, readString): estree.LabeledStatement & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const body = convertNode(buffer[position++], buffer, readString); + const label = convertNode(position, buffer, readString); + return { + type: 'LabeledStatement', + start, + end, + body, + label + }; + }, + // index:39; Literal + (position, buffer, readString): estree.SimpleLiteral & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const rawPosition = buffer[position++]; + const raw = rawPosition ? convertString(rawPosition, buffer, readString) : undefined; + const value = convertString(position, buffer, readString); + return { + type: 'Literal', + start, + end, + raw, + value + }; + }, + // index:40; Literal + (position, buffer): estree.SimpleLiteral & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const value = !!buffer[position++]; + return { + type: 'Literal', + start, + end, + raw: value ? 'true' : 'false', + value + }; + }, + // index:41; Literal + (position, buffer, readString): estree.SimpleLiteral & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const rawPosition = buffer[position++]; + const raw = rawPosition ? convertString(rawPosition, buffer, readString) : undefined; + const value = new DataView(buffer.buffer).getFloat64(position << 2, true); + return { + type: 'Literal', + start, + end, + raw, + value + }; + }, + // index:42; Literal + (position, buffer): estree.SimpleLiteral & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + return { + type: 'Literal', + start, + end, + raw: 'null', + value: null + }; + }, + // index:43; Literal + (position, buffer, readString): estree.RegExpLiteral & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const pattern = convertString(buffer[position++], buffer, readString); + const flags = convertString(position, buffer, readString); + return { + type: 'Literal', + start, + end, + raw: `/${pattern}/${flags}`, + regex: { + flags, + pattern + }, + value: new RegExp(pattern, flags) + }; + }, + // index:44; Literal + (position, buffer, readString): estree.BigIntLiteral & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const bigint = convertString(buffer[position++], buffer, readString); + const raw = convertString(position, buffer, readString); + return { + type: 'Literal', + start, + end, + bigint, + raw, + value: BigInt(bigint) + }; + }, + // index:45; LogicalExpression + (position, buffer, readString): estree.LogicalExpression & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const operator = FIXED_STRINGS[buffer[position++]] as estree.LogicalOperator; + const right = convertNode(buffer[position++], buffer, readString); + const left = convertNode(position, buffer, readString); + return { + type: 'LogicalExpression', + start, + end, + left, + operator, + right + }; + }, + // index:46; MemberExpression + (position, buffer, readString): estree.MemberExpression & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const optional = !!buffer[position++]; + const computed = !!buffer[position++]; + const property = convertNode(buffer[position++], buffer, readString); + const object = convertNode(position, buffer, readString); + return { + type: 'MemberExpression', + start, + end, + computed, + object, + optional, + property + }; + }, + // index:47; MetaProperty + (position, buffer, readString): estree.MetaProperty & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const property = convertNode(buffer[position++], buffer, readString); + const meta = convertNode(position, buffer, readString); + return { + type: 'MetaProperty', + start, + end, + meta, + property + }; + }, + // index:48; MethodDefinition + (position, buffer, readString): estree.MethodDefinition & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const kind = FIXED_STRINGS[buffer[position++]] as estree.MethodDefinition['kind']; + const computed = !!buffer[position++]; + const isStatic = !!buffer[position++]; + const value = convertNode(buffer[position++], buffer, readString); + const key = convertNode(position, buffer, readString); + return { + type: 'MethodDefinition', + start, + end, + computed, + key, + kind, + static: isStatic, + value + }; + }, + // index:49; NewExpression + (position, buffer, readString): NewExpression & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const callee = convertNode(buffer[position++], buffer, readString); + const argumentsPosition = buffer[position++]; + const annotations = convertAnnotationList(position, buffer); + return { + type: 'NewExpression', + start, + end, + arguments: argumentsPosition ? convertNodeList(argumentsPosition, buffer, readString) : [], + callee, + ...(annotations.length > 0 ? { _rollupAnnotations: annotations } : {}) + }; + }, + // index:50; ObjectExpression + (position, buffer, readString): estree.ObjectExpression & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const properties = convertNodeList(position, buffer, readString); + return { + type: 'ObjectExpression', + start, + end, + properties + }; + }, + // index:51; ObjectPattern + (position, buffer, readString): estree.ObjectPattern & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const properties = convertNodeList(position, buffer, readString); + return { + type: 'ObjectPattern', + start, + end, + properties + }; + }, + // index:52; PrivateIdentifier + (position, buffer, readString): estree.PrivateIdentifier & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const name = convertString(position, buffer, readString); + return { + type: 'PrivateIdentifier', + start, + end, + name + }; + }, + // index:53; Program + (position, buffer, readString): Program & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const annotations = convertAnnotationList(buffer[position++], buffer); + const body = convertNodeList(position, buffer, readString); + return { + type: 'Program', + start, + end, + body, + sourceType: 'module', + ...(annotations.length > 0 ? { _rollupRemoved: annotations } : {}) + }; + }, + // index:54; Property + (position, buffer, readString): estree.Property & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const kind = FIXED_STRINGS[buffer[position++]] as estree.Property['kind']; + const method = !!buffer[position++]; + const computed = !!buffer[position++]; + const shorthand = !!buffer[position++]; + const key = convertNode(buffer[position++], buffer, readString); + const valuePosition = buffer[position]; + return { + type: 'Property', + start, + end, + computed, + key, + kind, + method, + shorthand, + value: valuePosition ? convertNode(valuePosition, buffer, readString) : key + }; + }, + // index:55; PropertyDefinition + (position, buffer, readString): estree.PropertyDefinition & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const computed = !!buffer[position++]; + const isStatic = !!buffer[position++]; + const valuePosition = buffer[position++]; + const key = convertNode(position, buffer, readString); + return { + type: 'PropertyDefinition', + start, + end, + computed, + key, + static: isStatic, + value: valuePosition ? convertNode(valuePosition, buffer, readString) : null + }; + }, + // index:56; RestElement + (position, buffer, readString): estree.RestElement & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const argument = convertNode(position, buffer, readString); + return { + type: 'RestElement', + start, + end, + argument + }; + }, + // index:57; ReturnStatement + (position, buffer, readString): estree.ReturnStatement & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const argumentPosition = buffer[position]; + return { + type: 'ReturnStatement', + start, + end, + argument: argumentPosition ? convertNode(argumentPosition, buffer, readString) : null + }; + }, + // index:58; SequenceExpression + (position, buffer, readString): estree.SequenceExpression & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const expressions = convertNodeList(position, buffer, readString); + return { + type: 'SequenceExpression', + start, + end, + expressions + }; + }, + // index:59; SpreadElement + (position, buffer, readString): estree.SpreadElement & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const argument = convertNode(position, buffer, readString); + return { + type: 'SpreadElement', + start, + end, + argument + }; + }, + // index:60; StaticBlock + (position, buffer, readString): estree.StaticBlock & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const body = convertNodeList(position, buffer, readString); + return { + type: 'StaticBlock', + start, + end, + body + }; + }, + // index:61; Super + (position, buffer): estree.Super & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + return { + type: 'Super', + start, + end + }; + }, + // index:62; SwitchCase + (position, buffer, readString): estree.SwitchCase & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const testPosition = buffer[position++]; + const consequent = convertNodeList(buffer[position], buffer, readString); + return { + type: 'SwitchCase', + start, + end, + consequent, + test: testPosition ? convertNode(testPosition, buffer, readString) : null + }; + }, + // index:63; SwitchStatement + (position, buffer, readString): estree.SwitchStatement & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const cases = convertNodeList(buffer[position++], buffer, readString); + const discriminant = convertNode(position, buffer, readString); + return { + type: 'SwitchStatement', + start, + end, + cases, + discriminant + }; + }, + // index:64; TaggedTemplateExpression + (position, buffer, readString): estree.TaggedTemplateExpression & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const quasi = convertNode(buffer[position++], buffer, readString); + const tag = convertNode(position, buffer, readString); + return { + type: 'TaggedTemplateExpression', + start, + end, + quasi, + tag + }; + }, + // index:65; TemplateElement + (position, buffer, readString): estree.TemplateElement & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const tail = !!buffer[position++]; + const cookedPosition = buffer[position++]; + const raw = convertString(position, buffer, readString); + return { + type: 'TemplateElement', + start, + end, + tail, + value: { + cooked: cookedPosition ? convertString(cookedPosition, buffer, readString) : null, + raw + } + }; + }, + // index:66; TemplateLiteral + (position, buffer, readString): estree.TemplateLiteral & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const expressions = convertNodeList(buffer[position++], buffer, readString); + const quasis = convertNodeList(position, buffer, readString); + return { + type: 'TemplateLiteral', + start, + end, + expressions, + quasis + }; + }, + // index:67; ThisExpression + (position, buffer): estree.ThisExpression & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + return { + type: 'ThisExpression', + start, + end + }; + }, + // index:68; ThrowStatement + (position, buffer, readString): estree.ThrowStatement & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const argument = convertNode(position, buffer, readString); + return { + type: 'ThrowStatement', + start, + end, + argument + }; + }, + // index:69; TryStatement + (position, buffer, readString): estree.TryStatement & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const handlerPosition = buffer[position++]; + const finalizerPosition = buffer[position++]; + const block = convertNode(position, buffer, readString); + return { + type: 'TryStatement', + start, + end, + block, + finalizer: finalizerPosition ? convertNode(finalizerPosition, buffer, readString) : null, + handler: handlerPosition ? convertNode(handlerPosition, buffer, readString) : null + }; + }, + // index:70; UnaryExpression + (position, buffer, readString): estree.UnaryExpression & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const operator = FIXED_STRINGS[buffer[position++]] as estree.UnaryOperator; + const argument = convertNode(position, buffer, readString); + return { + type: 'UnaryExpression', + start, + end, + argument, + operator, + prefix: true + }; + }, + // index:71; UpdateExpression + (position, buffer, readString): estree.UpdateExpression & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const prefix = !!buffer[position++]; + const operator = FIXED_STRINGS[buffer[position++]] as estree.UpdateOperator; + const argument = convertNode(position, buffer, readString); + return { + type: 'UpdateExpression', + start, + end, + argument, + operator, + prefix + }; + }, + // index:72; VariableDeclaration + (position, buffer, readString): estree.VariableDeclaration & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const kind = FIXED_STRINGS[buffer[position++]] as estree.VariableDeclaration['kind']; + const declarations = convertNodeList(position, buffer, readString); + return { + type: 'VariableDeclaration', + start, + end, + declarations, + kind + }; + }, + // index:73; VariableDeclarator + (position, buffer, readString): estree.VariableDeclarator & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const init_position = buffer[position++]; + const id = convertNode(position, buffer, readString); + return { + type: 'VariableDeclarator', + start, + end, + id, + init: init_position ? convertNode(init_position, buffer, readString) : null + }; + }, + // index:74; WhileStatement + (position, buffer, readString): estree.WhileStatement & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const body = convertNode(buffer[position++], buffer, readString); + const test = convertNode(position, buffer, readString); + return { + type: 'WhileStatement', + start, + end, + body, + test + }; + }, + // index:75; YieldExpression + (position, buffer, readString): estree.YieldExpression & AstNode => { + const start = buffer[position++]; + const end = buffer[position++]; + const delegate = !!buffer[position++]; + const argumentPosition = buffer[position]; + return { + type: 'YieldExpression', + start, + end, + argument: argumentPosition ? convertNode(argumentPosition, buffer, readString) : null, + delegate + }; + }, + // index:76; Syntax Error + (position, buffer, readString): never => { + const pos = buffer[position++]; + const message = convertString(position, buffer, readString); + error({ + pos, + message + }); + } +]; + +const convertNodeList = (position: number, buffer: Uint32Array, readString: ReadString): any[] => { + const length = buffer[position++]; + const list: any[] = []; + for (let index = 0; index < length; index++) { + const nodePosition = buffer[position++]; + list.push(nodePosition ? convertNode(nodePosition, buffer, readString) : null); + } + return list; +}; + +const convertAnnotationList = (position: number, buffer: Uint32Array): RollupAnnotation[] => { + const length = buffer[position++]; + const list: any[] = []; + for (let index = 0; index < length; index++) { + list.push(convertAnnotation(buffer[position++], buffer)); + } + return list; +}; + +const convertAnnotation = (position: number, buffer: Uint32Array): RollupAnnotation => { + const start = buffer[position++]; + const end = buffer[position++]; + const type = FIXED_STRINGS[buffer[position]] as AnnotationType; + return { end, start, type }; +}; + +const convertString = (position: number, buffer: Uint32Array, readString: ReadString): string => { + const length = buffer[position++]; + const bytePosition = position << 2; + return readString(bytePosition, length); +}; + +interface ImportAttribute { + key: estree.Identifier | estree.Literal; + type: 'ImportAttribute'; + value: estree.Literal; +} + +interface ImportDeclaration extends estree.ImportDeclaration { + attributes: ImportAttribute[]; +} + +interface ExportNamedDeclaration extends estree.ExportNamedDeclaration { + attributes: ImportAttribute[]; +} + +interface ExportAllDeclaration extends estree.ExportAllDeclaration { + attributes: ImportAttribute[]; +} + +interface ImportExpression extends estree.ImportExpression { + options: estree.Expression | null; +} + +export const ANNOTATION_KEY = '_rollupAnnotations'; +export const INVALID_ANNOTATION_KEY = '_rollupRemoved'; + +type AnnotationType = 'pure' | 'noSideEffects'; + +export interface RollupAnnotation { + start: number; + end: number; + type: AnnotationType; +} + +interface CallExpression extends estree.SimpleCallExpression { + [ANNOTATION_KEY]?: RollupAnnotation[]; +} + +interface NewExpression extends estree.NewExpression { + [ANNOTATION_KEY]?: RollupAnnotation[]; +} + +interface FunctionExpression extends estree.FunctionExpression { + [ANNOTATION_KEY]?: RollupAnnotation[]; +} + +interface FunctionDeclaration extends estree.FunctionDeclaration { + [ANNOTATION_KEY]?: RollupAnnotation[]; +} + +interface ArrowFunctionExpression extends estree.ArrowFunctionExpression { + [ANNOTATION_KEY]?: RollupAnnotation[]; +} + +interface Program extends estree.Program { + [INVALID_ANNOTATION_KEY]?: RollupAnnotation[]; +} diff --git a/src/utils/getReadStringFunction.ts b/src/utils/getReadStringFunction.ts new file mode 100644 index 000000000..ee63518cb --- /dev/null +++ b/src/utils/getReadStringFunction.ts @@ -0,0 +1,14 @@ +export default function getReadStringFunction( + astBuffer: Buffer | Uint8Array +): (start: number, length: number) => string { + if (typeof Buffer !== 'undefined' && astBuffer instanceof Buffer) { + return function readString(start, length) { + return astBuffer.toString('utf8', start, start + length); + }; + } else { + const textDecoder = new TextDecoder(); + return function readString(start, length) { + return textDecoder.decode(astBuffer.subarray(start, start + length)); + }; + } +} diff --git a/src/utils/initWasm.ts b/src/utils/initWasm.ts new file mode 100644 index 000000000..9cd42c723 --- /dev/null +++ b/src/utils/initWasm.ts @@ -0,0 +1 @@ +export default async function initWasm() {} diff --git a/src/utils/logs.ts b/src/utils/logs.ts index 0d874b886..57922cf54 100644 --- a/src/utils/logs.ts +++ b/src/utils/logs.ts @@ -48,7 +48,11 @@ export function augmentCodeLocation( properties.loc = { column, file: id, line }; } else { properties.pos = pos; - const { line, column } = locate(source, pos, { offsetLine: 1 })!; + const location = locate(source, pos, { offsetLine: 1 }); + if (!location) { + return; + } + const { line, column } = location; properties.loc = { column, file: id, line }; } @@ -92,12 +96,13 @@ const ADDON_ERROR = 'ADDON_ERROR', FIRST_SIDE_EFFECT = 'FIRST_SIDE_EFFECT', ILLEGAL_IDENTIFIER_AS_NAME = 'ILLEGAL_IDENTIFIER_AS_NAME', ILLEGAL_REASSIGNMENT = 'ILLEGAL_REASSIGNMENT', - INCONSISTENT_IMPORT_ASSERTIONS = 'INCONSISTENT_IMPORT_ASSERTIONS', + INCONSISTENT_IMPORT_ATTRIBUTES = 'INCONSISTENT_IMPORT_ATTRIBUTES', INPUT_HOOK_IN_OUTPUT_PLUGIN = 'INPUT_HOOK_IN_OUTPUT_PLUGIN', INVALID_CHUNK = 'INVALID_CHUNK', INVALID_CONFIG_MODULE_FORMAT = 'INVALID_CONFIG_MODULE_FORMAT', INVALID_EXPORT_OPTION = 'INVALID_EXPORT_OPTION', INVALID_EXTERNAL_ID = 'INVALID_EXTERNAL_ID', + INVALID_IMPORT_ATTRIBUTE = 'INVALID_IMPORT_ATTRIBUTE', INVALID_LOG_POSITION = 'INVALID_LOG_POSITION', INVALID_OPTION = 'INVALID_OPTION', INVALID_PLUGIN_HOOK = 'INVALID_PLUGIN_HOOK', @@ -235,13 +240,13 @@ export function logChunkNotGeneratedForFileName(name: string): RollupLog { export function logChunkInvalid( { fileName, code }: { code: string; fileName: string }, - exception: { loc: { column: number; line: number }; message: string } + { pos, message }: { pos: number; message: string } ): RollupLog { const errorProperties = { code: CHUNK_INVALID, - message: `Chunk "${fileName}" is not valid JavaScript: ${exception.message}.` + message: `Chunk "${fileName}" is not valid JavaScript: ${message}.` }; - augmentCodeLocation(errorProperties, exception.loc, code, fileName); + augmentCodeLocation(errorProperties, pos, code, fileName); return errorProperties; } @@ -394,26 +399,26 @@ export function logIllegalImportReassignment(name: string, importingId: string): }; } -export function logInconsistentImportAssertions( - existingAssertions: Record, - newAssertions: Record, +export function logInconsistentImportAttributes( + existingAttributes: Record, + newAttributes: Record, source: string, importer: string ): RollupLog { return { - code: INCONSISTENT_IMPORT_ASSERTIONS, + code: INCONSISTENT_IMPORT_ATTRIBUTES, message: `Module "${relativeId(importer)}" tried to import "${relativeId( source - )}" with ${formatAssertions( - newAssertions - )} assertions, but it was already imported elsewhere with ${formatAssertions( - existingAssertions - )} assertions. Please ensure that import assertions for the same module are always consistent.` + )}" with ${formatAttributes( + newAttributes + )} attributes, but it was already imported elsewhere with ${formatAttributes( + existingAttributes + )} attributes. Please ensure that import attributes for the same module are always consistent.` }; } -const formatAssertions = (assertions: Record): string => { - const entries = Object.entries(assertions); +const formatAttributes = (attributes: Record): string => { + const entries = Object.entries(attributes); if (entries.length === 0) return 'no'; return entries.map(([key, value]) => `"${key}": "${value}"`).join(', '); }; @@ -499,6 +504,24 @@ export function logInternalIdCannotBeExternal(source: string, importer: string): }; } +export function logImportOptionsAreInvalid(importer: string): RollupLog { + return { + code: INVALID_IMPORT_ATTRIBUTE, + message: `Rollup could not statically analyze the options argument of a dynamic import in "${relativeId( + importer + )}". Dynamic import options need to be an object with a nested attributes object.` + }; +} + +export function logImportAttributeIsInvalid(importer: string): RollupLog { + return { + code: INVALID_IMPORT_ATTRIBUTE, + message: `Rollup could not statically analyze an import attribute of a dynamic import in "${relativeId( + importer + )}". Import attributes need to have string keys and values. The attribute will be removed.` + }; +} + export function logInvalidLogPosition(plugin: string): RollupLog { return { code: INVALID_LOG_POSITION, diff --git a/src/utils/options/mergeOptions.ts b/src/utils/options/mergeOptions.ts index 4d7217a2a..9080ddb26 100644 --- a/src/utils/options/mergeOptions.ts +++ b/src/utils/options/mergeOptions.ts @@ -127,11 +127,6 @@ function mergeInputOptions( ): InputOptions { const getOption = (name: keyof InputOptions): any => overrides[name] ?? config[name]; const inputOptions: CompleteInputOptions = { - acorn: getOption('acorn'), - acornInjectPlugins: config.acornInjectPlugins as - | (() => unknown)[] - | (() => unknown) - | undefined, cache: config.cache as false | RollupCache | undefined, context: getOption('context'), experimentalCacheExpiry: getOption('experimentalCacheExpiry'), @@ -244,6 +239,7 @@ async function mergeOutputOptions( exports: getOption('exports'), extend: getOption('extend'), externalImportAssertions: getOption('externalImportAssertions'), + externalImportAttributes: getOption('externalImportAttributes'), externalLiveBindings: getOption('externalLiveBindings'), file: getOption('file'), footer: getOption('footer'), diff --git a/src/utils/options/normalizeInputOptions.ts b/src/utils/options/normalizeInputOptions.ts index 6083bcec7..ed938e5ee 100644 --- a/src/utils/options/normalizeInputOptions.ts +++ b/src/utils/options/normalizeInputOptions.ts @@ -1,5 +1,3 @@ -import type * as acorn from 'acorn'; -import { importAssertions } from 'acorn-import-assertions'; import type { HasModuleSideEffects, InputOptions, @@ -54,8 +52,6 @@ export async function normalizeInputOptions( const strictDeprecations = config.strictDeprecations || false; const maxParallelFileOps = getMaxParallelFileOps(config, onLog, strictDeprecations); const options: NormalizedInputOptions & InputOptions = { - acorn: getAcorn(config) as unknown as NormalizedInputOptions['acorn'], - acornInjectPlugins: getAcornInjectPlugins(config), cache: getCache(config), context, experimentalCacheExpiry: config.experimentalCacheExpiry ?? 10, @@ -91,19 +87,6 @@ export async function normalizeInputOptions( return { options, unsetOptions }; } -const getAcorn = (config: InputOptions): acorn.Options => ({ - ecmaVersion: 'latest', - sourceType: 'module', - ...config.acorn -}); - -const getAcornInjectPlugins = ( - config: InputOptions -): NormalizedInputOptions['acornInjectPlugins'] => [ - importAssertions, - ...ensureArray(config.acornInjectPlugins) -]; - const getCache = (config: InputOptions): NormalizedInputOptions['cache'] => config.cache === true // `true` is the default ? undefined diff --git a/src/utils/options/normalizeOutputOptions.ts b/src/utils/options/normalizeOutputOptions.ts index 5827e4115..231f50986 100644 --- a/src/utils/options/normalizeOutputOptions.ts +++ b/src/utils/options/normalizeOutputOptions.ts @@ -17,6 +17,7 @@ import { URL_OUTPUT_DIR, URL_OUTPUT_DYNAMICIMPORTFUNCTION, URL_OUTPUT_EXPERIMENTALDEEPCHUNKOPTIMIZATION, + URL_OUTPUT_EXTERNALIMPORTATTRIBUTES, URL_OUTPUT_FORMAT, URL_OUTPUT_GENERATEDCODE, URL_OUTPUT_GENERATEDCODE_CONSTBINDINGS, @@ -51,6 +52,7 @@ export async function normalizeOutputOptions( const file = getFile(config, preserveModules, inputOptions); const preferConst = getPreferConst(config, inputOptions); const generatedCode = getGeneratedCode(config, preferConst); + const externalImportAttributes = getExternalImportAttributes(config, inputOptions); const outputOptions: NormalizedOutputOptions & OutputOptions = { amd: getAmd(config), @@ -70,7 +72,8 @@ export async function normalizeOutputOptions( experimentalMinChunkSize: config.experimentalMinChunkSize ?? 1, exports: getExports(config, unsetOptions), extend: config.extend || false, - externalImportAssertions: config.externalImportAssertions ?? true, + externalImportAssertions: externalImportAttributes, + externalImportAttributes, externalLiveBindings: config.externalLiveBindings ?? true, file, footer: getAddon(config, 'footer'), @@ -406,6 +409,21 @@ function getExports( return configExports || 'auto'; } +const getExternalImportAttributes = ( + config: OutputOptions, + inputOptions: NormalizedInputOptions +): NormalizedOutputOptions['externalImportAttributes'] => { + if (config.externalImportAssertions != undefined) { + warnDeprecation( + `The "output.externalImportAssertions" option is deprecated. Use the "output.externalImportAttributes" option instead.`, + URL_OUTPUT_EXTERNALIMPORTATTRIBUTES, + true, + inputOptions + ); + } + return config.externalImportAttributes ?? config.externalImportAssertions ?? true; +}; + const getGeneratedCode = ( config: OutputOptions, preferConst: boolean diff --git a/src/utils/parseAssertions.ts b/src/utils/parseImportAttributes.ts similarity index 51% rename from src/utils/parseAssertions.ts rename to src/utils/parseImportAttributes.ts index 3fbf385fa..f2c094062 100644 --- a/src/utils/parseAssertions.ts +++ b/src/utils/parseImportAttributes.ts @@ -1,20 +1,34 @@ import type Identifier from '../ast/nodes/Identifier'; import type ImportAttribute from '../ast/nodes/ImportAttribute'; import type ImportExpression from '../ast/nodes/ImportExpression'; -import type { LiteralValue } from '../ast/nodes/Literal'; -import type Literal from '../ast/nodes/Literal'; -import type ObjectExpression from '../ast/nodes/ObjectExpression'; +import type { default as Literal, LiteralValue } from '../ast/nodes/Literal'; +import ObjectExpression from '../ast/nodes/ObjectExpression'; import type Property from '../ast/nodes/Property'; import type SpreadElement from '../ast/nodes/SpreadElement'; import { EMPTY_OBJECT } from './blank'; +import { LOGLEVEL_WARN } from './logging'; +import { logImportAttributeIsInvalid, logImportOptionsAreInvalid } from './logs'; -export function getAssertionsFromImportExpression(node: ImportExpression): Record { - const assertProperty = node.arguments?.[0]?.properties.find( - (property): property is Property => getPropertyKey(property) === 'assert' +const ATTRIBUTE_KEYWORDS = new Set(['assert', 'with']); + +export function getAttributesFromImportExpression(node: ImportExpression): Record { + const { context, options, start } = node; + if (!(options instanceof ObjectExpression)) { + if (options) { + context.module.log(LOGLEVEL_WARN, logImportAttributeIsInvalid(context.module.id), start); + } + return EMPTY_OBJECT; + } + const assertProperty = options.properties.find((property): property is Property => + ATTRIBUTE_KEYWORDS.has(getPropertyKey(property) as string) )?.value; if (!assertProperty) { return EMPTY_OBJECT; } + if (!(assertProperty instanceof ObjectExpression)) { + context.module.log(LOGLEVEL_WARN, logImportOptionsAreInvalid(context.module.id), start); + return EMPTY_OBJECT; + } const assertFields = (assertProperty as ObjectExpression).properties .map(property => { const key = getPropertyKey(property); @@ -24,6 +38,11 @@ export function getAssertionsFromImportExpression(node: ImportExpression): Recor ) { return [key, ((property as Property).value as Literal).value] as [string, string]; } + context.module.log( + LOGLEVEL_WARN, + logImportAttributeIsInvalid(context.module.id), + property.start + ); return null; }) .filter((property): property is [string, string] => !!property); @@ -37,20 +56,20 @@ const getPropertyKey = ( property: Property | SpreadElement | ImportAttribute ): LiteralValue | undefined => { const key = (property as Property | ImportAttribute).key; - return key && ((key as Identifier).name || (key as Literal).value); + return ( + key && !(property as Property).computed && ((key as Identifier).name || (key as Literal).value) + ); }; -export function getAssertionsFromImportExportDeclaration( - assertions: ImportAttribute[] | undefined -) { - return assertions?.length +export function getAttributesFromImportExportDeclaration(attributes: ImportAttribute[]) { + return attributes?.length ? Object.fromEntries( - assertions.map(assertion => [getPropertyKey(assertion), assertion.value.value]) + attributes.map(assertion => [getPropertyKey(assertion), assertion.value.value]) ) : EMPTY_OBJECT; } -export function doAssertionsDiffer( +export function doAttributesDiffer( assertionA: Record, assertionB: Record ): boolean { diff --git a/src/utils/resolveId.ts b/src/utils/resolveId.ts index eddacaff4..812f2e901 100644 --- a/src/utils/resolveId.ts +++ b/src/utils/resolveId.ts @@ -14,7 +14,7 @@ export async function resolveId( skip: readonly { importer: string | undefined; plugin: Plugin; source: string }[] | null, customOptions: CustomPluginOptions | undefined, isEntry: boolean, - assertions: Record + attributes: Record ): Promise { const pluginResult = await resolveIdViaPlugins( source, @@ -24,7 +24,7 @@ export async function resolveId( skip, customOptions, isEntry, - assertions + attributes ); if (pluginResult != null) { diff --git a/src/utils/resolveIdViaPlugins.ts b/src/utils/resolveIdViaPlugins.ts index 6934dcc23..afe96a821 100644 --- a/src/utils/resolveIdViaPlugins.ts +++ b/src/utils/resolveIdViaPlugins.ts @@ -11,7 +11,7 @@ export function resolveIdViaPlugins( skip: readonly { importer: string | undefined; plugin: Plugin; source: string }[] | null, customOptions: CustomPluginOptions | undefined, isEntry: boolean, - assertions: Record + attributes: Record ): Promise<[NonNullable, Plugin] | null> { let skipped: Set | null = null; let replaceContext: ReplaceContext | null = null; @@ -24,20 +24,20 @@ export function resolveIdViaPlugins( } replaceContext = (pluginContext, plugin): PluginContext => ({ ...pluginContext, - resolve: (source, importer, { assertions, custom, isEntry, skipSelf } = BLANK) => + resolve: (source, importer, { attributes, custom, isEntry, skipSelf } = BLANK) => moduleLoaderResolveId( source, importer, custom, isEntry, - assertions || EMPTY_OBJECT, + attributes || EMPTY_OBJECT, skipSelf ? [...skip, { importer, plugin, source }] : skip ) }); } return pluginDriver.hookFirstAndGetPlugin( 'resolveId', - [source, importer, { assertions, custom: customOptions, isEntry }], + [source, importer, { attributes, custom: customOptions, isEntry }], replaceContext, skipped ); diff --git a/src/utils/treeshakeNode.ts b/src/utils/treeshakeNode.ts index 47375d870..4bc767a64 100644 --- a/src/utils/treeshakeNode.ts +++ b/src/utils/treeshakeNode.ts @@ -1,27 +1,7 @@ import type MagicString from 'magic-string'; -import * as NodeType from '../ast/nodes/NodeType'; import type { Node } from '../ast/nodes/shared/Node'; export function treeshakeNode(node: Node, code: MagicString, start: number, end: number): void { code.remove(start, end); - if (node.annotations) { - for (const annotation of node.annotations) { - if (annotation.start < start) { - code.remove(annotation.start, annotation.end); - } else { - return; - } - } - } -} - -export function removeAnnotations(node: Node, code: MagicString): void { - if (!node.annotations && node.parent.type === NodeType.ExpressionStatement) { - node = node.parent as Node; - } - if (node.annotations) { - for (const annotation of node.annotations) { - code.remove(annotation.start, annotation.end); - } - } + node.removeAnnotations(code); } diff --git a/src/utils/urls.ts b/src/utils/urls.ts index 9701bae0d..fbfffa918 100644 --- a/src/utils/urls.ts +++ b/src/utils/urls.ts @@ -16,6 +16,8 @@ export const URL_OUTPUT_DYNAMICIMPORTFUNCTION = 'configuration-options/#output-dynamicimportfunction'; export const URL_OUTPUT_EXPORTS = 'configuration-options/#output-exports'; export const URL_OUTPUT_EXTEND = 'configuration-options/#output-extend'; +export const URL_OUTPUT_EXTERNALIMPORTATTRIBUTES = + 'configuration-options/#output-externalimportattributes'; export const URL_OUTPUT_FORMAT = 'configuration-options/#output-format'; export const URL_OUTPUT_GENERATEDCODE = 'configuration-options/#output-generatedcode'; export const URL_OUTPUT_EXPERIMENTALDEEPCHUNKOPTIMIZATION = diff --git a/test/browser/index.js b/test/browser/index.js index 2167a4210..dd06cc691 100644 --- a/test/browser/index.js +++ b/test/browser/index.js @@ -1,10 +1,13 @@ // since we don't run the browser tests in an actual browser, we need to make `performance` // globally accessible same as in the browser. this can be removed once `performance` is // available globally in all supported platforms. [currently global for node.js v16+]. -// @ts-expect-error ignore +const { readFile } = require('node:fs/promises'); +const { basename, resolve } = require('node:path'); + global.performance = require('node:perf_hooks').performance; -const { basename, resolve } = require('node:path'); +global.fetch = url => readFile(url.href.replace('file://', '')); + const fixturify = require('fixturify'); /** @@ -69,7 +72,7 @@ runTestSuiteWithSamples( } assertOutputMatches(output, directory); } - ); + ).timeout(30_000); } ); diff --git a/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_config.js b/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_config.js index 23c912f99..c6e1913fd 100644 --- a/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_config.js +++ b/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_config.js @@ -26,7 +26,7 @@ module.exports = defineTest({ buildEnd() { assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(ID_MAIN))), { id: ID_MAIN, - assertions: {}, + attributes: {}, ast: { type: 'Program', start: 0, @@ -36,6 +36,7 @@ module.exports = defineTest({ type: 'ImportDeclaration', start: 0, end: 30, + source: { type: 'Literal', start: 22, end: 29, raw: "'./lib'", value: './lib' }, specifiers: [ { type: 'ImportSpecifier', @@ -45,7 +46,7 @@ module.exports = defineTest({ local: { type: 'Identifier', start: 9, end: 14, name: 'value' } } ], - source: { type: 'Literal', start: 22, end: 29, value: './lib', raw: "'./lib'" } + attributes: [] }, { type: 'ExpressionStatement', @@ -55,16 +56,16 @@ module.exports = defineTest({ type: 'CallExpression', start: 31, end: 49, + arguments: [{ type: 'Identifier', start: 43, end: 48, name: 'value' }], callee: { type: 'MemberExpression', start: 31, end: 42, - object: { type: 'Identifier', start: 31, end: 38, name: 'console' }, - property: { type: 'Identifier', start: 39, end: 42, name: 'log' }, computed: false, - optional: false + object: { type: 'Identifier', start: 31, end: 38, name: 'console' }, + optional: false, + property: { type: 'Identifier', start: 39, end: 42, name: 'log' } }, - arguments: [{ type: 'Identifier', start: 43, end: 48, name: 'value' }], optional: false } } @@ -85,7 +86,7 @@ module.exports = defineTest({ implicitlyLoadedBefore: [], importedIdResolutions: [ { - assertions: {}, + attributes: {}, external: false, id: ID_LIB, meta: {}, @@ -104,7 +105,7 @@ module.exports = defineTest({ }); assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(ID_DEP))), { id: ID_DEP, - assertions: {}, + attributes: {}, ast: { type: 'Program', start: 0, @@ -114,6 +115,7 @@ module.exports = defineTest({ type: 'ImportDeclaration', start: 0, end: 30, + source: { type: 'Literal', start: 22, end: 29, raw: "'./lib'", value: './lib' }, specifiers: [ { type: 'ImportSpecifier', @@ -123,7 +125,7 @@ module.exports = defineTest({ local: { type: 'Identifier', start: 9, end: 14, name: 'value' } } ], - source: { type: 'Literal', start: 22, end: 29, value: './lib', raw: "'./lib'" } + attributes: [] }, { type: 'ExpressionStatement', @@ -133,16 +135,16 @@ module.exports = defineTest({ type: 'CallExpression', start: 31, end: 49, + arguments: [{ type: 'Identifier', start: 43, end: 48, name: 'value' }], callee: { type: 'MemberExpression', start: 31, end: 42, - object: { type: 'Identifier', start: 31, end: 38, name: 'console' }, - property: { type: 'Identifier', start: 39, end: 42, name: 'log' }, computed: false, - optional: false + object: { type: 'Identifier', start: 31, end: 38, name: 'console' }, + optional: false, + property: { type: 'Identifier', start: 39, end: 42, name: 'log' } }, - arguments: [{ type: 'Identifier', start: 43, end: 48, name: 'value' }], optional: false } } @@ -163,7 +165,7 @@ module.exports = defineTest({ implicitlyLoadedBefore: [], importedIdResolutions: [ { - assertions: {}, + attributes: {}, external: false, id: ID_LIB, meta: {}, diff --git a/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_config.js b/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_config.js index 012b74b0d..972f1c1d5 100644 --- a/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_config.js +++ b/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_config.js @@ -22,7 +22,7 @@ module.exports = defineTest({ buildEnd() { assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(ID_MAIN))), { id: ID_MAIN, - assertions: {}, + attributes: {}, ast: { type: 'Program', start: 0, @@ -32,6 +32,7 @@ module.exports = defineTest({ type: 'ImportDeclaration', start: 0, end: 30, + source: { type: 'Literal', start: 22, end: 29, raw: "'./lib'", value: './lib' }, specifiers: [ { type: 'ImportSpecifier', @@ -41,7 +42,7 @@ module.exports = defineTest({ local: { type: 'Identifier', start: 9, end: 14, name: 'value' } } ], - source: { type: 'Literal', start: 22, end: 29, value: './lib', raw: "'./lib'" } + attributes: [] }, { type: 'ExpressionStatement', @@ -51,16 +52,16 @@ module.exports = defineTest({ type: 'CallExpression', start: 31, end: 49, + arguments: [{ type: 'Identifier', start: 43, end: 48, name: 'value' }], callee: { type: 'MemberExpression', start: 31, end: 42, - object: { type: 'Identifier', start: 31, end: 38, name: 'console' }, - property: { type: 'Identifier', start: 39, end: 42, name: 'log' }, computed: false, - optional: false + object: { type: 'Identifier', start: 31, end: 38, name: 'console' }, + optional: false, + property: { type: 'Identifier', start: 39, end: 42, name: 'log' } }, - arguments: [{ type: 'Identifier', start: 43, end: 48, name: 'value' }], optional: false } } @@ -81,7 +82,7 @@ module.exports = defineTest({ implicitlyLoadedBefore: [], importedIdResolutions: [ { - assertions: {}, + attributes: {}, external: false, id: ID_LIB, meta: {}, @@ -100,7 +101,7 @@ module.exports = defineTest({ }); assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(ID_DEP))), { id: ID_DEP, - assertions: {}, + attributes: {}, ast: { type: 'Program', start: 0, @@ -110,6 +111,7 @@ module.exports = defineTest({ type: 'ImportDeclaration', start: 0, end: 30, + source: { type: 'Literal', start: 22, end: 29, raw: "'./lib'", value: './lib' }, specifiers: [ { type: 'ImportSpecifier', @@ -119,7 +121,7 @@ module.exports = defineTest({ local: { type: 'Identifier', start: 9, end: 14, name: 'value' } } ], - source: { type: 'Literal', start: 22, end: 29, value: './lib', raw: "'./lib'" } + attributes: [] }, { type: 'ExpressionStatement', @@ -129,16 +131,16 @@ module.exports = defineTest({ type: 'CallExpression', start: 31, end: 49, + arguments: [{ type: 'Identifier', start: 43, end: 48, name: 'value' }], callee: { type: 'MemberExpression', start: 31, end: 42, - object: { type: 'Identifier', start: 31, end: 38, name: 'console' }, - property: { type: 'Identifier', start: 39, end: 42, name: 'log' }, computed: false, - optional: false + object: { type: 'Identifier', start: 31, end: 38, name: 'console' }, + optional: false, + property: { type: 'Identifier', start: 39, end: 42, name: 'log' } }, - arguments: [{ type: 'Identifier', start: 43, end: 48, name: 'value' }], optional: false } } @@ -159,7 +161,7 @@ module.exports = defineTest({ implicitlyLoadedBefore: [], importedIdResolutions: [ { - assertions: {}, + attributes: {}, external: false, id: ID_LIB, meta: {}, diff --git a/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_config.js b/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_config.js index 0596b22ac..a75754208 100644 --- a/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_config.js +++ b/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_config.js @@ -35,7 +35,7 @@ module.exports = defineTest({ buildEnd() { assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(ID_MAIN1))), { id: ID_MAIN1, - assertions: {}, + attributes: {}, ast: { type: 'Program', start: 0, @@ -45,6 +45,7 @@ module.exports = defineTest({ type: 'ImportDeclaration', start: 0, end: 30, + source: { type: 'Literal', start: 21, end: 29, raw: "'./lib1'", value: './lib1' }, specifiers: [ { type: 'ImportSpecifier', @@ -54,12 +55,13 @@ module.exports = defineTest({ local: { type: 'Identifier', start: 9, end: 13, name: 'lib1' } } ], - source: { type: 'Literal', start: 21, end: 29, value: './lib1', raw: "'./lib1'" } + attributes: [] }, { type: 'ImportDeclaration', start: 31, end: 63, + source: { type: 'Literal', start: 53, end: 62, raw: "'./lib1b'", value: './lib1b' }, specifiers: [ { type: 'ImportSpecifier', @@ -69,12 +71,13 @@ module.exports = defineTest({ local: { type: 'Identifier', start: 40, end: 45, name: 'lib1b' } } ], - source: { type: 'Literal', start: 53, end: 62, value: './lib1b', raw: "'./lib1b'" } + attributes: [] }, { type: 'ImportDeclaration', start: 64, end: 94, + source: { type: 'Literal', start: 85, end: 93, raw: "'./lib2'", value: './lib2' }, specifiers: [ { type: 'ImportSpecifier', @@ -84,7 +87,7 @@ module.exports = defineTest({ local: { type: 'Identifier', start: 73, end: 77, name: 'lib2' } } ], - source: { type: 'Literal', start: 85, end: 93, value: './lib2', raw: "'./lib2'" } + attributes: [] }, { type: 'ExpressionStatement', @@ -94,21 +97,21 @@ module.exports = defineTest({ type: 'CallExpression', start: 95, end: 135, + arguments: [ + { type: 'Literal', start: 107, end: 114, raw: "'main1'", value: 'main1' }, + { type: 'Identifier', start: 116, end: 120, name: 'lib1' }, + { type: 'Identifier', start: 123, end: 128, name: 'lib1b' }, + { type: 'Identifier', start: 130, end: 134, name: 'lib2' } + ], callee: { type: 'MemberExpression', start: 95, end: 106, - object: { type: 'Identifier', start: 95, end: 102, name: 'console' }, - property: { type: 'Identifier', start: 103, end: 106, name: 'log' }, computed: false, - optional: false + object: { type: 'Identifier', start: 95, end: 102, name: 'console' }, + optional: false, + property: { type: 'Identifier', start: 103, end: 106, name: 'log' } }, - arguments: [ - { type: 'Literal', start: 107, end: 114, value: 'main1', raw: "'main1'" }, - { type: 'Identifier', start: 116, end: 120, name: 'lib1' }, - { type: 'Identifier', start: 123, end: 128, name: 'lib1b' }, - { type: 'Identifier', start: 130, end: 134, name: 'lib2' } - ], optional: false } } @@ -129,7 +132,7 @@ module.exports = defineTest({ implicitlyLoadedBefore: [ID_DEP], importedIdResolutions: [ { - assertions: {}, + attributes: {}, external: false, id: ID_LIB1, meta: {}, @@ -138,7 +141,7 @@ module.exports = defineTest({ syntheticNamedExports: false }, { - assertions: {}, + attributes: {}, external: false, id: ID_LIB1B, meta: {}, @@ -147,7 +150,7 @@ module.exports = defineTest({ syntheticNamedExports: false }, { - assertions: {}, + attributes: {}, external: false, id: ID_LIB2, meta: {}, @@ -166,7 +169,7 @@ module.exports = defineTest({ }); assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(ID_MAIN2))), { id: ID_MAIN2, - assertions: {}, + attributes: {}, ast: { type: 'Program', start: 0, @@ -176,6 +179,7 @@ module.exports = defineTest({ type: 'ImportDeclaration', start: 0, end: 30, + source: { type: 'Literal', start: 21, end: 29, raw: "'./lib1'", value: './lib1' }, specifiers: [ { type: 'ImportSpecifier', @@ -185,12 +189,13 @@ module.exports = defineTest({ local: { type: 'Identifier', start: 9, end: 13, name: 'lib1' } } ], - source: { type: 'Literal', start: 21, end: 29, value: './lib1', raw: "'./lib1'" } + attributes: [] }, { type: 'ImportDeclaration', start: 31, end: 63, + source: { type: 'Literal', start: 53, end: 62, raw: "'./lib1b'", value: './lib1b' }, specifiers: [ { type: 'ImportSpecifier', @@ -200,12 +205,13 @@ module.exports = defineTest({ local: { type: 'Identifier', start: 40, end: 45, name: 'lib1b' } } ], - source: { type: 'Literal', start: 53, end: 62, value: './lib1b', raw: "'./lib1b'" } + attributes: [] }, { type: 'ImportDeclaration', start: 64, end: 94, + source: { type: 'Literal', start: 85, end: 93, raw: "'./lib3'", value: './lib3' }, specifiers: [ { type: 'ImportSpecifier', @@ -215,7 +221,7 @@ module.exports = defineTest({ local: { type: 'Identifier', start: 73, end: 77, name: 'lib3' } } ], - source: { type: 'Literal', start: 85, end: 93, value: './lib3', raw: "'./lib3'" } + attributes: [] }, { type: 'ExpressionStatement', @@ -225,21 +231,21 @@ module.exports = defineTest({ type: 'CallExpression', start: 95, end: 134, + arguments: [ + { type: 'Literal', start: 107, end: 114, raw: "'main2'", value: 'main2' }, + { type: 'Identifier', start: 116, end: 120, name: 'lib1' }, + { type: 'Identifier', start: 122, end: 127, name: 'lib1b' }, + { type: 'Identifier', start: 129, end: 133, name: 'lib3' } + ], callee: { type: 'MemberExpression', start: 95, end: 106, - object: { type: 'Identifier', start: 95, end: 102, name: 'console' }, - property: { type: 'Identifier', start: 103, end: 106, name: 'log' }, computed: false, - optional: false + object: { type: 'Identifier', start: 95, end: 102, name: 'console' }, + optional: false, + property: { type: 'Identifier', start: 103, end: 106, name: 'log' } }, - arguments: [ - { type: 'Literal', start: 107, end: 114, value: 'main2', raw: "'main2'" }, - { type: 'Identifier', start: 116, end: 120, name: 'lib1' }, - { type: 'Identifier', start: 122, end: 127, name: 'lib1b' }, - { type: 'Identifier', start: 129, end: 133, name: 'lib3' } - ], optional: false } } @@ -260,7 +266,7 @@ module.exports = defineTest({ implicitlyLoadedBefore: [ID_DEP], importedIdResolutions: [ { - assertions: {}, + attributes: {}, external: false, id: ID_LIB1, meta: {}, @@ -269,7 +275,7 @@ module.exports = defineTest({ syntheticNamedExports: false }, { - assertions: {}, + attributes: {}, external: false, id: ID_LIB1B, meta: {}, @@ -278,7 +284,7 @@ module.exports = defineTest({ syntheticNamedExports: false }, { - assertions: {}, + attributes: {}, external: false, id: ID_LIB3, meta: {}, @@ -297,7 +303,7 @@ module.exports = defineTest({ }); assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(ID_DEP))), { id: ID_DEP, - assertions: {}, + attributes: {}, ast: { type: 'Program', start: 0, @@ -307,6 +313,7 @@ module.exports = defineTest({ type: 'ImportDeclaration', start: 0, end: 30, + source: { type: 'Literal', start: 21, end: 29, raw: "'./lib1'", value: './lib1' }, specifiers: [ { type: 'ImportSpecifier', @@ -316,12 +323,13 @@ module.exports = defineTest({ local: { type: 'Identifier', start: 9, end: 13, name: 'lib1' } } ], - source: { type: 'Literal', start: 21, end: 29, value: './lib1', raw: "'./lib1'" } + attributes: [] }, { type: 'ImportDeclaration', start: 31, end: 61, + source: { type: 'Literal', start: 52, end: 60, raw: "'./lib2'", value: './lib2' }, specifiers: [ { type: 'ImportSpecifier', @@ -331,12 +339,13 @@ module.exports = defineTest({ local: { type: 'Identifier', start: 40, end: 44, name: 'lib2' } } ], - source: { type: 'Literal', start: 52, end: 60, value: './lib2', raw: "'./lib2'" } + attributes: [] }, { type: 'ImportDeclaration', start: 62, end: 92, + source: { type: 'Literal', start: 83, end: 91, raw: "'./lib3'", value: './lib3' }, specifiers: [ { type: 'ImportSpecifier', @@ -346,7 +355,7 @@ module.exports = defineTest({ local: { type: 'Identifier', start: 71, end: 75, name: 'lib3' } } ], - source: { type: 'Literal', start: 83, end: 91, value: './lib3', raw: "'./lib3'" } + attributes: [] }, { type: 'ExpressionStatement', @@ -356,20 +365,20 @@ module.exports = defineTest({ type: 'CallExpression', start: 93, end: 122, + arguments: [ + { type: 'Identifier', start: 105, end: 109, name: 'lib1' }, + { type: 'Identifier', start: 111, end: 115, name: 'lib2' }, + { type: 'Identifier', start: 117, end: 121, name: 'lib3' } + ], callee: { type: 'MemberExpression', start: 93, end: 104, - object: { type: 'Identifier', start: 93, end: 100, name: 'console' }, - property: { type: 'Identifier', start: 101, end: 104, name: 'log' }, computed: false, - optional: false + object: { type: 'Identifier', start: 93, end: 100, name: 'console' }, + optional: false, + property: { type: 'Identifier', start: 101, end: 104, name: 'log' } }, - arguments: [ - { type: 'Identifier', start: 105, end: 109, name: 'lib1' }, - { type: 'Identifier', start: 111, end: 115, name: 'lib2' }, - { type: 'Identifier', start: 117, end: 121, name: 'lib3' } - ], optional: false } } @@ -390,7 +399,7 @@ module.exports = defineTest({ implicitlyLoadedBefore: [], importedIdResolutions: [ { - assertions: {}, + attributes: {}, external: false, id: ID_LIB1, meta: {}, @@ -399,7 +408,7 @@ module.exports = defineTest({ syntheticNamedExports: false }, { - assertions: {}, + attributes: {}, external: false, id: ID_LIB2, meta: {}, @@ -408,7 +417,7 @@ module.exports = defineTest({ syntheticNamedExports: false }, { - assertions: {}, + attributes: {}, external: false, id: ID_LIB3, meta: {}, diff --git a/test/chunking-form/samples/implicit-dependencies/single-dependency/_config.js b/test/chunking-form/samples/implicit-dependencies/single-dependency/_config.js index ef874d950..7a16431e4 100644 --- a/test/chunking-form/samples/implicit-dependencies/single-dependency/_config.js +++ b/test/chunking-form/samples/implicit-dependencies/single-dependency/_config.js @@ -21,7 +21,7 @@ module.exports = defineTest({ buildEnd() { assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(ID_MAIN))), { id: ID_MAIN, - assertions: {}, + attributes: {}, ast: { type: 'Program', start: 0, @@ -31,6 +31,7 @@ module.exports = defineTest({ type: 'ImportDeclaration', start: 0, end: 30, + source: { type: 'Literal', start: 22, end: 29, raw: "'./lib'", value: './lib' }, specifiers: [ { type: 'ImportSpecifier', @@ -40,7 +41,7 @@ module.exports = defineTest({ local: { type: 'Identifier', start: 9, end: 14, name: 'value' } } ], - source: { type: 'Literal', start: 22, end: 29, value: './lib', raw: "'./lib'" } + attributes: [] }, { type: 'ExpressionStatement', @@ -50,16 +51,16 @@ module.exports = defineTest({ type: 'CallExpression', start: 31, end: 49, + arguments: [{ type: 'Identifier', start: 43, end: 48, name: 'value' }], callee: { type: 'MemberExpression', start: 31, end: 42, - object: { type: 'Identifier', start: 31, end: 38, name: 'console' }, - property: { type: 'Identifier', start: 39, end: 42, name: 'log' }, computed: false, - optional: false + object: { type: 'Identifier', start: 31, end: 38, name: 'console' }, + optional: false, + property: { type: 'Identifier', start: 39, end: 42, name: 'log' } }, - arguments: [{ type: 'Identifier', start: 43, end: 48, name: 'value' }], optional: false } } @@ -80,7 +81,7 @@ module.exports = defineTest({ implicitlyLoadedBefore: [ID_DEP], importedIdResolutions: [ { - assertions: {}, + attributes: {}, external: false, id: ID_LIB, meta: {}, @@ -99,7 +100,7 @@ module.exports = defineTest({ }); assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(ID_DEP))), { id: ID_DEP, - assertions: {}, + attributes: {}, ast: { type: 'Program', start: 0, @@ -109,6 +110,7 @@ module.exports = defineTest({ type: 'ImportDeclaration', start: 0, end: 30, + source: { type: 'Literal', start: 22, end: 29, raw: "'./lib'", value: './lib' }, specifiers: [ { type: 'ImportSpecifier', @@ -118,7 +120,7 @@ module.exports = defineTest({ local: { type: 'Identifier', start: 9, end: 14, name: 'value' } } ], - source: { type: 'Literal', start: 22, end: 29, value: './lib', raw: "'./lib'" } + attributes: [] }, { type: 'ExpressionStatement', @@ -128,16 +130,16 @@ module.exports = defineTest({ type: 'CallExpression', start: 31, end: 49, + arguments: [{ type: 'Identifier', start: 43, end: 48, name: 'value' }], callee: { type: 'MemberExpression', start: 31, end: 42, - object: { type: 'Identifier', start: 31, end: 38, name: 'console' }, - property: { type: 'Identifier', start: 39, end: 42, name: 'log' }, computed: false, - optional: false + object: { type: 'Identifier', start: 31, end: 38, name: 'console' }, + optional: false, + property: { type: 'Identifier', start: 39, end: 42, name: 'log' } }, - arguments: [{ type: 'Identifier', start: 43, end: 48, name: 'value' }], optional: false } } @@ -158,7 +160,7 @@ module.exports = defineTest({ implicitlyLoadedBefore: [], importedIdResolutions: [ { - assertions: {}, + attributes: {}, external: false, id: ID_LIB, meta: {}, diff --git a/test/cli/samples/validate/_config.js b/test/cli/samples/validate/_config.js index 3b410ed0d..823456c59 100644 --- a/test/cli/samples/validate/_config.js +++ b/test/cli/samples/validate/_config.js @@ -8,7 +8,7 @@ module.exports = defineTest({ stderr: stderr => assertIncludes( stderr, - `(!) Chunk "out.js" is not valid JavaScript: Unterminated comment (3:20). + `(!) Chunk "out.js" is not valid JavaScript: Unterminated block comment. out.js (3:20) 1: console.log(2 ); 2: diff --git a/test/cli/samples/watch/bundle-error/_config.js b/test/cli/samples/watch/bundle-error/_config.js index 09425be26..588f9ed50 100644 --- a/test/cli/samples/watch/bundle-error/_config.js +++ b/test/cli/samples/watch/bundle-error/_config.js @@ -16,7 +16,7 @@ module.exports = defineTest({ setTimeout(() => unlinkSync(mainFile), 300); }, abortOnStderr(data) { - if (data.includes('[!] RollupError: Unexpected token')) { + if (data.includes('[!] RollupError: Expression expected')) { setTimeout(() => atomicWriteFileSync(mainFile, 'export default 42;'), 500); return false; } diff --git a/test/form/index.js b/test/form/index.js index 2305d78c8..c14e97413 100644 --- a/test/form/index.js +++ b/test/form/index.js @@ -6,7 +6,12 @@ const { basename, resolve } = require('node:path'); */ // @ts-expect-error not included in types const { rollup } = require('../../dist/rollup'); -const { compareLogs, normaliseOutput, runTestSuiteWithSamples } = require('../utils.js'); +const { + compareLogs, + normaliseOutput, + runTestSuiteWithSamples, + verifyAstPlugin +} = require('../utils.js'); const FORMATS = ['amd', 'cjs', 'system', 'es', 'iife', 'umd']; @@ -43,7 +48,15 @@ runTestSuiteWithSamples( } }, strictDeprecations: true, - ...config.options + ...config.options, + plugins: + config.verifyAst === false + ? config.options?.plugins + : config.options?.plugins === undefined + ? verifyAstPlugin + : Array.isArray(config.options.plugins) + ? [...config.options.plugins, verifyAstPlugin] + : config.options.plugins })); await generateAndTestBundle( bundle, diff --git a/test/form/samples/absolute-path-resolver/a.js b/test/form/samples/absolute-path-resolver/a.js index 3223031dc..7ad3ccb5b 100644 --- a/test/form/samples/absolute-path-resolver/a.js +++ b/test/form/samples/absolute-path-resolver/a.js @@ -1,3 +1,3 @@ export var a = () => { console.log('props'); -}; \ No newline at end of file +}; diff --git a/test/form/samples/acorn-external-plugins/_config.js b/test/form/samples/acorn-external-plugins/_config.js deleted file mode 100644 index 2789b15c1..000000000 --- a/test/form/samples/acorn-external-plugins/_config.js +++ /dev/null @@ -1,8 +0,0 @@ -const jsx = require('acorn-jsx'); - -module.exports = defineTest({ - description: 'supports official acorn plugins that may rely on a shared acorn instance', - options: { - acornInjectPlugins: [jsx()] - } -}); diff --git a/test/form/samples/acorn-external-plugins/_expected.js b/test/form/samples/acorn-external-plugins/_expected.js deleted file mode 100644 index d8d373310..000000000 --- a/test/form/samples/acorn-external-plugins/_expected.js +++ /dev/null @@ -1,3 +0,0 @@ -var main =
This is not JavaScript
; - -export { main as default }; diff --git a/test/form/samples/acorn-external-plugins/main.js b/test/form/samples/acorn-external-plugins/main.js deleted file mode 100644 index 5113b9c30..000000000 --- a/test/form/samples/acorn-external-plugins/main.js +++ /dev/null @@ -1 +0,0 @@ -export default
This is not JavaScript
; diff --git a/test/form/samples/big-int/_config.js b/test/form/samples/big-int/_config.js index cdd9c2424..256ffa6ca 100644 --- a/test/form/samples/big-int/_config.js +++ b/test/form/samples/big-int/_config.js @@ -1,3 +1,3 @@ module.exports = defineTest({ - description: 'supports bigint via acorn plugin' + description: 'supports bigint' }); diff --git a/test/form/samples/custom-dynamic-import-no-interop/_config.js b/test/form/samples/custom-dynamic-import-no-interop/_config.js index 910798c4d..91f8f55c3 100644 --- a/test/form/samples/custom-dynamic-import-no-interop/_config.js +++ b/test/form/samples/custom-dynamic-import-no-interop/_config.js @@ -5,11 +5,13 @@ module.exports = defineTest({ output: { interop: 'auto' }, - plugins: { - name: 'test', - renderDynamicImport() { - return { left: 'getIt(', right: ')' }; + plugins: [ + { + name: 'test', + renderDynamicImport() { + return { left: 'getIt(', right: ')' }; + } } - } + ] } }); diff --git a/test/form/samples/import-assertions/removes-dynamic-assertions/_config.js b/test/form/samples/deprecated/removes-dynamic-assertions/_config.js similarity index 88% rename from test/form/samples/import-assertions/removes-dynamic-assertions/_config.js rename to test/form/samples/deprecated/removes-dynamic-assertions/_config.js index 5330ee734..cc9d7dadd 100644 --- a/test/form/samples/import-assertions/removes-dynamic-assertions/_config.js +++ b/test/form/samples/deprecated/removes-dynamic-assertions/_config.js @@ -1,7 +1,8 @@ module.exports = defineTest({ description: 'keep import assertions for dynamic imports', - expectedWarnings: ['UNRESOLVED_IMPORT'], + expectedWarnings: ['UNRESOLVED_IMPORT', 'DEPRECATED_FEATURE'], options: { + strictDeprecations: false, external: id => { if (id === 'unresolved') return null; return true; diff --git a/test/form/samples/import-assertions/removes-dynamic-assertions/_expected.js b/test/form/samples/deprecated/removes-dynamic-assertions/_expected.js similarity index 100% rename from test/form/samples/import-assertions/removes-dynamic-assertions/_expected.js rename to test/form/samples/deprecated/removes-dynamic-assertions/_expected.js diff --git a/test/form/samples/import-assertions/keep-dynamic-assertions/main.js b/test/form/samples/deprecated/removes-dynamic-assertions/main.js similarity index 100% rename from test/form/samples/import-assertions/keep-dynamic-assertions/main.js rename to test/form/samples/deprecated/removes-dynamic-assertions/main.js diff --git a/test/form/samples/import-assertions/removes-static-assertions/_config.js b/test/form/samples/deprecated/removes-static-attributes/_config.js similarity index 72% rename from test/form/samples/import-assertions/removes-static-assertions/_config.js rename to test/form/samples/deprecated/removes-static-attributes/_config.js index 8f8d7c07f..0fae6d851 100644 --- a/test/form/samples/import-assertions/removes-static-assertions/_config.js +++ b/test/form/samples/deprecated/removes-static-attributes/_config.js @@ -1,7 +1,8 @@ module.exports = defineTest({ description: 'keeps any import assertions on input', - expectedWarnings: ['UNRESOLVED_IMPORT'], + expectedWarnings: ['UNRESOLVED_IMPORT', 'DEPRECATED_FEATURE'], options: { + strictDeprecations: false, external: id => { if (id === 'unresolved') return null; return true; diff --git a/test/form/samples/import-assertions/removes-static-assertions/_expected.js b/test/form/samples/deprecated/removes-static-attributes/_expected.js similarity index 100% rename from test/form/samples/import-assertions/removes-static-assertions/_expected.js rename to test/form/samples/deprecated/removes-static-attributes/_expected.js diff --git a/test/form/samples/import-assertions/keeps-static-assertions/main.js b/test/form/samples/deprecated/removes-static-attributes/main.js similarity index 100% rename from test/form/samples/import-assertions/keeps-static-assertions/main.js rename to test/form/samples/deprecated/removes-static-attributes/main.js diff --git a/test/form/samples/emit-asset-file/_config.js b/test/form/samples/emit-asset-file/_config.js index 8086990f7..24bca655e 100644 --- a/test/form/samples/emit-asset-file/_config.js +++ b/test/form/samples/emit-asset-file/_config.js @@ -5,39 +5,41 @@ const path = require('node:path'); module.exports = defineTest({ description: 'supports emitting assets from plugin hooks', options: { - plugins: { - name: 'test', - resolveId(id, importee) { - if (id.endsWith('.svg')) { - return path.resolve(path.dirname(importee), id); + plugins: [ + { + name: 'test', + resolveId(id, importee) { + if (id.endsWith('.svg')) { + return path.resolve(path.dirname(importee), id); + } + }, + load(id) { + if (id.endsWith('.svg')) { + return `export default import.meta.ROLLUP_FILE_URL_${this.emitFile({ + type: 'asset', + name: path.basename(id), + source: readFileSync(id) + })};`; + } + }, + generateBundle(options, outputBundle) { + const keys = Object.keys(outputBundle); + assert.strictEqual(keys.length, 2); + assert.strictEqual(keys[0], 'assets/logo-a2a2cdc4.svg'); + const asset = outputBundle[keys[0]]; + assert.strictEqual(asset.fileName, 'assets/logo-a2a2cdc4.svg'); + if (asset.type !== 'asset') { + throw new Error(`Unexpected asset type ${asset.type}.`); + } + /** @type {any} */ + const source = asset.source; + assert.ok( + source.equals(readFileSync(path.resolve(__dirname, 'logo.svg'))), + 'asset has correct source' + ); + assert.ok(keys[1].endsWith('.js'), `${keys[1]} ends with ".js"`); } - }, - load(id) { - if (id.endsWith('.svg')) { - return `export default import.meta.ROLLUP_FILE_URL_${this.emitFile({ - type: 'asset', - name: path.basename(id), - source: readFileSync(id) - })};`; - } - }, - generateBundle(options, outputBundle) { - const keys = Object.keys(outputBundle); - assert.strictEqual(keys.length, 2); - assert.strictEqual(keys[0], 'assets/logo-a2a2cdc4.svg'); - const asset = outputBundle[keys[0]]; - assert.strictEqual(asset.fileName, 'assets/logo-a2a2cdc4.svg'); - if (asset.type !== 'asset') { - throw new Error(`Unexpected asset type ${asset.type}.`); - } - /** @type {any} */ - const source = asset.source; - assert.ok( - source.equals(readFileSync(path.resolve(__dirname, 'logo.svg'))), - 'asset has correct source' - ); - assert.ok(keys[1].endsWith('.js'), `${keys[1]} ends with ".js"`); } - } + ] } }); diff --git a/test/form/samples/emit-file-tree-shaken-access/_config.js b/test/form/samples/emit-file-tree-shaken-access/_config.js index 124940e78..03475f0ea 100644 --- a/test/form/samples/emit-file-tree-shaken-access/_config.js +++ b/test/form/samples/emit-file-tree-shaken-access/_config.js @@ -4,22 +4,24 @@ const path = require('node:path'); module.exports = defineTest({ description: 'does not include format globals when tree-shaking an asset access', options: { - plugins: { - name: 'test', - resolveId(id, importee) { - if (id.endsWith('.svg')) { - return path.resolve(path.dirname(importee), id); - } - }, - load(id) { - if (id.endsWith('.svg')) { - return `export default import.meta.ROLLUP_FILE_URL_${this.emitFile({ - type: 'asset', - name: path.basename(id), - source: readFileSync(id) - })};`; + plugins: [ + { + name: 'test', + resolveId(id, importee) { + if (id.endsWith('.svg')) { + return path.resolve(path.dirname(importee), id); + } + }, + load(id) { + if (id.endsWith('.svg')) { + return `export default import.meta.ROLLUP_FILE_URL_${this.emitFile({ + type: 'asset', + name: path.basename(id), + source: readFileSync(id) + })};`; + } } } - } + ] } }); diff --git a/test/form/samples/emit-uint8array-no-buffer/_config.js b/test/form/samples/emit-uint8array-no-buffer/_config.js index bdce9965b..2d77cc8a2 100644 --- a/test/form/samples/emit-uint8array-no-buffer/_config.js +++ b/test/form/samples/emit-uint8array-no-buffer/_config.js @@ -9,21 +9,23 @@ module.exports = defineTest({ global.Buffer = Buffer; }, options: { - plugins: { - name: 'test', - resolveId(id) { - if (id.startsWith('asset')) { - return id; - } - }, - load(id) { - if (id.startsWith('asset')) { - return `export default import.meta.ROLLUP_FILE_URL_${this.emitFile({ - type: 'asset', - source: Uint8Array.from([...id].map(char => char.charCodeAt(0))) - })};`; + plugins: [ + { + name: 'test', + resolveId(id) { + if (id.startsWith('asset')) { + return id; + } + }, + load(id) { + if (id.startsWith('asset')) { + return `export default import.meta.ROLLUP_FILE_URL_${this.emitFile({ + type: 'asset', + source: Uint8Array.from([...id].map(char => char.charCodeAt(0))) + })};`; + } } } - } + ] } }); diff --git a/test/form/samples/entry-with-unused-synthetic-exports/_config.js b/test/form/samples/entry-with-unused-synthetic-exports/_config.js index 67dd54b20..e79ba880f 100644 --- a/test/form/samples/entry-with-unused-synthetic-exports/_config.js +++ b/test/form/samples/entry-with-unused-synthetic-exports/_config.js @@ -1,11 +1,13 @@ module.exports = defineTest({ description: 'does not include unused synthetic namespace object in entry points', options: { - plugins: { - name: 'test-plugin', - transform(code) { - return { code, syntheticNamedExports: '__moduleExports' }; + plugins: [ + { + name: 'test-plugin', + transform(code) { + return { code, syntheticNamedExports: '__moduleExports' }; + } } - } + ] } }); diff --git a/test/form/samples/export-globals/_config.js b/test/form/samples/export-globals/_config.js index 6d54b2cfe..d4fb00a05 100644 --- a/test/form/samples/export-globals/_config.js +++ b/test/form/samples/export-globals/_config.js @@ -1,6 +1,3 @@ -// Changed due to https://github.com/acornjs/acorn/issues/806 -// Consider reverting this change should this become an acorn option - module.exports = defineTest({ description: 'Supports reexports of globals with namespace access', options: { diff --git a/test/form/samples/hoisted-vars-in-dead-branches/_expected.js b/test/form/samples/hoisted-vars-in-dead-branches/_expected.js index 86e711f27..d9656038e 100644 --- a/test/form/samples/hoisted-vars-in-dead-branches/_expected.js +++ b/test/form/samples/hoisted-vars-in-dead-branches/_expected.js @@ -1,4 +1,4 @@ -var a, b; { +var b, a; { console.log(a, b); } diff --git a/test/form/samples/import-assertions/assertion-shapes/_config.js b/test/form/samples/import-assertions/assertion-shapes/_config.js deleted file mode 100644 index 4629f8754..000000000 --- a/test/form/samples/import-assertions/assertion-shapes/_config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = defineTest({ - description: 'handles special shapes of assertions', - options: { - external: () => true - } -}); diff --git a/test/form/samples/import-attributes/attribute-shapes/_config.js b/test/form/samples/import-attributes/attribute-shapes/_config.js new file mode 100644 index 000000000..e0cd94cea --- /dev/null +++ b/test/form/samples/import-attributes/attribute-shapes/_config.js @@ -0,0 +1,7 @@ +module.exports = defineTest({ + description: 'handles special shapes of attributes', + options: { + external: () => true + }, + expectedWarnings: ['INVALID_IMPORT_ATTRIBUTE'] +}); diff --git a/test/form/samples/import-assertions/assertion-shapes/_expected.js b/test/form/samples/import-attributes/attribute-shapes/_expected.js similarity index 100% rename from test/form/samples/import-assertions/assertion-shapes/_expected.js rename to test/form/samples/import-attributes/attribute-shapes/_expected.js diff --git a/test/form/samples/import-assertions/assertion-shapes/main.js b/test/form/samples/import-attributes/attribute-shapes/main.js similarity index 100% rename from test/form/samples/import-assertions/assertion-shapes/main.js rename to test/form/samples/import-attributes/attribute-shapes/main.js diff --git a/test/form/samples/import-assertions/keep-dynamic-assertions/_config.js b/test/form/samples/import-attributes/keep-dynamic-attributes/_config.js similarity index 91% rename from test/form/samples/import-assertions/keep-dynamic-assertions/_config.js rename to test/form/samples/import-attributes/keep-dynamic-attributes/_config.js index 6cd9a1555..a75f18189 100644 --- a/test/form/samples/import-assertions/keep-dynamic-assertions/_config.js +++ b/test/form/samples/import-attributes/keep-dynamic-attributes/_config.js @@ -1,5 +1,5 @@ module.exports = defineTest({ - description: 'keep import assertions for dynamic imports', + description: 'keep import attributes for dynamic imports', expectedWarnings: ['UNRESOLVED_IMPORT'], options: { external: id => { diff --git a/test/form/samples/import-assertions/keep-dynamic-assertions/_expected/amd.js b/test/form/samples/import-attributes/keep-dynamic-attributes/_expected/amd.js similarity index 100% rename from test/form/samples/import-assertions/keep-dynamic-assertions/_expected/amd.js rename to test/form/samples/import-attributes/keep-dynamic-attributes/_expected/amd.js diff --git a/test/form/samples/import-assertions/keep-dynamic-assertions/_expected/cjs.js b/test/form/samples/import-attributes/keep-dynamic-attributes/_expected/cjs.js similarity index 100% rename from test/form/samples/import-assertions/keep-dynamic-assertions/_expected/cjs.js rename to test/form/samples/import-attributes/keep-dynamic-attributes/_expected/cjs.js diff --git a/test/form/samples/import-assertions/keep-dynamic-assertions/_expected/es.js b/test/form/samples/import-attributes/keep-dynamic-attributes/_expected/es.js similarity index 100% rename from test/form/samples/import-assertions/keep-dynamic-assertions/_expected/es.js rename to test/form/samples/import-attributes/keep-dynamic-attributes/_expected/es.js diff --git a/test/form/samples/import-assertions/keep-dynamic-assertions/_expected/iife.js b/test/form/samples/import-attributes/keep-dynamic-attributes/_expected/iife.js similarity index 100% rename from test/form/samples/import-assertions/keep-dynamic-assertions/_expected/iife.js rename to test/form/samples/import-attributes/keep-dynamic-attributes/_expected/iife.js diff --git a/test/form/samples/import-assertions/keep-dynamic-assertions/_expected/system.js b/test/form/samples/import-attributes/keep-dynamic-attributes/_expected/system.js similarity index 100% rename from test/form/samples/import-assertions/keep-dynamic-assertions/_expected/system.js rename to test/form/samples/import-attributes/keep-dynamic-attributes/_expected/system.js diff --git a/test/form/samples/import-assertions/keep-dynamic-assertions/_expected/umd.js b/test/form/samples/import-attributes/keep-dynamic-attributes/_expected/umd.js similarity index 100% rename from test/form/samples/import-assertions/keep-dynamic-assertions/_expected/umd.js rename to test/form/samples/import-attributes/keep-dynamic-attributes/_expected/umd.js diff --git a/test/form/samples/import-assertions/removes-dynamic-assertions/main.js b/test/form/samples/import-attributes/keep-dynamic-attributes/main.js similarity index 100% rename from test/form/samples/import-assertions/removes-dynamic-assertions/main.js rename to test/form/samples/import-attributes/keep-dynamic-attributes/main.js diff --git a/test/form/samples/import-assertions/keeps-static-assertions/_config.js b/test/form/samples/import-attributes/keeps-static-attributes/_config.js similarity index 78% rename from test/form/samples/import-assertions/keeps-static-assertions/_config.js rename to test/form/samples/import-attributes/keeps-static-attributes/_config.js index 5dfbc1b2c..c9572989e 100644 --- a/test/form/samples/import-assertions/keeps-static-assertions/_config.js +++ b/test/form/samples/import-attributes/keeps-static-attributes/_config.js @@ -1,5 +1,5 @@ module.exports = defineTest({ - description: 'keeps any import assertions on input', + description: 'keeps any import attributes on input', expectedWarnings: ['UNRESOLVED_IMPORT'], options: { external: id => { diff --git a/test/form/samples/import-assertions/keeps-static-assertions/_expected/amd.js b/test/form/samples/import-attributes/keeps-static-attributes/_expected/amd.js similarity index 100% rename from test/form/samples/import-assertions/keeps-static-assertions/_expected/amd.js rename to test/form/samples/import-attributes/keeps-static-attributes/_expected/amd.js diff --git a/test/form/samples/import-assertions/keeps-static-assertions/_expected/cjs.js b/test/form/samples/import-attributes/keeps-static-attributes/_expected/cjs.js similarity index 100% rename from test/form/samples/import-assertions/keeps-static-assertions/_expected/cjs.js rename to test/form/samples/import-attributes/keeps-static-attributes/_expected/cjs.js diff --git a/test/form/samples/import-assertions/keeps-static-assertions/_expected/es.js b/test/form/samples/import-attributes/keeps-static-attributes/_expected/es.js similarity index 100% rename from test/form/samples/import-assertions/keeps-static-assertions/_expected/es.js rename to test/form/samples/import-attributes/keeps-static-attributes/_expected/es.js diff --git a/test/form/samples/import-assertions/keeps-static-assertions/_expected/iife.js b/test/form/samples/import-attributes/keeps-static-attributes/_expected/iife.js similarity index 100% rename from test/form/samples/import-assertions/keeps-static-assertions/_expected/iife.js rename to test/form/samples/import-attributes/keeps-static-attributes/_expected/iife.js diff --git a/test/form/samples/import-assertions/keeps-static-assertions/_expected/system.js b/test/form/samples/import-attributes/keeps-static-attributes/_expected/system.js similarity index 100% rename from test/form/samples/import-assertions/keeps-static-assertions/_expected/system.js rename to test/form/samples/import-attributes/keeps-static-attributes/_expected/system.js diff --git a/test/form/samples/import-assertions/keeps-static-assertions/_expected/umd.js b/test/form/samples/import-attributes/keeps-static-attributes/_expected/umd.js similarity index 100% rename from test/form/samples/import-assertions/keeps-static-assertions/_expected/umd.js rename to test/form/samples/import-attributes/keeps-static-attributes/_expected/umd.js diff --git a/test/form/samples/import-assertions/removes-static-assertions/main.js b/test/form/samples/import-attributes/keeps-static-attributes/main.js similarity index 100% rename from test/form/samples/import-assertions/removes-static-assertions/main.js rename to test/form/samples/import-attributes/keeps-static-attributes/main.js diff --git a/test/form/samples/import-assertions/plugin-assertions-resolvedynamicimport/_config.js b/test/form/samples/import-attributes/plugin-attributes-resolvedynamicimport/_config.js similarity index 71% rename from test/form/samples/import-assertions/plugin-assertions-resolvedynamicimport/_config.js rename to test/form/samples/import-attributes/plugin-attributes-resolvedynamicimport/_config.js index a0ec44b6b..77e37956d 100644 --- a/test/form/samples/import-assertions/plugin-assertions-resolvedynamicimport/_config.js +++ b/test/form/samples/import-attributes/plugin-attributes-resolvedynamicimport/_config.js @@ -1,13 +1,13 @@ module.exports = defineTest({ - description: 'allows plugins to read and write import assertions in resolveDynamicImport', + description: 'allows plugins to read and write import attributes in resolveDynamicImport', options: { plugins: [ { name: 'test', - resolveDynamicImport(specifier, importer, { assertions }) { + resolveDynamicImport(specifier, importer, { attributes }) { const resolutionOptions = { external: true, - assertions: Object.fromEntries(Object.keys(assertions).map(key => [key, 'changed'])) + attributes: Object.fromEntries(Object.keys(attributes).map(key => [key, 'changed'])) }; if (typeof specifier === 'object') { if (specifier.type === 'TemplateLiteral') { diff --git a/test/form/samples/import-assertions/plugin-assertions-resolvedynamicimport/_expected.js b/test/form/samples/import-attributes/plugin-attributes-resolvedynamicimport/_expected.js similarity index 100% rename from test/form/samples/import-assertions/plugin-assertions-resolvedynamicimport/_expected.js rename to test/form/samples/import-attributes/plugin-attributes-resolvedynamicimport/_expected.js diff --git a/test/form/samples/import-assertions/plugin-assertions-resolvedynamicimport/main.js b/test/form/samples/import-attributes/plugin-attributes-resolvedynamicimport/main.js similarity index 100% rename from test/form/samples/import-assertions/plugin-assertions-resolvedynamicimport/main.js rename to test/form/samples/import-attributes/plugin-attributes-resolvedynamicimport/main.js diff --git a/test/form/samples/import-assertions/plugin-assertions-resolveid/_config.js b/test/form/samples/import-attributes/plugin-attributes-resolveid/_config.js similarity index 56% rename from test/form/samples/import-assertions/plugin-assertions-resolveid/_config.js rename to test/form/samples/import-attributes/plugin-attributes-resolveid/_config.js index 53b921dda..1b61ac24c 100644 --- a/test/form/samples/import-assertions/plugin-assertions-resolveid/_config.js +++ b/test/form/samples/import-attributes/plugin-attributes-resolveid/_config.js @@ -1,15 +1,15 @@ module.exports = defineTest({ - description: 'allows plugins to read and write import assertions in resolveId', + description: 'allows plugins to read and write import attributes in resolveId', options: { output: { name: 'bundle' }, plugins: [ { name: 'test', - resolveId(source, importer, { assertions, isEntry }) { + resolveId(source, importer, { attributes, isEntry }) { return { id: source, external: !isEntry, - assertions: Object.fromEntries(Object.keys(assertions).map(key => [key, 'changed'])) + attributes: Object.fromEntries(Object.keys(attributes).map(key => [key, 'changed'])) }; } } diff --git a/test/form/samples/import-assertions/plugin-assertions-resolveid/_expected.js b/test/form/samples/import-attributes/plugin-attributes-resolveid/_expected.js similarity index 100% rename from test/form/samples/import-assertions/plugin-assertions-resolveid/_expected.js rename to test/form/samples/import-attributes/plugin-attributes-resolveid/_expected.js diff --git a/test/form/samples/import-assertions/plugin-assertions-resolveid/main.js b/test/form/samples/import-attributes/plugin-attributes-resolveid/main.js similarity index 100% rename from test/form/samples/import-assertions/plugin-assertions-resolveid/main.js rename to test/form/samples/import-attributes/plugin-attributes-resolveid/main.js diff --git a/test/form/samples/import-attributes/removes-dynamic-attributes/_config.js b/test/form/samples/import-attributes/removes-dynamic-attributes/_config.js new file mode 100644 index 000000000..0c8e6bfc1 --- /dev/null +++ b/test/form/samples/import-attributes/removes-dynamic-attributes/_config.js @@ -0,0 +1,29 @@ +module.exports = defineTest({ + description: 'keep import attributes for dynamic imports', + expectedWarnings: ['UNRESOLVED_IMPORT'], + options: { + external: id => { + if (id === 'unresolved') return null; + return true; + }, + plugins: [ + { + name: 'test', + resolveDynamicImport(specifier) { + if (typeof specifier === 'object') { + if (specifier.type === 'TemplateLiteral') { + return "'resolvedString'"; + } + if (specifier.type === 'BinaryExpression') { + return { id: 'resolved-id', external: true }; + } + } else if (specifier === 'external-resolved') { + return { id: 'resolved-different', external: true }; + } + return null; + } + } + ], + output: { externalImportAttributes: false } + } +}); diff --git a/test/form/samples/import-attributes/removes-dynamic-attributes/_expected.js b/test/form/samples/import-attributes/removes-dynamic-attributes/_expected.js new file mode 100644 index 000000000..2d4172646 --- /dev/null +++ b/test/form/samples/import-attributes/removes-dynamic-attributes/_expected.js @@ -0,0 +1,6 @@ +import('external'); +import(globalThis.unknown); +import('resolvedString'); +import('resolved-id'); +import('resolved-different'); +import('unresolved'); diff --git a/test/form/samples/import-attributes/removes-dynamic-attributes/main.js b/test/form/samples/import-attributes/removes-dynamic-attributes/main.js new file mode 100644 index 000000000..38bfed638 --- /dev/null +++ b/test/form/samples/import-attributes/removes-dynamic-attributes/main.js @@ -0,0 +1,6 @@ +import('external', { assert: { type: 'special' } }); +import(globalThis.unknown, { assert: { type: 'special' } }); +import(`external-${globalThis.unknown}`, { assert: { type: 'special' } }); +import('external' + globalThis.unknown, { assert: { type: 'special' } }); +import('external-resolved', { assert: { type: 'special' } }); +import('unresolved', { assert: { type: 'special' } }); diff --git a/test/form/samples/import-attributes/removes-static-attributes/_config.js b/test/form/samples/import-attributes/removes-static-attributes/_config.js new file mode 100644 index 000000000..92caa7dde --- /dev/null +++ b/test/form/samples/import-attributes/removes-static-attributes/_config.js @@ -0,0 +1,11 @@ +module.exports = defineTest({ + description: 'keeps any import attributes on input', + expectedWarnings: ['UNRESOLVED_IMPORT'], + options: { + external: id => { + if (id === 'unresolved') return null; + return true; + }, + output: { name: 'bundle', externalImportAttributes: false } + } +}); diff --git a/test/form/samples/import-attributes/removes-static-attributes/_expected.js b/test/form/samples/import-attributes/removes-static-attributes/_expected.js new file mode 100644 index 000000000..40f55f223 --- /dev/null +++ b/test/form/samples/import-attributes/removes-static-attributes/_expected.js @@ -0,0 +1,7 @@ +import { a } from 'a'; +import * as b from 'b'; +export { c } from 'c'; +export * from 'd'; +import 'unresolved'; + +console.log(a, b, d); diff --git a/test/form/samples/import-attributes/removes-static-attributes/main.js b/test/form/samples/import-attributes/removes-static-attributes/main.js new file mode 100644 index 000000000..02b154c86 --- /dev/null +++ b/test/form/samples/import-attributes/removes-static-attributes/main.js @@ -0,0 +1,9 @@ +import { a } from 'a' assert { type: 'a', extra: 'extra' }; +import * as b from 'b' assert { type: 'b' }; +export { c } from 'c' assert { type: 'c' }; +export * from 'd' assert { type: 'd' }; +import 'unresolved' assert { type: 'e' }; + +console.log(a, b, d); + + diff --git a/test/form/samples/import-named-exported-global-with-alias/_config.js b/test/form/samples/import-named-exported-global-with-alias/_config.js index 2be7a8e17..ed0df9a03 100644 --- a/test/form/samples/import-named-exported-global-with-alias/_config.js +++ b/test/form/samples/import-named-exported-global-with-alias/_config.js @@ -1,6 +1,3 @@ -// Changed due to https://github.com/acornjs/acorn/issues/806 -// Consider reverting this change should this become an acorn option - module.exports = defineTest({ description: 'allow globals to be exported and imported', expectedWarnings: ['EMPTY_BUNDLE'], diff --git a/test/form/samples/make-absolute-externals-relative/make-relative-false/_config.js b/test/form/samples/make-absolute-externals-relative/make-relative-false/_config.js index a2498b029..753fdada4 100644 --- a/test/form/samples/make-absolute-externals-relative/make-relative-false/_config.js +++ b/test/form/samples/make-absolute-externals-relative/make-relative-false/_config.js @@ -18,30 +18,36 @@ module.exports = defineTest({ ) return true; }, - plugins: { - name: 'test', - async buildStart() { - // eslint-disable-next-line unicorn/consistent-function-scoping - const testExternal = async (source, expected) => - assert.deepStrictEqual((await this.resolve(source, ID_MAIN)).external, expected, source); + plugins: [ + { + name: 'test', + async buildStart() { + // eslint-disable-next-line unicorn/consistent-function-scoping + const testExternal = async (source, expected) => + assert.deepStrictEqual( + (await this.resolve(source, ID_MAIN)).external, + expected, + source + ); - await testExternal('./relativeUnresolved.js', true); - await testExternal('/absolute.js', 'absolute'); - await testExternal('./pluginDirect.js', true); - await testExternal('/pluginDifferentAbsolute.js', 'absolute'); - await testExternal('./pluginTrue.js', 'absolute'); - await testExternal('./pluginForceAbsolute.js', 'absolute'); - await testExternal('./pluginForceRelative.js', true); - }, - resolveId(source) { - if (source.endsWith('/pluginDirect.js')) return false; - if (source.endsWith('/pluginDifferentAbsolute.js')) return '/pluginAbsolute.js'; - if (source.endsWith('/pluginTrue.js')) return { id: '/pluginTrue.js', external: true }; - if (source.endsWith('/pluginForceAbsolute.js')) - return { id: '/pluginForceAbsolute.js', external: 'absolute' }; - if (source.endsWith('/pluginForceRelative.js')) - return { id: path.join(__dirname, 'pluginForceRelative.js'), external: 'relative' }; + await testExternal('./relativeUnresolved.js', true); + await testExternal('/absolute.js', 'absolute'); + await testExternal('./pluginDirect.js', true); + await testExternal('/pluginDifferentAbsolute.js', 'absolute'); + await testExternal('./pluginTrue.js', 'absolute'); + await testExternal('./pluginForceAbsolute.js', 'absolute'); + await testExternal('./pluginForceRelative.js', true); + }, + resolveId(source) { + if (source.endsWith('/pluginDirect.js')) return false; + if (source.endsWith('/pluginDifferentAbsolute.js')) return '/pluginAbsolute.js'; + if (source.endsWith('/pluginTrue.js')) return { id: '/pluginTrue.js', external: true }; + if (source.endsWith('/pluginForceAbsolute.js')) + return { id: '/pluginForceAbsolute.js', external: 'absolute' }; + if (source.endsWith('/pluginForceRelative.js')) + return { id: path.join(__dirname, 'pluginForceRelative.js'), external: 'relative' }; + } } - } + ] } }); diff --git a/test/form/samples/make-absolute-externals-relative/make-relative-relative/_config.js b/test/form/samples/make-absolute-externals-relative/make-relative-relative/_config.js index 5d7df6077..bfb7505bb 100644 --- a/test/form/samples/make-absolute-externals-relative/make-relative-relative/_config.js +++ b/test/form/samples/make-absolute-externals-relative/make-relative-relative/_config.js @@ -21,33 +21,39 @@ module.exports = defineTest({ ) return true; }, - plugins: { - name: 'test', - async buildStart() { - // eslint-disable-next-line unicorn/consistent-function-scoping - const testExternal = async (source, expected) => - assert.deepStrictEqual((await this.resolve(source, ID_MAIN)).external, expected, source); + plugins: [ + { + name: 'test', + async buildStart() { + // eslint-disable-next-line unicorn/consistent-function-scoping + const testExternal = async (source, expected) => + assert.deepStrictEqual( + (await this.resolve(source, ID_MAIN)).external, + expected, + source + ); - await testExternal('./relativeUnresolved.js', true); - await testExternal('./relativeMissing.js', true); - await testExternal('./relativeExisting.js', true); - await testExternal('/absolute.js', 'absolute'); - await testExternal('./pluginDirect.js', true); - await testExternal('/pluginDifferentAbsolute.js', 'absolute'); - await testExternal('./pluginTrue.js', true); - await testExternal('./pluginForceAbsolute.js', 'absolute'); - await testExternal('./pluginForceRelative.js', true); - }, - resolveId(source) { - if (source.endsWith('/pluginDirect.js')) return false; - if (source.endsWith('/pluginDifferentAbsolute.js')) return '/pluginAbsolute.js'; - if (source.endsWith('/pluginTrue.js')) - return { id: path.join(__dirname, 'pluginTrue.js'), external: true }; - if (source.endsWith('/pluginForceAbsolute.js')) - return { id: '/pluginForceAbsolute.js', external: 'absolute' }; - if (source.endsWith('/pluginForceRelative.js')) - return { id: path.join(__dirname, 'pluginForceRelative.js'), external: 'relative' }; + await testExternal('./relativeUnresolved.js', true); + await testExternal('./relativeMissing.js', true); + await testExternal('./relativeExisting.js', true); + await testExternal('/absolute.js', 'absolute'); + await testExternal('./pluginDirect.js', true); + await testExternal('/pluginDifferentAbsolute.js', 'absolute'); + await testExternal('./pluginTrue.js', true); + await testExternal('./pluginForceAbsolute.js', 'absolute'); + await testExternal('./pluginForceRelative.js', true); + }, + resolveId(source) { + if (source.endsWith('/pluginDirect.js')) return false; + if (source.endsWith('/pluginDifferentAbsolute.js')) return '/pluginAbsolute.js'; + if (source.endsWith('/pluginTrue.js')) + return { id: path.join(__dirname, 'pluginTrue.js'), external: true }; + if (source.endsWith('/pluginForceAbsolute.js')) + return { id: '/pluginForceAbsolute.js', external: 'absolute' }; + if (source.endsWith('/pluginForceRelative.js')) + return { id: path.join(__dirname, 'pluginForceRelative.js'), external: 'relative' }; + } } - } + ] } }); diff --git a/test/form/samples/make-absolute-externals-relative/make-relative-true/_config.js b/test/form/samples/make-absolute-externals-relative/make-relative-true/_config.js index 29807ce3c..d78601043 100644 --- a/test/form/samples/make-absolute-externals-relative/make-relative-true/_config.js +++ b/test/form/samples/make-absolute-externals-relative/make-relative-true/_config.js @@ -20,35 +20,41 @@ module.exports = defineTest({ ) return true; }, - plugins: { - name: 'test', - async buildStart() { - // eslint-disable-next-line unicorn/consistent-function-scoping - const testExternal = async (source, expected) => - assert.deepStrictEqual((await this.resolve(source, ID_MAIN)).external, expected, source); + plugins: [ + { + name: 'test', + async buildStart() { + // eslint-disable-next-line unicorn/consistent-function-scoping + const testExternal = async (source, expected) => + assert.deepStrictEqual( + (await this.resolve(source, ID_MAIN)).external, + expected, + source + ); - await testExternal('./relativeUnresolved.js', true); - await testExternal('./relativeMissing.js', true); - await testExternal('./relativeExisting.js', true); - await testExternal('/absolute.js', true); - await testExternal('./pluginDirect.js', true); - await testExternal('/pluginDifferentAbsolute.js', true); - await testExternal('./pluginTrue.js', true); - await testExternal('./pluginForceAbsolute.js', 'absolute'); - await testExternal('./pluginForceRelative.js', true); - }, - resolveId(source) { - if (source.endsWith('/pluginDirect.js')) return false; - if (source.endsWith('/pluginDifferentAbsolute.js')) - return path.join(__dirname, 'pluginAbsolute.js'); - if (source.endsWith('/pluginTrue.js')) - return { id: path.join(__dirname, 'pluginTrue.js'), external: true }; - if (source.endsWith('/pluginForceAbsolute.js')) - return { id: '/pluginForceAbsolute.js', external: 'absolute' }; - if (source.endsWith('/pluginForceRelative.js')) - return { id: path.join(__dirname, 'pluginForceRelative.js'), external: 'relative' }; - if (source === '/absolute.js') return path.join(__dirname, 'absolute.js'); + await testExternal('./relativeUnresolved.js', true); + await testExternal('./relativeMissing.js', true); + await testExternal('./relativeExisting.js', true); + await testExternal('/absolute.js', true); + await testExternal('./pluginDirect.js', true); + await testExternal('/pluginDifferentAbsolute.js', true); + await testExternal('./pluginTrue.js', true); + await testExternal('./pluginForceAbsolute.js', 'absolute'); + await testExternal('./pluginForceRelative.js', true); + }, + resolveId(source) { + if (source.endsWith('/pluginDirect.js')) return false; + if (source.endsWith('/pluginDifferentAbsolute.js')) + return path.join(__dirname, 'pluginAbsolute.js'); + if (source.endsWith('/pluginTrue.js')) + return { id: path.join(__dirname, 'pluginTrue.js'), external: true }; + if (source.endsWith('/pluginForceAbsolute.js')) + return { id: '/pluginForceAbsolute.js', external: 'absolute' }; + if (source.endsWith('/pluginForceRelative.js')) + return { id: path.join(__dirname, 'pluginForceRelative.js'), external: 'relative' }; + if (source === '/absolute.js') return path.join(__dirname, 'absolute.js'); + } } - } + ] } }); diff --git a/test/form/samples/module-no-treeshake/_config.js b/test/form/samples/module-no-treeshake/_config.js index db7e5f18a..49b72992f 100644 --- a/test/form/samples/module-no-treeshake/_config.js +++ b/test/form/samples/module-no-treeshake/_config.js @@ -5,37 +5,39 @@ function getCode(id) { module.exports = defineTest({ description: 'allows disabling tree-shaking for modules', options: { - plugins: { - resolveId(id) { - if (id.startsWith('dep')) { - if (id === 'depResolved') { - return { - id, - moduleSideEffects: 'no-treeshake' - }; + plugins: [ + { + resolveId(id) { + if (id.startsWith('dep')) { + if (id === 'depResolved') { + return { + id, + moduleSideEffects: 'no-treeshake' + }; + } + return id; } - return id; - } - }, - load(id) { - if (id.startsWith('dep')) { - if (id === 'depLoaded') { + }, + load(id) { + if (id.startsWith('dep')) { + if (id === 'depLoaded') { + return { + code: getCode(id), + moduleSideEffects: 'no-treeshake' + }; + } + return getCode(id); + } + }, + transform(code, id) { + if (id === 'depTransformed') { return { code: getCode(id), moduleSideEffects: 'no-treeshake' }; } - return getCode(id); - } - }, - transform(code, id) { - if (id === 'depTransformed') { - return { - code: getCode(id), - moduleSideEffects: 'no-treeshake' - }; } } - } + ] } }); diff --git a/test/form/samples/nested-pure-comments/main.js b/test/form/samples/nested-pure-comments/main.js index 1e4ce33d8..d9791f075 100644 --- a/test/form/samples/nested-pure-comments/main.js +++ b/test/form/samples/nested-pure-comments/main.js @@ -21,4 +21,6 @@ false /*@__PURE__*/ || keep(); // Calls with parentheses /*@__PURE__*/(remove()); +/*@__PURE__*/(((remove()))); /*@__PURE__*/(new Remove()); +/*@__PURE__*/(((new Remove()))); diff --git a/test/form/samples/no-side-effects-function-declaration-preserve/_config.js b/test/form/samples/no-side-effects-function-declaration-preserve/_config.js index 8791127a9..098620f28 100644 --- a/test/form/samples/no-side-effects-function-declaration-preserve/_config.js +++ b/test/form/samples/no-side-effects-function-declaration-preserve/_config.js @@ -1,5 +1,3 @@ -// tests compiled from https://github.com/mishoo/UglifyJS2/blob/88c8f4e363e0d585b33ea29df560243d3dc74ce1/test/compress/pure_funcs.js - module.exports = defineTest({ description: 'preserve __NO_SIDE_EFFECTS__ annotations for function declarations' }); diff --git a/test/form/samples/no-side-effects-function-declaration-preserve/_expected.js b/test/form/samples/no-side-effects-function-declaration-preserve/_expected.js index 33772214e..841bb6ee0 100644 --- a/test/form/samples/no-side-effects-function-declaration-preserve/_expected.js +++ b/test/form/samples/no-side-effects-function-declaration-preserve/_expected.js @@ -31,13 +31,13 @@ const fnC = /*#__NO_SIDE_EFFECTS__*/ (args) => { }; -/*#__NO_SIDE_EFFECTS__*/ +/*#__NO_SIDE_EFFECTS__*/ const fnD = (args) => { console.log(args); return args }; -/*#__NO_SIDE_EFFECTS__*/ +/*#__NO_SIDE_EFFECTS__*/ const fnE = (args) => { console.log(args); return args @@ -45,10 +45,10 @@ const fnE = (args) => { /** * This is a jsdoc comment, with no side effects annotation - * + * * @param {any} args * @__NO_SIDE_EFFECTS__ - */ + */ const fnF = (args) => { console.log(args); return args @@ -56,17 +56,6 @@ const fnF = (args) => { const fnAlias = fnA; -/** - * Have both annotations - * - * @__PURE__ - * @__NO_SIDE_EFFECTS__ - */ -const fnBothAnnotations = (args) => { - console.log(args); - return args -}; - // This annonation get ignored let fnLet = (args) => { @@ -74,4 +63,4 @@ let fnLet = (args) => { return args }; -export { fnA, fnAlias, fnB, fnBothAnnotations, fnC, fnD, fnE, fnEffects, fnF, fnFromSub, fnLet, fnPure }; +export { fnA, fnAlias, fnB, fnC, fnD, fnE, fnEffects, fnF, fnFromSub, fnLet, fnPure }; diff --git a/test/form/samples/no-side-effects-function-declaration-preserve/functions.js b/test/form/samples/no-side-effects-function-declaration-preserve/functions.js index 399b6a6c3..59c37d8d9 100644 --- a/test/form/samples/no-side-effects-function-declaration-preserve/functions.js +++ b/test/form/samples/no-side-effects-function-declaration-preserve/functions.js @@ -26,7 +26,7 @@ export const fnC = /*#__NO_SIDE_EFFECTS__*/ (args) => { } -/*#__NO_SIDE_EFFECTS__*/ +/*#__NO_SIDE_EFFECTS__*/ const fnD = (args) => { console.log(args) return args @@ -34,7 +34,7 @@ const fnD = (args) => { export { fnD } -/*#__NO_SIDE_EFFECTS__*/ +/*#__NO_SIDE_EFFECTS__*/ export const fnE = (args) => { console.log(args) return args @@ -42,16 +42,16 @@ export const fnE = (args) => { /** * This is a jsdoc comment, with no side effects annotation - * + * * @param {any} args * @__NO_SIDE_EFFECTS__ - */ + */ export const fnF = (args) => { console.log(args) return args } -/*#__NO_SIDE_EFFECTS__*/ +/*#__NO_SIDE_EFFECTS__*/ export default function fnDefault(args) { console.log(args) return args @@ -61,17 +61,6 @@ export * from './sub-functions' export const fnAlias = fnA -/** - * Have both annotations - * - * @__PURE__ - * @__NO_SIDE_EFFECTS__ - */ -export const fnBothAnnotations = (args) => { - console.log(args) - return args -} - // This annonation get ignored /** @__NO_SIDE_EFFECTS__ */ export let fnLet = (args) => { diff --git a/test/form/samples/no-side-effects-function-declaration/_config.js b/test/form/samples/no-side-effects-function-declaration/_config.js index c3178070c..5d7379912 100644 --- a/test/form/samples/no-side-effects-function-declaration/_config.js +++ b/test/form/samples/no-side-effects-function-declaration/_config.js @@ -1,5 +1,3 @@ -// tests compiled from https://github.com/mishoo/UglifyJS2/blob/88c8f4e363e0d585b33ea29df560243d3dc74ce1/test/compress/pure_funcs.js - module.exports = defineTest({ description: '__NO_SIDE_EFFECTS__ annotations for function declarations' }); diff --git a/test/form/samples/no-side-effects-function-declaration/functions.js b/test/form/samples/no-side-effects-function-declaration/functions.js index 61954b3ae..83d130ce8 100644 --- a/test/form/samples/no-side-effects-function-declaration/functions.js +++ b/test/form/samples/no-side-effects-function-declaration/functions.js @@ -26,7 +26,7 @@ export const fnC = /*#__NO_SIDE_EFFECTS__*/ (args) => { } -/*#__NO_SIDE_EFFECTS__*/ +/*#__NO_SIDE_EFFECTS__*/ const fnD = (args) => { console.log(args) return args @@ -34,7 +34,7 @@ const fnD = (args) => { export { fnD } -/*#__NO_SIDE_EFFECTS__*/ +/*#__NO_SIDE_EFFECTS__*/ export const fnE = (args) => { console.log(args) return args @@ -42,10 +42,10 @@ export const fnE = (args) => { /** * This is a jsdoc comment, with pure annotation - * + * * @param {any} args * @__NO_SIDE_EFFECTS__ - */ + */ export const fnF = (args) => { console.log(args) return args @@ -59,7 +59,7 @@ export async function fnG(args) { /** * #__NO_SIDE_EFFECTS__ - */ + */ export const fnH = async (args) => { console.log(args) return args @@ -73,7 +73,7 @@ export const fnI = /*#__NO_SIDE_EFFECTS__*/ async (args) => { /** * #__NO_SIDE_EFFECTS__ - */ + */ export function * fnJ(args) { console.log(args) return args @@ -81,13 +81,13 @@ export function * fnJ(args) { /** * #__NO_SIDE_EFFECTS__ - */ + */ export async function * fnK(args) { console.log(args) return args } -/*#__NO_SIDE_EFFECTS__*/ +/*#__NO_SIDE_EFFECTS__*/ export default function fnDefault(args) { console.log(args) return args diff --git a/test/form/samples/ns-external-star-reexport/_config.js b/test/form/samples/ns-external-star-reexport/_config.js index 506491a80..a556f5bcd 100644 --- a/test/form/samples/ns-external-star-reexport/_config.js +++ b/test/form/samples/ns-external-star-reexport/_config.js @@ -2,17 +2,19 @@ module.exports = defineTest({ description: 'supports namespaces with external star reexports', options: { external: ['external1', 'external2'], - plugins: { - transform(code, id) { - if (id.endsWith('override.js')) { - return { - code, - syntheticNamedExports: true - }; + plugins: [ + { + transform(code, id) { + if (id.endsWith('override.js')) { + return { + code, + syntheticNamedExports: true + }; + } + return null; } - return null; } - }, + ], output: { globals: { external1: 'external1', diff --git a/test/form/samples/pure-comment-line-break/_expected.js b/test/form/samples/pure-comment-line-break/_expected.js index 134dcf3ff..45f13faa7 100644 --- a/test/form/samples/pure-comment-line-break/_expected.js +++ b/test/form/samples/pure-comment-line-break/_expected.js @@ -1,39 +1,45 @@ const x = 'code'; -console.log('should remain impure'); +console.log('code0'); -console.log('should remain impure'); +console.log('code1'); -console.log('code'); -console.log('should remain impure'); +console.log('code2'); -console.log('code'); -console.log('should remain impure'); -console.log('should remain impure'); +console.log('code3'); -console.log('code'); -console.log('should remain impure'); +console.log('code4'); -console.log('code'), -console.log('should remain impure'); +console.log('code5'); -console.log('code'), -console.log('should remain impure'); +console.log('code6'); -console.log('should remain impure'); +console.log('code7'); -console.log('code'); -console.log('should remain impure'); +console.log('code8'); -console.log('should remain impure'); +console.log('code9'); -console.log('should remain impure') ; +console.log('code10'), +console.log('code11'); -console.log('code'); -console.log('should remain impure', x); +console.log('code12'), +console.log('code13'); + +console.log('code14'); + +console.log('code15'); +console.log('code16'); + +console.log('code17'); + +console.log('code18') ; + +console.log('code19'); +console.log('code20', x); { - console.log('should remain impure'); + console.log('code21'); } keep1() ; keep2(); keep3() ; diff --git a/test/form/samples/pure-comment-line-break/dep.js b/test/form/samples/pure-comment-line-break/dep.js index 724095977..86c31d2f7 100644 --- a/test/form/samples/pure-comment-line-break/dep.js +++ b/test/form/samples/pure-comment-line-break/dep.js @@ -1,3 +1,3 @@ const x = 'code';//@__PURE__ export default x; -console.log('should remain impure'); +console.log('code0'); diff --git a/test/form/samples/pure-comment-line-break/main.js b/test/form/samples/pure-comment-line-break/main.js index cadb2158f..2484e4d82 100644 --- a/test/form/samples/pure-comment-line-break/main.js +++ b/test/form/samples/pure-comment-line-break/main.js @@ -1,46 +1,57 @@ /*@__PURE__*/ (() => {})(); -console.log('should remain impure'); -console.log('code');//@__PURE__ +console.log('code1'); /*@__PURE__*/ +(() => {})(), /*@__PURE__*/(() => {})(); + +console.log('code2'); /*@__PURE__*/ +(() => {})() || /*@__PURE__*/(() => {})(); + +console.log('code3'); /*@__PURE__*/ +(() => {})() + /*@__PURE__*/(() => {})(); + +console.log('code4'); /*@__PURE__*/ +(() => {})() ? /*@__PURE__*/(() => {})() : /*@__PURE__*/(() => {})(); + +console.log('code5'); /*@__PURE__*/ +foo?.bar(); + +console.log('code6');//@__PURE__ (() => {})(); -console.log('should remain impure'); -console.log('code')/*@__PURE__*/; +console.log('code7')/*@__PURE__*/; (() => {})(); -console.log('should remain impure'); +console.log('code8'); (() => {})();//@__PURE__ (() => {})(); -console.log('should remain impure'); -console.log('code');/*@__PURE__*///@__PURE__ +console.log('code9');/*@__PURE__*///@__PURE__ /*@__PURE__*/ (() => {})(); -console.log('should remain impure'); -console.log('code'),//@__PURE__ -(() => {})(),console.log('should remain impure'); +console.log('code10'),//@__PURE__ +(() => {})(),console.log('code11'); -console.log('code')/*@__PURE__*/, -(() => {})(),console.log('should remain impure'); +console.log('code12')/*@__PURE__*/, +(() => {})(),console.log('code13'); (() => {})(),//@__PURE__ -(() => {})(),console.log('should remain impure'); +(() => {})(),console.log('code14'); -console.log('code');//@__PURE__ -;console.log('should remain impure'); +console.log('code15');//@__PURE__ +;console.log('code16'); -/*@__PURE__*/true && console.log('should remain impure'); +/*@__PURE__*/true && console.log('code17'); -/*@__PURE__*/true ? console.log('should remain impure') : console.log('code'); +/*@__PURE__*/true ? console.log('code18') : console.log('removed'); -console.log('code');//@__PURE__ +console.log('code19');//@__PURE__ import code from './dep.js'; -console.log('should remain impure', code); +console.log('code20', code); /*@__PURE__*/ if (true) { - console.log('should remain impure'); + console.log('code21'); } /*@__PURE__*/ drop1(); diff --git a/test/form/samples/pure-comment-scenarios-simple/_expected.js b/test/form/samples/pure-comment-scenarios-simple/_expected.js index 58e48fb60..562d2bce0 100644 --- a/test/form/samples/pure-comment-scenarios-simple/_expected.js +++ b/test/form/samples/pure-comment-scenarios-simple/_expected.js @@ -7,8 +7,8 @@ (w(), y()); /*@__PURE__*/(g() || h())(x(), y()); /*@__PURE__*/new (g() || h())(x(), y()); -(/*@__PURE__*/ (a() || b()))(c(), d()); -new (/*@__PURE__*/ (a() || b()))(c(), d()); +( (a() || b()))(c(), d()); +new ( (a() || b()))(c(), d()); [ /*@__PURE__*/ x(), y() ]; [ /*@__PURE__*/ new x(), y() ]; [ w(), /*@__PURE__*/ x(), y() ]; @@ -22,9 +22,9 @@ new (/*@__PURE__*/ (a() || b()))(c(), d()); ( e).x(1).y(2).z(3); ( f.x)(1).y(2).z(3); (/*@__PURE__*/ g.x(1)).y(2).z(3); -( h.x(1).y)(2).z(3); +(/*@__PURE__*/ h.x(1).y)(2).z(3); (/*@__PURE__*/ i.x(1).y(2)).z(3); -( j.x(1).y(2).z)(3); +(/*@__PURE__*/ j.x(1).y(2).z)(3); new ( k)(); new ( l)(1)(2)(3); (/*@__PURE__*/ new m(1))(2)(3); @@ -32,6 +32,6 @@ new ( l)(1)(2)(3); new ( o).x(1).y(2).z(3); /* */ new ( p.x)(1).y(2).z(3); (/*@__PURE__*/ new q.x(1)).y(2).z(3); -( new r.x(1).y)(2).z(3); +(/*@__PURE__*/ new r.x(1).y)(2).z(3); (/*@__PURE__*/ new s.x(1).y(2)).z(3); -( new t.x(1).y(2).z)(3); +(/*@__PURE__*/ new t.x(1).y(2).z)(3); diff --git a/test/form/samples/relative-external-ids/_config.js b/test/form/samples/relative-external-ids/_config.js index 159cea043..bee86d610 100644 --- a/test/form/samples/relative-external-ids/_config.js +++ b/test/form/samples/relative-external-ids/_config.js @@ -22,26 +22,28 @@ module.exports = defineTest({ } } }, - plugins: { - resolveId(id) { - switch (id) { - case './hook.js': { - return false; - } - case './hookNested.js': { - return false; - } - case 'resolved': { - return { id: './resolved.js', external: true }; - } - case 'resolvedNested': { - return { id: './resolvedNested.js', external: true }; - } - default: { - return null; + plugins: [ + { + resolveId(id) { + switch (id) { + case './hook.js': { + return false; + } + case './hookNested.js': { + return false; + } + case 'resolved': { + return { id: './resolved.js', external: true }; + } + case 'resolvedNested': { + return { id: './resolvedNested.js', external: true }; + } + default: { + return null; + } } } } - } + ] } }); diff --git a/test/form/samples/resolution-order/_config.js b/test/form/samples/resolution-order/_config.js index cca0484c4..38eec40c2 100644 --- a/test/form/samples/resolution-order/_config.js +++ b/test/form/samples/resolution-order/_config.js @@ -1,12 +1,14 @@ module.exports = defineTest({ description: 'does not depend on the resolution order of modules for tree-shaking (#2753)', options: { - plugins: { - resolveId(id) { - if (id === './utcWeek') { - return new Promise(resolve => setTimeout(resolve, 0)); + plugins: [ + { + resolveId(id) { + if (id === './utcWeek') { + return new Promise(resolve => setTimeout(resolve, 0)); + } } } - } + ] } }); diff --git a/test/form/samples/side-effects-internal-modules/_config.js b/test/form/samples/side-effects-internal-modules/_config.js index 973ecfeda..091fe7d8c 100644 --- a/test/form/samples/side-effects-internal-modules/_config.js +++ b/test/form/samples/side-effects-internal-modules/_config.js @@ -11,18 +11,20 @@ module.exports = defineTest({ return false; } }, - plugins: { - name: 'test-plugin', - resolveId(id) { - if (id === 'virtual') { - return VIRTUAL_ID; - } - }, - load(id) { - if (id === VIRTUAL_ID) { - return "console.log('effect')"; + plugins: [ + { + name: 'test-plugin', + resolveId(id) { + if (id === 'virtual') { + return VIRTUAL_ID; + } + }, + load(id) { + if (id === VIRTUAL_ID) { + return "console.log('effect')"; + } } } - } + ] } }); diff --git a/test/form/samples/supports-core-js/_config.js b/test/form/samples/supports-core-js/_config.js index ad8e2ea80..070775017 100644 --- a/test/form/samples/supports-core-js/_config.js +++ b/test/form/samples/supports-core-js/_config.js @@ -1,5 +1,6 @@ module.exports = defineTest({ description: 'supports core-js', + verifyAst: false, options: { // check against tree-shake: false when updating the polyfill treeshake: true, diff --git a/test/form/samples/system-uninitialized/_config.js b/test/form/samples/system-uninitialized/_config.js index 871cd4092..685acc69d 100644 --- a/test/form/samples/system-uninitialized/_config.js +++ b/test/form/samples/system-uninitialized/_config.js @@ -1,6 +1,3 @@ -// Changed due to https://github.com/acornjs/acorn/issues/806 -// Consider reverting this change should this become an acorn option - module.exports = defineTest({ description: 'supports uninitialized binding exports', options: { diff --git a/test/form/samples/treeshake-deterministic-dynamic-import/_expected.js b/test/form/samples/treeshake-deterministic-dynamic-import/_expected.js index 8a69e51d0..f8330f85c 100644 --- a/test/form/samples/treeshake-deterministic-dynamic-import/_expected.js +++ b/test/form/samples/treeshake-deterministic-dynamic-import/_expected.js @@ -155,15 +155,6 @@ var bail1$1 = /*#__PURE__*/Object.freeze({ named1: named1 }); -var bail2 = '@included-bail-2'; -const named2 = 'bail2'; - -var bail2$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - default: bail2, - named2: named2 -}); - var bail3 = '@included-bail-3'; const named3 = 'bail3'; @@ -173,6 +164,15 @@ var bail3$1 = /*#__PURE__*/Object.freeze({ named3: named3 }); +var bail2 = '@included-bail-2'; +const named2 = 'bail2'; + +var bail2$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + default: bail2, + named2: named2 +}); + var bail4 = '@included-bail-4'; const named4 = 'bail4'; diff --git a/test/form/samples/unknown-token-effects/_config.js b/test/form/samples/unknown-token-effects/_config.js deleted file mode 100644 index c917c7ca2..000000000 --- a/test/form/samples/unknown-token-effects/_config.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = defineTest({ - description: 'does not tree-shake unknown tokens', - options: { - acornInjectPlugins: Parser => - class extends Parser { - parseExprAtom(referenceDestructuringErrors) { - if (this.type.keyword === 'do') { - this.eat(this.type); - const node = this.startNode(); - node.body = this.parseBlock(); - return this.finishNode(node, 'DoExpression'); - } - return super.parseExprAtom(referenceDestructuringErrors); - } - } - } -}); diff --git a/test/form/samples/unknown-token-effects/_expected.js b/test/form/samples/unknown-token-effects/_expected.js deleted file mode 100644 index ecb186398..000000000 --- a/test/form/samples/unknown-token-effects/_expected.js +++ /dev/null @@ -1,34 +0,0 @@ -(do { - () => console.log('retained'); -}()); -(do { - null; -}.y); -(do { - ({ y: () => console.log('retained') }); -}.y()); -(do { - ({ - set y(value) { - console.log(value); - } - }); -}.y = 'retained'); - -const functionUsedInExpr = () => 1; -const objectUsedInExpr = { value: 2 }; -const valueUsedInExpr = 3; - -const exprValue = do { - if (unknownCondition1) { - functionUsedInExpr(); - } else if (unknownCondition2) { - objectUsedInExpr.value; - } else if (unknownCondition3) { - valueUsedInExpr; - } else { - 'direct value'; - } -}; - -export { exprValue }; diff --git a/test/form/samples/unknown-token-effects/main.js b/test/form/samples/unknown-token-effects/main.js deleted file mode 100644 index 624210488..000000000 --- a/test/form/samples/unknown-token-effects/main.js +++ /dev/null @@ -1,32 +0,0 @@ -(do { - () => console.log('retained'); -}()); -(do { - null; -}.y); -(do { - ({ y: () => console.log('retained') }); -}.y()); -(do { - ({ - set y(value) { - console.log(value); - } - }); -}.y = 'retained'); - -const functionUsedInExpr = () => 1; -const objectUsedInExpr = { value: 2 }; -const valueUsedInExpr = 3; - -export const exprValue = do { - if (unknownCondition1) { - functionUsedInExpr(); - } else if (unknownCondition2) { - objectUsedInExpr.value; - } else if (unknownCondition3) { - valueUsedInExpr; - } else { - 'direct value' - } -}; diff --git a/test/function/index.js b/test/function/index.js index d00b26669..ddf4fbaa8 100644 --- a/test/function/index.js +++ b/test/function/index.js @@ -5,7 +5,12 @@ const path = require('node:path'); */ // @ts-expect-error not included in types const rollup = require('../../dist/rollup'); -const { compareError, compareLogs, runTestSuiteWithSamples } = require('../utils.js'); +const { + compareError, + compareLogs, + runTestSuiteWithSamples, + verifyAstPlugin +} = require('../utils.js'); function requireWithContext(code, context, exports) { const module = { exports }; @@ -67,6 +72,14 @@ runTestSuiteWithSamples( process.chdir(directory); const logs = []; const warnings = []; + const plugins = + config.verifyAst === false + ? config.options?.plugins + : config.options?.plugins === undefined + ? verifyAstPlugin + : Array.isArray(config.options.plugins) + ? [...config.options.plugins, verifyAstPlugin] + : config.options.plugins; return rollup .rollup({ @@ -78,7 +91,8 @@ runTestSuiteWithSamples( } }, strictDeprecations: true, - ...config.options + ...config.options, + plugins }) .then(bundle => { let unintendedError; diff --git a/test/function/samples/add-watch-file-generate/_config.js b/test/function/samples/add-watch-file-generate/_config.js index 1a36f9f8a..862acfce3 100644 --- a/test/function/samples/add-watch-file-generate/_config.js +++ b/test/function/samples/add-watch-file-generate/_config.js @@ -3,12 +3,14 @@ const path = require('node:path'); module.exports = defineTest({ description: 'throws when adding watch files during generate', options: { - plugins: { - name: 'test-plugin', - renderStart() { - this.addWatchFile(path.join(__dirname, 'watched.js')); + plugins: [ + { + name: 'test-plugin', + renderStart() { + this.addWatchFile(path.join(__dirname, 'watched.js')); + } } - } + ] }, generateError: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/allow-reserved/_config.js b/test/function/samples/allow-reserved/_config.js deleted file mode 100644 index 810d2959e..000000000 --- a/test/function/samples/allow-reserved/_config.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = defineTest({ - description: 'allow reserved identifiers via custom acorn options', - options: { - acorn: { - allowReserved: true - } - } -}); diff --git a/test/function/samples/allow-reserved/main.js b/test/function/samples/allow-reserved/main.js deleted file mode 100644 index 00782b93d..000000000 --- a/test/function/samples/allow-reserved/main.js +++ /dev/null @@ -1,4 +0,0 @@ -var x = function await() { - return 42; -}; -assert.equal(x(), 42); diff --git a/test/function/samples/bundle-facade-order/_config.js b/test/function/samples/bundle-facade-order/_config.js index 9dd3332ec..2c45be4d5 100644 --- a/test/function/samples/bundle-facade-order/_config.js +++ b/test/function/samples/bundle-facade-order/_config.js @@ -8,21 +8,23 @@ module.exports = defineTest({ 'main-alias': 'main', other: 'other' }, - plugins: { - name: 'test-plugin', - generateBundle(options, bundle) { - assert.deepStrictEqual( - Object.keys(bundle).map(id => [id, bundle[id].code]), - [ - ['main.js', "'use strict';\n\nvar main = 'main1';\n\nmodule.exports = main;\n"], - ['other.js', "'use strict';\n\nvar other = 'main2';\n\nmodule.exports = other;\n"], + plugins: [ + { + name: 'test-plugin', + generateBundle(options, bundle) { + assert.deepStrictEqual( + Object.keys(bundle).map(id => [id, bundle[id].code]), [ - 'main-alias.js', - "'use strict';\n\nvar main = require('./main.js');\n\n\n\nmodule.exports = main;\n" + ['main.js', "'use strict';\n\nvar main = 'main1';\n\nmodule.exports = main;\n"], + ['other.js', "'use strict';\n\nvar other = 'main2';\n\nmodule.exports = other;\n"], + [ + 'main-alias.js', + "'use strict';\n\nvar main = require('./main.js');\n\n\n\nmodule.exports = main;\n" + ] ] - ] - ); + ); + } } - } + ] } }); diff --git a/test/function/samples/call-marked-pure-with-plugin-parse-ast/_config.js b/test/function/samples/call-marked-pure-with-plugin-parse-ast/_config.js index 9fe44391a..d736faba6 100644 --- a/test/function/samples/call-marked-pure-with-plugin-parse-ast/_config.js +++ b/test/function/samples/call-marked-pure-with-plugin-parse-ast/_config.js @@ -8,11 +8,7 @@ module.exports = defineTest({ plugins: [ { transform(code) { - const comments = []; - const ast = this.parse(code, { onComment: comments }); - if (comments.length != 5 || comments.some(({ value }) => !value.includes('PURE'))) { - throw new Error('failed to get comments'); - } + const ast = this.parse(code); return { ast, code, map: null }; } } diff --git a/test/function/samples/cannot-resolve-sourcemap-warning/_config.js b/test/function/samples/cannot-resolve-sourcemap-warning/_config.js index 89dfd06cd..cfec197b8 100644 --- a/test/function/samples/cannot-resolve-sourcemap-warning/_config.js +++ b/test/function/samples/cannot-resolve-sourcemap-warning/_config.js @@ -4,12 +4,14 @@ const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'handles when a sourcemap cannot be resolved in a warning', options: { - plugins: { - name: 'test-plugin', - transform() { - return { code: 'export default this', map: { mappings: '' } }; + plugins: [ + { + name: 'test-plugin', + transform() { + return { code: 'export default this', map: { mappings: '' } }; + } } - } + ] }, warnings: [ { diff --git a/test/function/samples/check-exports-exportedBindings-as-a-supplementary-test/_config.js b/test/function/samples/check-exports-exportedBindings-as-a-supplementary-test/_config.js index c2b0ddb5a..dbfddc29c 100644 --- a/test/function/samples/check-exports-exportedBindings-as-a-supplementary-test/_config.js +++ b/test/function/samples/check-exports-exportedBindings-as-a-supplementary-test/_config.js @@ -23,12 +23,14 @@ const expectedResult = { module.exports = defineTest({ description: 'check exports and exportedBindings in moduleParsed as a supplementary test', options: { - plugins: { - name: 'test-plugin', - moduleParsed(moduleInfo) { - const { exports, exportedBindings, id } = moduleInfo; - assert.deepStrictEqual({ exports, exportedBindings }, expectedResult[id]); + plugins: [ + { + name: 'test-plugin', + moduleParsed(moduleInfo) { + const { exports, exportedBindings, id } = moduleInfo; + assert.deepStrictEqual({ exports, exportedBindings }, expectedResult[id]); + } } - } + ] } }); diff --git a/test/function/samples/context-resolve/_config.js b/test/function/samples/context-resolve/_config.js index 680305939..985585d5c 100644 --- a/test/function/samples/context-resolve/_config.js +++ b/test/function/samples/context-resolve/_config.js @@ -6,7 +6,7 @@ const tests = [ source: './existing', expected: { id: path.join(__dirname, 'existing.js'), - assertions: {}, + attributes: {}, external: false, meta: {}, resolvedBy: 'rollup', @@ -26,7 +26,7 @@ const tests = [ source: './marked-directly-external-relative', expected: { id: path.join(__dirname, 'marked-directly-external-relative'), - assertions: {}, + attributes: {}, external: true, meta: {}, moduleSideEffects: true, @@ -38,7 +38,7 @@ const tests = [ source: './marked-external-relative', expected: { id: path.join(__dirname, 'marked-external-relative'), - assertions: {}, + attributes: {}, external: true, meta: {}, moduleSideEffects: true, @@ -50,7 +50,7 @@ const tests = [ source: 'marked-external-absolute', expected: { id: 'marked-external-absolute', - assertions: {}, + attributes: {}, external: true, meta: {}, moduleSideEffects: true, @@ -62,7 +62,7 @@ const tests = [ source: 'resolved-name', expected: { id: 'resolved:resolved-name', - assertions: {}, + attributes: {}, external: false, meta: {}, moduleSideEffects: true, @@ -74,7 +74,7 @@ const tests = [ source: 'resolved-false', expected: { id: 'resolved-false', - assertions: {}, + attributes: {}, external: true, meta: {}, resolvedBy: 'rollup', @@ -86,7 +86,7 @@ const tests = [ source: 'resolved-object', expected: { id: 'resolved:resolved-object', - assertions: {}, + attributes: {}, external: false, meta: {}, moduleSideEffects: true, @@ -98,7 +98,7 @@ const tests = [ source: 'resolved-object-non-external', expected: { id: 'resolved:resolved-object-non-external', - assertions: {}, + attributes: {}, external: false, meta: {}, moduleSideEffects: true, @@ -110,7 +110,7 @@ const tests = [ source: 'resolved-object-external', expected: { id: 'resolved:resolved-object-external', - assertions: {}, + attributes: {}, external: true, meta: {}, moduleSideEffects: true, diff --git a/test/function/samples/deprecated/dynamic-import-name-warn/_config.js b/test/function/samples/deprecated/dynamic-import-name-warn/_config.js index 60e45b2b3..611625380 100644 --- a/test/function/samples/deprecated/dynamic-import-name-warn/_config.js +++ b/test/function/samples/deprecated/dynamic-import-name-warn/_config.js @@ -11,11 +11,13 @@ module.exports = defineTest({ options: { strictDeprecations: false, input: 'main.js', - plugins: { - resolveDynamicImport() { - return false; + plugins: [ + { + resolveDynamicImport() { + return false; + } } - }, + ], output: { dynamicImportFunction: 'myImporter', format: 'cjs', diff --git a/test/function/samples/deprecated/dynamic-import-name/_config.js b/test/function/samples/deprecated/dynamic-import-name/_config.js index 6a93ad208..123c660a5 100644 --- a/test/function/samples/deprecated/dynamic-import-name/_config.js +++ b/test/function/samples/deprecated/dynamic-import-name/_config.js @@ -12,11 +12,13 @@ module.exports = defineTest({ options: { strictDeprecations: false, input: 'main.js', - plugins: { - resolveDynamicImport() { - return false; + plugins: [ + { + resolveDynamicImport() { + return false; + } } - }, + ], output: { dynamicImportFunction: 'myImporter', format: 'es' diff --git a/test/function/samples/deprecated/inline-dynamic-imports-bundle/_config.js b/test/function/samples/deprecated/inline-dynamic-imports-bundle/_config.js index 3a1c929fc..d62ae029e 100644 --- a/test/function/samples/deprecated/inline-dynamic-imports-bundle/_config.js +++ b/test/function/samples/deprecated/inline-dynamic-imports-bundle/_config.js @@ -6,14 +6,16 @@ module.exports = defineTest({ options: { strictDeprecations: false, inlineDynamicImports: true, - plugins: { - generateBundle(options, bundle) { - assert.deepStrictEqual(Object.keys(bundle['main.js'].modules), [ - path.join(__dirname, 'lib.js'), - path.join(__dirname, 'main.js') - ]); + plugins: [ + { + generateBundle(options, bundle) { + assert.deepStrictEqual(Object.keys(bundle['main.js'].modules), [ + path.join(__dirname, 'lib.js'), + path.join(__dirname, 'main.js') + ]); + } } - } + ] }, warnings: [ { diff --git a/test/function/samples/deprecated/manual-chunks-info/_config.js b/test/function/samples/deprecated/manual-chunks-info/_config.js index 6a7d57050..816969b70 100644 --- a/test/function/samples/deprecated/manual-chunks-info/_config.js +++ b/test/function/samples/deprecated/manual-chunks-info/_config.js @@ -20,7 +20,7 @@ module.exports = defineTest({ { [getId('dynamic')]: { id: getId('dynamic'), - assertions: {}, + attributes: {}, ast: { type: 'Program', start: 0, @@ -81,7 +81,7 @@ module.exports = defineTest({ code: "export const promise = import('external');\nexport { default as internal } from './lib';\n", dynamicallyImportedIdResolutions: [ { - assertions: {}, + attributes: {}, external: true, id: 'external', meta: {}, @@ -100,7 +100,7 @@ module.exports = defineTest({ implicitlyLoadedBefore: [], importedIdResolutions: [ { - assertions: {}, + attributes: {}, external: false, id: getId('lib'), meta: {}, @@ -119,7 +119,7 @@ module.exports = defineTest({ }, [getId('lib')]: { id: getId('lib'), - assertions: {}, + attributes: {}, ast: { type: 'Program', start: 0, @@ -155,7 +155,7 @@ module.exports = defineTest({ }, [getId('main')]: { id: getId('main'), - assertions: {}, + attributes: {}, ast: { type: 'Program', start: 0, @@ -238,7 +238,7 @@ module.exports = defineTest({ code: "export const promise = import('./dynamic');\nexport { default as value } from './lib';\nexport { external } from 'external';\n", dynamicallyImportedIdResolutions: [ { - assertions: {}, + attributes: {}, external: false, id: getId('dynamic'), meta: {}, @@ -257,7 +257,7 @@ module.exports = defineTest({ implicitlyLoadedBefore: [], importedIdResolutions: [ { - assertions: {}, + attributes: {}, external: false, id: getId('lib'), meta: {}, @@ -266,7 +266,7 @@ module.exports = defineTest({ syntheticNamedExports: false }, { - assertions: {}, + attributes: {}, external: true, id: 'external', meta: {}, @@ -285,7 +285,7 @@ module.exports = defineTest({ }, external: { id: 'external', - assertions: {}, + attributes: {}, ast: null, code: null, dynamicallyImportedIdResolutions: [], diff --git a/test/function/samples/deprecated/plugin-module-ids/_config.js b/test/function/samples/deprecated/plugin-module-ids/_config.js index e296b0c91..576b77cc4 100644 --- a/test/function/samples/deprecated/plugin-module-ids/_config.js +++ b/test/function/samples/deprecated/plugin-module-ids/_config.js @@ -8,16 +8,18 @@ module.exports = defineTest({ options: { strictDeprecations: false, external: ['path'], - plugins: { - renderStart() { - rendered = true; - assert.deepStrictEqual([...this.moduleIds].sort(), [ - path.join(__dirname, 'foo.js'), - path.join(__dirname, 'main.js'), - 'path' - ]); + plugins: [ + { + renderStart() { + rendered = true; + assert.deepStrictEqual([...this.moduleIds].sort(), [ + path.join(__dirname, 'foo.js'), + path.join(__dirname, 'main.js'), + 'path' + ]); + } } - } + ] }, bundle() { assert.ok(rendered); diff --git a/test/function/samples/deprecated/resolve-id-external/_config.js b/test/function/samples/deprecated/resolve-id-external/_config.js index c1cb13a30..fc6c913dc 100644 --- a/test/function/samples/deprecated/resolve-id-external/_config.js +++ b/test/function/samples/deprecated/resolve-id-external/_config.js @@ -35,47 +35,49 @@ module.exports = defineTest({ return JSON.parse(id.split('-')[3]); } }, - plugins: { - name: 'test-plugin', - resolveId(id) { - if (!path.isAbsolute(id)) { - return { - id, - external: true, - moduleSideEffects: JSON.parse(id.split('-')[1]) - }; - } - }, - buildEnd() { - assert.deepStrictEqual( - getObject( - [...this.getModuleIds()] - .filter(id => !path.isAbsolute(id)) - .map(id => [id, this.getModuleInfo(id).hasModuleSideEffects]) - ), - { - 'sideeffects-false-usereffects-false': false, - 'sideeffects-false-usereffects-false-unused-import': false, - 'sideeffects-false-usereffects-false-used-import': false, - 'sideeffects-false-usereffects-true': false, - 'sideeffects-false-usereffects-true-unused-import': false, - 'sideeffects-false-usereffects-true-used-import': false, - 'sideeffects-null-usereffects-false': false, - 'sideeffects-null-usereffects-false-unused-import': false, - 'sideeffects-null-usereffects-false-used-import': false, - 'sideeffects-null-usereffects-true': true, - 'sideeffects-null-usereffects-true-unused-import': true, - 'sideeffects-null-usereffects-true-used-import': true, - 'sideeffects-true-usereffects-false': true, - 'sideeffects-true-usereffects-false-unused-import': true, - 'sideeffects-true-usereffects-false-used-import': true, - 'sideeffects-true-usereffects-true': true, - 'sideeffects-true-usereffects-true-unused-import': true, - 'sideeffects-true-usereffects-true-used-import': true + plugins: [ + { + name: 'test-plugin', + resolveId(id) { + if (!path.isAbsolute(id)) { + return { + id, + external: true, + moduleSideEffects: JSON.parse(id.split('-')[1]) + }; } - ); + }, + buildEnd() { + assert.deepStrictEqual( + getObject( + [...this.getModuleIds()] + .filter(id => !path.isAbsolute(id)) + .map(id => [id, this.getModuleInfo(id).hasModuleSideEffects]) + ), + { + 'sideeffects-false-usereffects-false': false, + 'sideeffects-false-usereffects-false-unused-import': false, + 'sideeffects-false-usereffects-false-used-import': false, + 'sideeffects-false-usereffects-true': false, + 'sideeffects-false-usereffects-true-unused-import': false, + 'sideeffects-false-usereffects-true-used-import': false, + 'sideeffects-null-usereffects-false': false, + 'sideeffects-null-usereffects-false-unused-import': false, + 'sideeffects-null-usereffects-false-used-import': false, + 'sideeffects-null-usereffects-true': true, + 'sideeffects-null-usereffects-true-unused-import': true, + 'sideeffects-null-usereffects-true-used-import': true, + 'sideeffects-true-usereffects-false': true, + 'sideeffects-true-usereffects-false-unused-import': true, + 'sideeffects-true-usereffects-false-used-import': true, + 'sideeffects-true-usereffects-true': true, + 'sideeffects-true-usereffects-true-unused-import': true, + 'sideeffects-true-usereffects-true-used-import': true + } + ); + } } - } + ] }, warnings(warnings) { for (const warning of warnings) { diff --git a/test/function/samples/deprecated/resolve-id/_config.js b/test/function/samples/deprecated/resolve-id/_config.js index 825b6a69a..c7f4077a8 100644 --- a/test/function/samples/deprecated/resolve-id/_config.js +++ b/test/function/samples/deprecated/resolve-id/_config.js @@ -33,58 +33,60 @@ module.exports = defineTest({ return JSON.parse(id.split('-')[3]); } }, - plugins: { - name: 'test-plugin', - resolveId(id) { - if (!path.isAbsolute(id)) { - return { - id, - external: false, - moduleSideEffects: JSON.parse(id.split('-')[1]) - }; - } - }, - load(id) { - if (!path.isAbsolute(id)) { - const sideEffects = JSON.parse(id.split('-')[1]); - const userEffects = JSON.parse(id.split('-')[3]); - assert.strictEqual( - this.getModuleInfo(id).hasModuleSideEffects, - typeof sideEffects === 'boolean' ? sideEffects : userEffects + plugins: [ + { + name: 'test-plugin', + resolveId(id) { + if (!path.isAbsolute(id)) { + return { + id, + external: false, + moduleSideEffects: JSON.parse(id.split('-')[1]) + }; + } + }, + load(id) { + if (!path.isAbsolute(id)) { + const sideEffects = JSON.parse(id.split('-')[1]); + const userEffects = JSON.parse(id.split('-')[3]); + assert.strictEqual( + this.getModuleInfo(id).hasModuleSideEffects, + typeof sideEffects === 'boolean' ? sideEffects : userEffects + ); + return `export const value = '${id}'; sideEffects.push(value);`; + } + }, + buildEnd() { + assert.deepStrictEqual( + getObject( + [...this.getModuleIds()] + .filter(id => !path.isAbsolute(id)) + .map(id => [id, this.getModuleInfo(id).hasModuleSideEffects]) + ), + { + 'sideeffects-false-usereffects-false': false, + 'sideeffects-false-usereffects-false-unused-import': false, + 'sideeffects-false-usereffects-false-used-import': false, + 'sideeffects-false-usereffects-true': false, + 'sideeffects-false-usereffects-true-unused-import': false, + 'sideeffects-false-usereffects-true-used-import': false, + 'sideeffects-null-usereffects-false': false, + 'sideeffects-null-usereffects-false-unused-import': false, + 'sideeffects-null-usereffects-false-used-import': false, + 'sideeffects-null-usereffects-true': true, + 'sideeffects-null-usereffects-true-unused-import': true, + 'sideeffects-null-usereffects-true-used-import': true, + 'sideeffects-true-usereffects-false': true, + 'sideeffects-true-usereffects-false-unused-import': true, + 'sideeffects-true-usereffects-false-used-import': true, + 'sideeffects-true-usereffects-true': true, + 'sideeffects-true-usereffects-true-unused-import': true, + 'sideeffects-true-usereffects-true-used-import': true + } ); - return `export const value = '${id}'; sideEffects.push(value);`; } - }, - buildEnd() { - assert.deepStrictEqual( - getObject( - [...this.getModuleIds()] - .filter(id => !path.isAbsolute(id)) - .map(id => [id, this.getModuleInfo(id).hasModuleSideEffects]) - ), - { - 'sideeffects-false-usereffects-false': false, - 'sideeffects-false-usereffects-false-unused-import': false, - 'sideeffects-false-usereffects-false-used-import': false, - 'sideeffects-false-usereffects-true': false, - 'sideeffects-false-usereffects-true-unused-import': false, - 'sideeffects-false-usereffects-true-used-import': false, - 'sideeffects-null-usereffects-false': false, - 'sideeffects-null-usereffects-false-unused-import': false, - 'sideeffects-null-usereffects-false-used-import': false, - 'sideeffects-null-usereffects-true': true, - 'sideeffects-null-usereffects-true-unused-import': true, - 'sideeffects-null-usereffects-true-used-import': true, - 'sideeffects-true-usereffects-false': true, - 'sideeffects-true-usereffects-false-unused-import': true, - 'sideeffects-true-usereffects-false-used-import': true, - 'sideeffects-true-usereffects-true': true, - 'sideeffects-true-usereffects-true-unused-import': true, - 'sideeffects-true-usereffects-true-used-import': true - } - ); } - } + ] }, warnings(warnings) { for (const warning of warnings) { diff --git a/test/function/samples/deprecations/externalImportAssertions/_config.js b/test/function/samples/deprecations/externalImportAssertions/_config.js new file mode 100644 index 000000000..ef167bd3a --- /dev/null +++ b/test/function/samples/deprecations/externalImportAssertions/_config.js @@ -0,0 +1,12 @@ +module.exports = defineTest({ + description: 'marks the "output.externalImportAssertions" option as deprecated', + options: { + output: { externalImportAssertions: false } + }, + generateError: { + code: 'DEPRECATED_FEATURE', + message: + 'The "output.externalImportAssertions" option is deprecated. Use the "output.externalImportAttributes" option instead.', + url: 'https://rollupjs.org/configuration-options/#output-externalimportattributes' + } +}); diff --git a/test/function/samples/deprecations/externalImportAssertions/_expected.js b/test/function/samples/deprecations/externalImportAssertions/_expected.js new file mode 100644 index 000000000..2d4172646 --- /dev/null +++ b/test/function/samples/deprecations/externalImportAssertions/_expected.js @@ -0,0 +1,6 @@ +import('external'); +import(globalThis.unknown); +import('resolvedString'); +import('resolved-id'); +import('resolved-different'); +import('unresolved'); diff --git a/test/function/samples/deprecations/externalImportAssertions/main.js b/test/function/samples/deprecations/externalImportAssertions/main.js new file mode 100644 index 000000000..38bfed638 --- /dev/null +++ b/test/function/samples/deprecations/externalImportAssertions/main.js @@ -0,0 +1,6 @@ +import('external', { assert: { type: 'special' } }); +import(globalThis.unknown, { assert: { type: 'special' } }); +import(`external-${globalThis.unknown}`, { assert: { type: 'special' } }); +import('external' + globalThis.unknown, { assert: { type: 'special' } }); +import('external-resolved', { assert: { type: 'special' } }); +import('unresolved', { assert: { type: 'special' } }); diff --git a/test/function/samples/deprecations/plugin-module-ids/_config.js b/test/function/samples/deprecations/plugin-module-ids/_config.js index 0b49a46c9..627a5c399 100644 --- a/test/function/samples/deprecations/plugin-module-ids/_config.js +++ b/test/function/samples/deprecations/plugin-module-ids/_config.js @@ -2,12 +2,14 @@ module.exports = defineTest({ description: 'provides all module ids on the plugin context', options: { external: ['path'], - plugins: { - name: 'test', - renderStart() { - console.log([...this.moduleIds]); + plugins: [ + { + name: 'test', + renderStart() { + console.log([...this.moduleIds]); + } } - } + ] }, generateError: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/double-default-export/_config.js b/test/function/samples/double-default-export/_config.js index a6760044b..f6643d7ef 100644 --- a/test/function/samples/double-default-export/_config.js +++ b/test/function/samples/double-default-export/_config.js @@ -6,28 +6,23 @@ module.exports = defineTest({ description: 'throws on double default exports', error: { cause: { - loc: { - column: 7, - line: 2 - }, - message: "Duplicate export 'default' (2:7)", - pos: 25, - raisedAt: 34 + message: 'the name `default` is exported multiple times', + pos: 18 }, code: 'PARSE_ERROR', - message: `Duplicate export 'default'`, + message: 'the name `default` is exported multiple times', id: ID_FOO, - pos: 25, + pos: 18, watchFiles: [ID_FOO, ID_MAIN], loc: { file: ID_FOO, line: 2, - column: 7 + column: 0 }, frame: ` 1: export default 1; 2: export default 2; - ^ + ^ ` } }); diff --git a/test/function/samples/double-named-export/_config.js b/test/function/samples/double-named-export/_config.js index 7e671029a..e8131fd68 100644 --- a/test/function/samples/double-named-export/_config.js +++ b/test/function/samples/double-named-export/_config.js @@ -6,16 +6,11 @@ module.exports = defineTest({ description: 'throws on duplicate named exports', error: { cause: { - loc: { - column: 9, - line: 3 - }, - message: "Duplicate export 'foo' (3:9)", - pos: 38, - raisedAt: 43 + message: 'the name `foo` is exported multiple times', + pos: 38 }, code: 'PARSE_ERROR', - message: `Duplicate export 'foo'`, + message: 'the name `foo` is exported multiple times', id: ID_FOO, pos: 38, watchFiles: [ID_FOO, ID_MAIN], diff --git a/test/function/samples/double-named-reexport/_config.js b/test/function/samples/double-named-reexport/_config.js index 4488a569c..68f71c1db 100644 --- a/test/function/samples/double-named-reexport/_config.js +++ b/test/function/samples/double-named-reexport/_config.js @@ -6,16 +6,11 @@ module.exports = defineTest({ description: 'throws on duplicate named exports', error: { cause: { - loc: { - column: 9, - line: 3 - }, - message: "Duplicate export 'foo' (3:9)", - pos: 38, - raisedAt: 43 + message: 'the name `foo` is exported multiple times', + pos: 38 }, code: 'PARSE_ERROR', - message: `Duplicate export 'foo'`, + message: 'the name `foo` is exported multiple times', id: ID_FOO, pos: 38, watchFiles: [ID_FOO, ID_MAIN], diff --git a/test/function/samples/duplicate-import-fails/_config.js b/test/function/samples/duplicate-import-fails/_config.js index f4dee4a93..14450a068 100644 --- a/test/function/samples/duplicate-import-fails/_config.js +++ b/test/function/samples/duplicate-import-fails/_config.js @@ -5,16 +5,11 @@ module.exports = defineTest({ description: 'disallows duplicate imports', error: { cause: { - loc: { - column: 9, - line: 2 - }, - message: "Identifier 'a' has already been declared (2:9)", - pos: 36, - raisedAt: 39 + message: 'the name `a` is defined multiple times', + pos: 36 }, code: 'PARSE_ERROR', - message: `Identifier 'a' has already been declared`, + message: 'the name `a` is defined multiple times', id: ID_MAIN, pos: 36, watchFiles: [ID_MAIN], diff --git a/test/function/samples/duplicate-import-specifier-fails/_config.js b/test/function/samples/duplicate-import-specifier-fails/_config.js index 17dd9bafc..2ea759b83 100644 --- a/test/function/samples/duplicate-import-specifier-fails/_config.js +++ b/test/function/samples/duplicate-import-specifier-fails/_config.js @@ -5,16 +5,11 @@ module.exports = defineTest({ description: 'disallows duplicate import specifiers', error: { cause: { - loc: { - column: 12, - line: 1 - }, - message: "Identifier 'a' has already been declared (1:12)", - pos: 12, - raisedAt: 15 + message: 'the name `a` is defined multiple times', + pos: 12 }, code: 'PARSE_ERROR', - message: `Identifier 'a' has already been declared`, + message: 'the name `a` is defined multiple times', id: ID_MAIN, pos: 12, watchFiles: [ID_MAIN], diff --git a/test/function/samples/emit-chunk-hash/_config.js b/test/function/samples/emit-chunk-hash/_config.js index cf145f5a8..625408540 100644 --- a/test/function/samples/emit-chunk-hash/_config.js +++ b/test/function/samples/emit-chunk-hash/_config.js @@ -8,13 +8,15 @@ module.exports = defineTest({ output: { chunkFileNames: '[name]-[hash].js' }, - plugins: { - buildStart() { - referenceId = this.emitFile({ type: 'chunk', id: 'emitted' }); - }, - generateBundle() { - assert.strictEqual(this.getFileName(referenceId), 'emitted-38bdd9b2.js'); + plugins: [ + { + buildStart() { + referenceId = this.emitFile({ type: 'chunk', id: 'emitted' }); + }, + generateBundle() { + assert.strictEqual(this.getFileName(referenceId), 'emitted-38bdd9b2.js'); + } } - } + ] } }); diff --git a/test/function/samples/emit-chunk-manual-asset-source/_config.js b/test/function/samples/emit-chunk-manual-asset-source/_config.js index 36dd0dcc4..8faf60754 100644 --- a/test/function/samples/emit-chunk-manual-asset-source/_config.js +++ b/test/function/samples/emit-chunk-manual-asset-source/_config.js @@ -8,20 +8,22 @@ module.exports = defineTest({ manualChunks: { foo: ['manual.js'] }, assetFileNames: '[name]-[hash][extname]' }, - plugins: { - transform(code, id) { - if (id.endsWith('manual.js')) { - referenceId = this.emitFile({ type: 'asset', name: 'emitted.txt' }); + plugins: [ + { + transform(code, id) { + if (id.endsWith('manual.js')) { + referenceId = this.emitFile({ type: 'asset', name: 'emitted.txt' }); + } + }, + moduleParsed({ id }) { + if (id.endsWith('manual.js')) { + this.setAssetSource(referenceId, 'emitted'); + } + }, + generateBundle() { + assert.strictEqual(this.getFileName(referenceId), 'emitted-f57bfbce.txt'); } - }, - moduleParsed({ id }) { - if (id.endsWith('manual.js')) { - this.setAssetSource(referenceId, 'emitted'); - } - }, - generateBundle() { - assert.strictEqual(this.getFileName(referenceId), 'emitted-f57bfbce.txt'); } - } + ] } }); diff --git a/test/function/samples/emit-chunk-manual/_config.js b/test/function/samples/emit-chunk-manual/_config.js index 09e17c86d..d9d513c58 100644 --- a/test/function/samples/emit-chunk-manual/_config.js +++ b/test/function/samples/emit-chunk-manual/_config.js @@ -8,15 +8,17 @@ module.exports = defineTest({ manualChunks: { foo: ['manual.js'] }, assetFileNames: '[name]-[hash][extname]' }, - plugins: { - transform(code, id) { - if (id.endsWith('manual.js')) { - referenceId = this.emitFile({ type: 'asset', name: 'emitted.txt', source: 'emitted' }); + plugins: [ + { + transform(code, id) { + if (id.endsWith('manual.js')) { + referenceId = this.emitFile({ type: 'asset', name: 'emitted.txt', source: 'emitted' }); + } + }, + generateBundle() { + assert.strictEqual(this.getFileName(referenceId), 'emitted-f57bfbce.txt'); } - }, - generateBundle() { - assert.strictEqual(this.getFileName(referenceId), 'emitted-f57bfbce.txt'); } - } + ] } }); diff --git a/test/function/samples/emit-file/asset-source-invalid/_config.js b/test/function/samples/emit-file/asset-source-invalid/_config.js index e7176b36e..276756509 100644 --- a/test/function/samples/emit-file/asset-source-invalid/_config.js +++ b/test/function/samples/emit-file/asset-source-invalid/_config.js @@ -1,13 +1,15 @@ module.exports = defineTest({ description: 'throws when setting an empty asset source', options: { - plugins: { - name: 'test-plugin', - buildStart() { - const assetId = this.emitFile({ type: 'asset', name: 'test.ext' }); - this.setAssetSource(assetId, null); + plugins: [ + { + name: 'test-plugin', + buildStart() { + const assetId = this.emitFile({ type: 'asset', name: 'test.ext' }); + this.setAssetSource(assetId, null); + } } - } + ] }, error: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/emit-file/asset-source-invalid2/_config.js b/test/function/samples/emit-file/asset-source-invalid2/_config.js index f835adc9b..8edc13a8c 100644 --- a/test/function/samples/emit-file/asset-source-invalid2/_config.js +++ b/test/function/samples/emit-file/asset-source-invalid2/_config.js @@ -1,13 +1,15 @@ module.exports = defineTest({ description: 'throws when setting an empty asset source', options: { - plugins: { - name: 'test-plugin', - buildStart() { - const assetId = this.emitFile({ type: 'asset', fileName: 'test.ext' }); - this.setAssetSource(assetId, null); + plugins: [ + { + name: 'test-plugin', + buildStart() { + const assetId = this.emitFile({ type: 'asset', fileName: 'test.ext' }); + this.setAssetSource(assetId, null); + } } - } + ] }, error: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/emit-file/asset-source-invalid3/_config.js b/test/function/samples/emit-file/asset-source-invalid3/_config.js index 0cf25fa9a..a5a2754f2 100644 --- a/test/function/samples/emit-file/asset-source-invalid3/_config.js +++ b/test/function/samples/emit-file/asset-source-invalid3/_config.js @@ -1,13 +1,15 @@ module.exports = defineTest({ description: 'throws when setting an empty asset source', options: { - plugins: { - name: 'test-plugin', - buildStart() { - const assetId = this.emitFile({ type: 'asset' }); - this.setAssetSource(assetId, null); + plugins: [ + { + name: 'test-plugin', + buildStart() { + const assetId = this.emitFile({ type: 'asset' }); + this.setAssetSource(assetId, null); + } } - } + ] }, error: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/emit-file/asset-source-invalid4/_config.js b/test/function/samples/emit-file/asset-source-invalid4/_config.js index e1b66fa77..1f13ddf8c 100644 --- a/test/function/samples/emit-file/asset-source-invalid4/_config.js +++ b/test/function/samples/emit-file/asset-source-invalid4/_config.js @@ -1,12 +1,14 @@ module.exports = defineTest({ description: 'throws when setting an empty asset source', options: { - plugins: { - name: 'test-plugin', - buildStart() { - this.emitFile({ type: 'asset', source: null }); + plugins: [ + { + name: 'test-plugin', + buildStart() { + this.emitFile({ type: 'asset', source: null }); + } } - } + ] }, error: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/emit-file/asset-source-missing/_config.js b/test/function/samples/emit-file/asset-source-missing/_config.js index 5989d82a6..544d0a299 100644 --- a/test/function/samples/emit-file/asset-source-missing/_config.js +++ b/test/function/samples/emit-file/asset-source-missing/_config.js @@ -1,12 +1,14 @@ module.exports = defineTest({ description: 'throws when not setting the asset source', options: { - plugins: { - name: 'test-plugin', - load() { - this.emitFile({ type: 'asset', name: 'test.ext' }); + plugins: [ + { + name: 'test-plugin', + load() { + this.emitFile({ type: 'asset', name: 'test.ext' }); + } } - } + ] }, generateError: { code: 'ASSET_SOURCE_MISSING', diff --git a/test/function/samples/emit-file/asset-source-missing2/_config.js b/test/function/samples/emit-file/asset-source-missing2/_config.js index b2ec171c5..f4a4f1330 100644 --- a/test/function/samples/emit-file/asset-source-missing2/_config.js +++ b/test/function/samples/emit-file/asset-source-missing2/_config.js @@ -1,12 +1,14 @@ module.exports = defineTest({ description: 'throws when not setting the asset source', options: { - plugins: { - name: 'test-plugin', - load() { - this.emitFile({ type: 'asset' }); + plugins: [ + { + name: 'test-plugin', + load() { + this.emitFile({ type: 'asset' }); + } } - } + ] }, generateError: { code: 'ASSET_SOURCE_MISSING', diff --git a/test/function/samples/emit-file/asset-source-missing3/_config.js b/test/function/samples/emit-file/asset-source-missing3/_config.js index f924cf85b..09537c85b 100644 --- a/test/function/samples/emit-file/asset-source-missing3/_config.js +++ b/test/function/samples/emit-file/asset-source-missing3/_config.js @@ -1,13 +1,15 @@ module.exports = defineTest({ description: 'throws when accessing the file name before the asset source is set', options: { - plugins: { - name: 'test-plugin', - buildStart() { - const assetId = this.emitFile({ type: 'asset', name: 'test.ext' }); - this.getFileName(assetId); + plugins: [ + { + name: 'test-plugin', + buildStart() { + const assetId = this.emitFile({ type: 'asset', name: 'test.ext' }); + this.getFileName(assetId); + } } - } + ] }, error: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/emit-file/asset-source-missing4/_config.js b/test/function/samples/emit-file/asset-source-missing4/_config.js index 9e1b27eb3..82200e980 100644 --- a/test/function/samples/emit-file/asset-source-missing4/_config.js +++ b/test/function/samples/emit-file/asset-source-missing4/_config.js @@ -1,13 +1,15 @@ module.exports = defineTest({ description: 'throws when accessing the file name before the asset source is set', options: { - plugins: { - name: 'test-plugin', - buildStart() { - const assetId = this.emitFile({ type: 'asset' }); - this.getFileName(assetId); + plugins: [ + { + name: 'test-plugin', + buildStart() { + const assetId = this.emitFile({ type: 'asset' }); + this.getFileName(assetId); + } } - } + ] }, error: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/emit-file/asset-source-missing5/_config.js b/test/function/samples/emit-file/asset-source-missing5/_config.js index 346496edb..eb24df981 100644 --- a/test/function/samples/emit-file/asset-source-missing5/_config.js +++ b/test/function/samples/emit-file/asset-source-missing5/_config.js @@ -1,15 +1,17 @@ module.exports = defineTest({ description: 'throws when not setting the asset source and accessing the asset URL', options: { - plugins: { - name: 'test-plugin', - load() { - return `export default import.meta.ROLLUP_FILE_URL_${this.emitFile({ - type: 'asset', - name: 'test.ext' - })};`; + plugins: [ + { + name: 'test-plugin', + load() { + return `export default import.meta.ROLLUP_FILE_URL_${this.emitFile({ + type: 'asset', + name: 'test.ext' + })};`; + } } - } + ] }, generateError: { code: 'ASSET_NOT_FINALISED', diff --git a/test/function/samples/emit-file/chunk-filename-not-available-buildEnd/_config.js b/test/function/samples/emit-file/chunk-filename-not-available-buildEnd/_config.js index 065cde79c..38735eaa0 100644 --- a/test/function/samples/emit-file/chunk-filename-not-available-buildEnd/_config.js +++ b/test/function/samples/emit-file/chunk-filename-not-available-buildEnd/_config.js @@ -4,15 +4,17 @@ module.exports = defineTest({ description: 'Throws when accessing the filename before it has been generated in buildEnd', options: { input: 'main.js', - plugins: { - name: 'test-plugin', - buildStart() { - chunkId = this.emitFile({ type: 'chunk', id: 'chunk.js' }); - }, - buildEnd() { - this.getFileName(chunkId); + plugins: [ + { + name: 'test-plugin', + buildStart() { + chunkId = this.emitFile({ type: 'chunk', id: 'chunk.js' }); + }, + buildEnd() { + this.getFileName(chunkId); + } } - } + ] }, error: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/emit-file/chunk-filename-not-available-renderStart/_config.js b/test/function/samples/emit-file/chunk-filename-not-available-renderStart/_config.js index 8879dc2cb..ce3bb7634 100644 --- a/test/function/samples/emit-file/chunk-filename-not-available-renderStart/_config.js +++ b/test/function/samples/emit-file/chunk-filename-not-available-renderStart/_config.js @@ -4,15 +4,17 @@ module.exports = defineTest({ description: 'Throws when accessing the filename before it has been generated in renderStart', options: { input: 'main.js', - plugins: { - name: 'test-plugin', - buildStart() { - chunkId = this.emitFile({ type: 'chunk', id: 'chunk.js' }); - }, - renderStart() { - this.getFileName(chunkId); + plugins: [ + { + name: 'test-plugin', + buildStart() { + chunkId = this.emitFile({ type: 'chunk', id: 'chunk.js' }); + }, + renderStart() { + this.getFileName(chunkId); + } } - } + ] }, generateError: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/emit-file/chunk-filename-not-available/_config.js b/test/function/samples/emit-file/chunk-filename-not-available/_config.js index 9eaa429e4..0d7d45e91 100644 --- a/test/function/samples/emit-file/chunk-filename-not-available/_config.js +++ b/test/function/samples/emit-file/chunk-filename-not-available/_config.js @@ -2,13 +2,15 @@ module.exports = defineTest({ description: 'Throws when accessing the filename before it has been generated', options: { input: 'main.js', - plugins: { - name: 'test-plugin', - buildStart() { - const chunkId = this.emitFile({ type: 'chunk', id: 'chunk.js' }); - this.getFileName(chunkId); + plugins: [ + { + name: 'test-plugin', + buildStart() { + const chunkId = this.emitFile({ type: 'chunk', id: 'chunk.js' }); + this.getFileName(chunkId); + } } - } + ] }, error: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/emit-file/chunk-not-found/_config.js b/test/function/samples/emit-file/chunk-not-found/_config.js index ebfa97a6b..458540b30 100644 --- a/test/function/samples/emit-file/chunk-not-found/_config.js +++ b/test/function/samples/emit-file/chunk-not-found/_config.js @@ -5,11 +5,13 @@ module.exports = defineTest({ description: 'Throws if an emitted entry chunk cannot be resolved', options: { input: 'main.js', - plugins: { - buildStart() { - this.emitFile({ type: 'chunk', id: 'not-found.js' }); + plugins: [ + { + buildStart() { + this.emitFile({ type: 'chunk', id: 'not-found.js' }); + } } - } + ] }, error: { code: 'UNRESOLVED_ENTRY', diff --git a/test/function/samples/emit-file/emit-from-output-options/_config.js b/test/function/samples/emit-file/emit-from-output-options/_config.js index ddbf0a832..67c990065 100644 --- a/test/function/samples/emit-file/emit-from-output-options/_config.js +++ b/test/function/samples/emit-file/emit-from-output-options/_config.js @@ -2,14 +2,16 @@ module.exports = defineTest({ description: 'throws when trying to emit files from the outputOptions hook', options: { input: 'main', - plugins: { - outputOptions() { - this.emitFile({ - type: 'asset', - source: 'asset' - }); + plugins: [ + { + outputOptions() { + this.emitFile({ + type: 'asset', + source: 'asset' + }); + } } - } + ] }, generateError: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/emit-file/file-references-in-bundle/_config.js b/test/function/samples/emit-file/file-references-in-bundle/_config.js index 3f676dc34..815c35b56 100644 --- a/test/function/samples/emit-file/file-references-in-bundle/_config.js +++ b/test/function/samples/emit-file/file-references-in-bundle/_config.js @@ -5,28 +5,30 @@ module.exports = defineTest({ description: 'lists referenced files in the bundle', options: { input: 'main', - plugins: { - transform() { - return `export const asset = import.meta.ROLLUP_FILE_URL_${this.emitFile({ - type: 'asset', - name: 'asset.txt', - source: 'asset' - })};\nexport const chunk = import.meta.ROLLUP_FILE_URL_${this.emitFile({ - type: 'chunk', - id: 'ref.js' - })};\nexport const urlEncoding = import.meta.ROLLUP_FILE_URL_${this.emitFile({ - type: 'chunk', - id: 'My%2FFile.js' - })}`; - }, - generateBundle(options, bundle) { - assert.deepStrictEqual(bundle['main.js'].referencedFiles, [ - 'assets/asset.txt', - 'chunks/ref.js', - 'chunks/My%2FFile.js' - ]); + plugins: [ + { + transform() { + return `export const asset = import.meta.ROLLUP_FILE_URL_${this.emitFile({ + type: 'asset', + name: 'asset.txt', + source: 'asset' + })};\nexport const chunk = import.meta.ROLLUP_FILE_URL_${this.emitFile({ + type: 'chunk', + id: 'ref.js' + })};\nexport const urlEncoding = import.meta.ROLLUP_FILE_URL_${this.emitFile({ + type: 'chunk', + id: 'My%2FFile.js' + })}`; + }, + generateBundle(options, bundle) { + assert.deepStrictEqual(bundle['main.js'].referencedFiles, [ + 'assets/asset.txt', + 'chunks/ref.js', + 'chunks/My%2FFile.js' + ]); + } } - }, + ], output: { assetFileNames: 'assets/[name][extname]', chunkFileNames: 'chunks/[name].js' diff --git a/test/function/samples/emit-file/invalid-asset-name/_config.js b/test/function/samples/emit-file/invalid-asset-name/_config.js index acaa2f0f8..27e2dd184 100644 --- a/test/function/samples/emit-file/invalid-asset-name/_config.js +++ b/test/function/samples/emit-file/invalid-asset-name/_config.js @@ -1,12 +1,14 @@ module.exports = defineTest({ description: 'throws for invalid asset names', options: { - plugins: { - name: 'test-plugin', - buildStart() { - this.emitFile({ type: 'asset', name: '/test.ext', source: 'content' }); + plugins: [ + { + name: 'test-plugin', + buildStart() { + this.emitFile({ type: 'asset', name: '/test.ext', source: 'content' }); + } } - } + ] }, error: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/emit-file/invalid-asset-name3/_config.js b/test/function/samples/emit-file/invalid-asset-name3/_config.js index bd071edc7..a882176e1 100644 --- a/test/function/samples/emit-file/invalid-asset-name3/_config.js +++ b/test/function/samples/emit-file/invalid-asset-name3/_config.js @@ -1,12 +1,14 @@ module.exports = defineTest({ description: 'throws for invalid asset names with absolute path on Windows OS', options: { - plugins: { - name: 'test-plugin', - buildStart() { - this.emitFile({ type: 'asset', name: 'F:\\test.ext', source: 'content' }); + plugins: [ + { + name: 'test-plugin', + buildStart() { + this.emitFile({ type: 'asset', name: 'F:\\test.ext', source: 'content' }); + } } - } + ] }, error: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/emit-file/invalid-chunk-id/_config.js b/test/function/samples/emit-file/invalid-chunk-id/_config.js index d72840d73..9b168b7fb 100644 --- a/test/function/samples/emit-file/invalid-chunk-id/_config.js +++ b/test/function/samples/emit-file/invalid-chunk-id/_config.js @@ -1,12 +1,14 @@ module.exports = defineTest({ description: 'throws for invalid chunk ids', options: { - plugins: { - name: 'test-plugin', - buildStart() { - this.emitFile({ type: 'chunk', id: null }); + plugins: [ + { + name: 'test-plugin', + buildStart() { + this.emitFile({ type: 'chunk', id: null }); + } } - } + ] }, error: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/emit-file/invalid-file-type/_config.js b/test/function/samples/emit-file/invalid-file-type/_config.js index a34d42ee7..32d7ffaf4 100644 --- a/test/function/samples/emit-file/invalid-file-type/_config.js +++ b/test/function/samples/emit-file/invalid-file-type/_config.js @@ -1,12 +1,14 @@ module.exports = defineTest({ description: 'throws for invalid file types', options: { - plugins: { - name: 'test-plugin', - buildStart() { - this.emitFile({ type: 'unknown' }); + plugins: [ + { + name: 'test-plugin', + buildStart() { + this.emitFile({ type: 'unknown' }); + } } - } + ] }, error: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/emit-file/invalid-prebuilt-chunk-filename/_config.js b/test/function/samples/emit-file/invalid-prebuilt-chunk-filename/_config.js index dd4e8d9ad..36035d57c 100644 --- a/test/function/samples/emit-file/invalid-prebuilt-chunk-filename/_config.js +++ b/test/function/samples/emit-file/invalid-prebuilt-chunk-filename/_config.js @@ -1,15 +1,17 @@ module.exports = defineTest({ description: 'throws for invalid prebuilt chunks filename', options: { - plugins: { - name: 'test-plugin', - buildStart() { - this.emitFile({ - type: 'prebuilt-chunk', - code: 'console.log("my-chunk")' - }); + plugins: [ + { + name: 'test-plugin', + buildStart() { + this.emitFile({ + type: 'prebuilt-chunk', + code: 'console.log("my-chunk")' + }); + } } - } + ] }, error: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/emit-file/invalid-prebuit-chunk-code/_config.js b/test/function/samples/emit-file/invalid-prebuit-chunk-code/_config.js index f93d6727f..5b02a32bf 100644 --- a/test/function/samples/emit-file/invalid-prebuit-chunk-code/_config.js +++ b/test/function/samples/emit-file/invalid-prebuit-chunk-code/_config.js @@ -1,15 +1,17 @@ module.exports = defineTest({ description: 'throws for invalid prebuilt chunks code', options: { - plugins: { - name: 'test-plugin', - buildStart() { - this.emitFile({ - type: 'prebuilt-chunk', - fileName: 'my-chunk.js' - }); + plugins: [ + { + name: 'test-plugin', + buildStart() { + this.emitFile({ + type: 'prebuilt-chunk', + fileName: 'my-chunk.js' + }); + } } - } + ] }, error: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/emit-file/invalid-reference-id/_config.js b/test/function/samples/emit-file/invalid-reference-id/_config.js index e12a5463e..b7589ef7e 100644 --- a/test/function/samples/emit-file/invalid-reference-id/_config.js +++ b/test/function/samples/emit-file/invalid-reference-id/_config.js @@ -1,12 +1,14 @@ module.exports = defineTest({ description: 'throws for invalid reference ids', options: { - plugins: { - name: 'test-plugin', - load() { - return `export default import.meta.ROLLUP_FILE_URL_invalid;`; + plugins: [ + { + name: 'test-plugin', + load() { + return `export default import.meta.ROLLUP_FILE_URL_invalid;`; + } } - } + ] }, generateError: { code: 'FILE_NOT_FOUND', diff --git a/test/function/samples/emit-file/invalid-set-asset-source-id/_config.js b/test/function/samples/emit-file/invalid-set-asset-source-id/_config.js index ea28ec801..a47185b38 100644 --- a/test/function/samples/emit-file/invalid-set-asset-source-id/_config.js +++ b/test/function/samples/emit-file/invalid-set-asset-source-id/_config.js @@ -1,12 +1,14 @@ module.exports = defineTest({ description: 'throws for invalid asset ids', options: { - plugins: { - name: 'test-plugin', - buildStart() { - this.setAssetSource('invalid', 'content'); + plugins: [ + { + name: 'test-plugin', + buildStart() { + this.setAssetSource('invalid', 'content'); + } } - } + ] }, error: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/emit-file/modules-loaded/_config.js b/test/function/samples/emit-file/modules-loaded/_config.js index 9e76edeff..c6b726214 100644 --- a/test/function/samples/emit-file/modules-loaded/_config.js +++ b/test/function/samples/emit-file/modules-loaded/_config.js @@ -2,12 +2,14 @@ module.exports = defineTest({ description: 'Throws when adding a chunk after the modules have finished loading', options: { input: 'main.js', - plugins: { - name: 'test-plugin', - buildEnd() { - this.emitFile({ type: 'chunk', id: 'chunk.js' }); + plugins: [ + { + name: 'test-plugin', + buildEnd() { + this.emitFile({ type: 'chunk', id: 'chunk.js' }); + } } - } + ] }, error: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/emit-file/no-input/_config.js b/test/function/samples/emit-file/no-input/_config.js index 0665e74b5..e6eaaf3ee 100644 --- a/test/function/samples/emit-file/no-input/_config.js +++ b/test/function/samples/emit-file/no-input/_config.js @@ -2,11 +2,13 @@ module.exports = defineTest({ description: 'It is not necessary to provide an input if a dynamic entry is emitted', options: { input: undefined, - plugins: { - name: 'test-plugin', - buildStart() { - this.emitFile({ type: 'chunk', id: 'chunk.js' }); + plugins: [ + { + name: 'test-plugin', + buildStart() { + this.emitFile({ type: 'chunk', id: 'chunk.js' }); + } } - } + ] } }); diff --git a/test/function/samples/emit-file/set-asset-source-chunk/_config.js b/test/function/samples/emit-file/set-asset-source-chunk/_config.js index ede439795..0ee34ff46 100644 --- a/test/function/samples/emit-file/set-asset-source-chunk/_config.js +++ b/test/function/samples/emit-file/set-asset-source-chunk/_config.js @@ -1,13 +1,15 @@ module.exports = defineTest({ description: 'throws when trying to set the asset source of a chunk', options: { - plugins: { - name: 'test-plugin', - buildStart() { - const referenceId = this.emitFile({ type: 'chunk', id: 'chunk' }); - this.setAssetSource(referenceId, 'hello world'); + plugins: [ + { + name: 'test-plugin', + buildStart() { + const referenceId = this.emitFile({ type: 'chunk', id: 'chunk' }); + this.setAssetSource(referenceId, 'hello world'); + } } - } + ] }, error: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/emit-file/set-asset-source-transform/_config.js b/test/function/samples/emit-file/set-asset-source-transform/_config.js index 667055fdb..246c294ed 100644 --- a/test/function/samples/emit-file/set-asset-source-transform/_config.js +++ b/test/function/samples/emit-file/set-asset-source-transform/_config.js @@ -3,14 +3,16 @@ const path = require('node:path'); module.exports = defineTest({ description: 'throws when setting the asset source in the transform hook', options: { - plugins: { - name: 'test-plugin', - transform(code) { - const assetId = this.emitFile({ type: 'asset', name: 'test.ext' }); - this.setAssetSource(assetId, 'asdf'); - return code; + plugins: [ + { + name: 'test-plugin', + transform(code) { + const assetId = this.emitFile({ type: 'asset', name: 'test.ext' }); + this.setAssetSource(assetId, 'asdf'); + return code; + } } - } + ] }, error: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/emit-file/set-asset-source-twice/_config.js b/test/function/samples/emit-file/set-asset-source-twice/_config.js index 695ed5de0..fd06baa2b 100644 --- a/test/function/samples/emit-file/set-asset-source-twice/_config.js +++ b/test/function/samples/emit-file/set-asset-source-twice/_config.js @@ -1,14 +1,16 @@ module.exports = defineTest({ description: 'throws when setting the asset source twice', options: { - plugins: { - name: 'test-plugin', - buildEnd() { - const assetId = this.emitFile({ type: 'asset', name: 'test.ext' }); - this.setAssetSource(assetId, 'hello world'); - this.setAssetSource(assetId, 'another'); + plugins: [ + { + name: 'test-plugin', + buildEnd() { + const assetId = this.emitFile({ type: 'asset', name: 'test.ext' }); + this.setAssetSource(assetId, 'hello world'); + this.setAssetSource(assetId, 'another'); + } } - } + ] }, error: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/emit-file/set-asset-source-twice2/_config.js b/test/function/samples/emit-file/set-asset-source-twice2/_config.js index 45bcbb9fb..620da4a0c 100644 --- a/test/function/samples/emit-file/set-asset-source-twice2/_config.js +++ b/test/function/samples/emit-file/set-asset-source-twice2/_config.js @@ -1,14 +1,16 @@ module.exports = defineTest({ description: 'throws when setting the asset source twice', options: { - plugins: { - name: 'test-plugin', - buildEnd() { - const assetId = this.emitFile({ type: 'asset' }); - this.setAssetSource(assetId, 'hello world'); - this.setAssetSource(assetId, 'another'); + plugins: [ + { + name: 'test-plugin', + buildEnd() { + const assetId = this.emitFile({ type: 'asset' }); + this.setAssetSource(assetId, 'hello world'); + this.setAssetSource(assetId, 'another'); + } } - } + ] }, error: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/emit-file/set-source-in-output-options/_config.js b/test/function/samples/emit-file/set-source-in-output-options/_config.js index 1f19e4a67..0db140834 100644 --- a/test/function/samples/emit-file/set-source-in-output-options/_config.js +++ b/test/function/samples/emit-file/set-source-in-output-options/_config.js @@ -4,14 +4,16 @@ module.exports = defineTest({ description: 'throws when trying to set file sources in the outputOptions hook', options: { input: 'main', - plugins: { - buildStart() { - referenceId = this.emitFile({ type: 'asset' }); - }, - outputOptions() { - this.setAssetSource(referenceId, 'not allowed'); + plugins: [ + { + buildStart() { + referenceId = this.emitFile({ type: 'asset' }); + }, + outputOptions() { + this.setAssetSource(referenceId, 'not allowed'); + } } - } + ] }, generateError: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/error-parse-json/_config.js b/test/function/samples/error-parse-json/_config.js index d3a36449a..f02689a2b 100644 --- a/test/function/samples/error-parse-json/_config.js +++ b/test/function/samples/error-parse-json/_config.js @@ -8,12 +8,7 @@ module.exports = defineTest({ error: { cause: { pos: 10, - loc: { - line: 2, - column: 8 - }, - raisedAt: 11, - message: 'Unexpected token (2:8)' + message: "Expected ';', '}' or " }, code: 'PARSE_ERROR', id: ID_JSON, @@ -30,6 +25,7 @@ module.exports = defineTest({ 3: } `, watchFiles: [ID_JSON, ID_MAIN], - message: 'Unexpected token (Note that you need @rollup/plugin-json to import JSON files)' + message: + "Expected ';', '}' or (Note that you need @rollup/plugin-json to import JSON files)" } }); diff --git a/test/function/samples/error-parse-unknown-extension/_config.js b/test/function/samples/error-parse-unknown-extension/_config.js index ca130f979..d9268c3cb 100644 --- a/test/function/samples/error-parse-unknown-extension/_config.js +++ b/test/function/samples/error-parse-unknown-extension/_config.js @@ -8,12 +8,7 @@ module.exports = defineTest({ error: { cause: { pos: 0, - loc: { - line: 1, - column: 0 - }, - raisedAt: 1, - message: 'Unexpected token (1:0)' + message: 'Expression expected' }, code: 'PARSE_ERROR', id: ID_CSS, @@ -30,6 +25,7 @@ module.exports = defineTest({ 3: } `, watchFiles: [ID_CSS, ID_MAIN], - message: 'Unexpected token (Note that you need plugins to import files that are not JavaScript)' + message: + 'Expression expected (Note that you need plugins to import files that are not JavaScript)' } }); diff --git a/test/function/samples/export-global/_config.js b/test/function/samples/export-global/_config.js index 888caf9ae..88af9fd8b 100644 --- a/test/function/samples/export-global/_config.js +++ b/test/function/samples/export-global/_config.js @@ -1,12 +1,7 @@ const assert = require('node:assert'); -// This used to be "any global variables in scope can be re-exported" -// This, however, is actually not allowed by the spec and acorn, -// see https://github.com/acornjs/acorn/issues/806 -// Consider reverting this change should this become an acorn option - module.exports = defineTest({ - description: '"variables corresponding to globals can be exported"', + description: 'variables corresponding to globals can be exported', exports(exports) { assert.equal(exports.Buffer, Buffer); diff --git a/test/function/samples/export-global/main.js b/test/function/samples/export-global/main.js index aea02862f..66c7efc94 100644 --- a/test/function/samples/export-global/main.js +++ b/test/function/samples/export-global/main.js @@ -1,2 +1,2 @@ const MyBuffer = Buffer; -export { MyBuffer as Buffer }; +export { MyBuffer as Buffer }; diff --git a/test/function/samples/export-not-at-top-level-fails/_config.js b/test/function/samples/export-not-at-top-level-fails/_config.js index 74eca72d4..a7f314181 100644 --- a/test/function/samples/export-not-at-top-level-fails/_config.js +++ b/test/function/samples/export-not-at-top-level-fails/_config.js @@ -6,12 +6,7 @@ module.exports = defineTest({ error: { cause: { pos: 19, - loc: { - line: 2, - column: 2 - }, - raisedAt: 25, - message: "'import' and 'export' may only appear at the top level (2:2)" + message: "'import', and 'export' cannot be used outside of module code" }, code: 'PARSE_ERROR', id: ID_MAIN, @@ -28,6 +23,6 @@ module.exports = defineTest({ 3: } `, watchFiles: [ID_MAIN], - message: "'import' and 'export' may only appear at the top level" + message: "'import', and 'export' cannot be used outside of module code" } }); diff --git a/test/function/samples/external-entry-point-object/_config.js b/test/function/samples/external-entry-point-object/_config.js index 4618a0f27..d406ffa25 100644 --- a/test/function/samples/external-entry-point-object/_config.js +++ b/test/function/samples/external-entry-point-object/_config.js @@ -1,11 +1,13 @@ module.exports = defineTest({ description: 'throws for entry points that are resolved as an external object by plugins', options: { - plugins: { - resolveId(id) { - return { id, external: true }; + plugins: [ + { + resolveId(id) { + return { id, external: true }; + } } - } + ] }, error: { code: 'UNRESOLVED_ENTRY', diff --git a/test/function/samples/external-entry-point/_config.js b/test/function/samples/external-entry-point/_config.js index bfaa5d822..e4aabd39e 100644 --- a/test/function/samples/external-entry-point/_config.js +++ b/test/function/samples/external-entry-point/_config.js @@ -1,11 +1,13 @@ module.exports = defineTest({ description: 'throws for entry points that are resolved as false by plugins', options: { - plugins: { - resolveId() { - return false; + plugins: [ + { + resolveId() { + return false; + } } - } + ] }, error: { code: 'UNRESOLVED_ENTRY', diff --git a/test/function/samples/external-resolved/_config.js b/test/function/samples/external-resolved/_config.js index 9e00a9bac..9a1826619 100644 --- a/test/function/samples/external-resolved/_config.js +++ b/test/function/samples/external-resolved/_config.js @@ -30,27 +30,29 @@ module.exports = defineTest({ testedIds.push(id); return id.startsWith('resolved'); }, - plugins: { - name: 'test-plugin', - resolveId(source) { - switch (source) { - case 'resolve-string': { - return 'resolved-string'; - } - case 'resolve-external': { - return false; - } - case 'resolve-object': { - return { id: 'resolved-object', external: false }; - } - case 'resolve-object-external': { - return { id: 'resolved-object-external', external: true }; - } - default: { - return null; + plugins: [ + { + name: 'test-plugin', + resolveId(source) { + switch (source) { + case 'resolve-string': { + return 'resolved-string'; + } + case 'resolve-external': { + return false; + } + case 'resolve-object': { + return { id: 'resolved-object', external: false }; + } + case 'resolve-object-external': { + return { id: 'resolved-object-external', external: true }; + } + default: { + return null; + } } } } - } + ] } }); diff --git a/test/function/samples/function-asm-directive/main.js b/test/function/samples/function-asm-directive/main.js index 48744f957..252fa6ccb 100644 --- a/test/function/samples/function-asm-directive/main.js +++ b/test/function/samples/function-asm-directive/main.js @@ -2,4 +2,4 @@ export function a() { "use asm"; return 1; -} \ No newline at end of file +} diff --git a/test/function/samples/function-directive-not-first/main.js b/test/function/samples/function-directive-not-first/main.js index 55e83d932..b37630754 100644 --- a/test/function/samples/function-directive-not-first/main.js +++ b/test/function/samples/function-directive-not-first/main.js @@ -2,4 +2,4 @@ export function a() { const x = 1; "use asm"; return x; -} \ No newline at end of file +} diff --git a/test/function/samples/handle-missing-export-source/_config.js b/test/function/samples/handle-missing-export-source/_config.js index 80f965ccb..4e16bba9b 100644 --- a/test/function/samples/handle-missing-export-source/_config.js +++ b/test/function/samples/handle-missing-export-source/_config.js @@ -1,15 +1,18 @@ module.exports = defineTest({ description: 'does not fail if a pre-generated AST is omitting the source property of an unused named export (#3210)', + verifyAst: false, options: { - plugins: { - transform(code, id) { - if (id.endsWith('foo.js')) { - const ast = this.parse(code); - delete ast.body.find(node => node.type === 'ExportNamedDeclaration').source; - return { code, ast }; + plugins: [ + { + transform(code, id) { + if (id.endsWith('foo.js')) { + const ast = this.parse(code); + delete ast.body.find(node => node.type === 'ExportNamedDeclaration').source; + return { code, ast }; + } } } - } + ] } }); diff --git a/test/function/samples/implicit-dependencies/dependant-dynamic-import-no-effects/_config.js b/test/function/samples/implicit-dependencies/dependant-dynamic-import-no-effects/_config.js index e9ad92105..c5449ab26 100644 --- a/test/function/samples/implicit-dependencies/dependant-dynamic-import-no-effects/_config.js +++ b/test/function/samples/implicit-dependencies/dependant-dynamic-import-no-effects/_config.js @@ -3,16 +3,18 @@ const path = require('node:path'); module.exports = defineTest({ description: 'throws when a module that is loaded before an emitted chunk is fully tree-shaken', options: { - plugins: { - name: 'test-plugin', - buildStart() { - this.emitFile({ - type: 'chunk', - id: 'dep.js', - implicitlyLoadedAfterOneOf: ['dependant'] - }); + plugins: [ + { + name: 'test-plugin', + buildStart() { + this.emitFile({ + type: 'chunk', + id: 'dep.js', + implicitlyLoadedAfterOneOf: ['dependant'] + }); + } } - } + ] }, error: { code: 'MISSING_IMPLICIT_DEPENDANT', diff --git a/test/function/samples/implicit-dependencies/dependant-dynamic-import-not-included/_config.js b/test/function/samples/implicit-dependencies/dependant-dynamic-import-not-included/_config.js index fbc85389e..8050503e3 100644 --- a/test/function/samples/implicit-dependencies/dependant-dynamic-import-not-included/_config.js +++ b/test/function/samples/implicit-dependencies/dependant-dynamic-import-not-included/_config.js @@ -4,21 +4,23 @@ module.exports = defineTest({ description: 'throws when a module that is loaded before an emitted chunk is only linked to the module graph via a tree-shaken dynamic import', options: { - plugins: { - name: 'test-plugin', - buildStart() { - this.emitFile({ - type: 'chunk', - id: 'dep1.js', - implicitlyLoadedAfterOneOf: ['dependant'] - }); - this.emitFile({ - type: 'chunk', - id: 'dep2.js', - implicitlyLoadedAfterOneOf: ['dependant'] - }); + plugins: [ + { + name: 'test-plugin', + buildStart() { + this.emitFile({ + type: 'chunk', + id: 'dep1.js', + implicitlyLoadedAfterOneOf: ['dependant'] + }); + this.emitFile({ + type: 'chunk', + id: 'dep2.js', + implicitlyLoadedAfterOneOf: ['dependant'] + }); + } } - } + ] }, error: { code: 'MISSING_IMPLICIT_DEPENDANT', diff --git a/test/function/samples/implicit-dependencies/dependant-not-part-of-graph/_config.js b/test/function/samples/implicit-dependencies/dependant-not-part-of-graph/_config.js index 1239ea0e1..1f13bd683 100644 --- a/test/function/samples/implicit-dependencies/dependant-not-part-of-graph/_config.js +++ b/test/function/samples/implicit-dependencies/dependant-not-part-of-graph/_config.js @@ -4,26 +4,28 @@ module.exports = defineTest({ description: 'throws when a module that is loaded before an emitted chunk is not part of the module graph', options: { - plugins: { - name: 'test-plugin', - buildStart() { - this.emitFile({ - type: 'chunk', - id: 'dep1.js', - implicitlyLoadedAfterOneOf: ['dependant'] - }); - this.emitFile({ - type: 'chunk', - id: 'dep2.js', - implicitlyLoadedAfterOneOf: ['dependant'] - }); - this.emitFile({ - type: 'chunk', - id: 'dep3.js', - implicitlyLoadedAfterOneOf: ['dependant'] - }); + plugins: [ + { + name: 'test-plugin', + buildStart() { + this.emitFile({ + type: 'chunk', + id: 'dep1.js', + implicitlyLoadedAfterOneOf: ['dependant'] + }); + this.emitFile({ + type: 'chunk', + id: 'dep2.js', + implicitlyLoadedAfterOneOf: ['dependant'] + }); + this.emitFile({ + type: 'chunk', + id: 'dep3.js', + implicitlyLoadedAfterOneOf: ['dependant'] + }); + } } - } + ] }, error: { code: 'MISSING_IMPLICIT_DEPENDANT', diff --git a/test/function/samples/implicit-dependencies/external-dependant/_config.js b/test/function/samples/implicit-dependencies/external-dependant/_config.js index 41d775740..3a44a3bc3 100644 --- a/test/function/samples/implicit-dependencies/external-dependant/_config.js +++ b/test/function/samples/implicit-dependencies/external-dependant/_config.js @@ -3,16 +3,18 @@ const path = require('node:path'); module.exports = defineTest({ description: 'throws when a module that is loaded before an emitted chunk does not exist', options: { - plugins: { - name: 'test-plugin', - buildStart() { - this.emitFile({ - type: 'chunk', - id: 'dep.js', - implicitlyLoadedAfterOneOf: ['does-not-exist'] - }); + plugins: [ + { + name: 'test-plugin', + buildStart() { + this.emitFile({ + type: 'chunk', + id: 'dep.js', + implicitlyLoadedAfterOneOf: ['does-not-exist'] + }); + } } - } + ] }, error: { code: 'MISSING_IMPLICIT_DEPENDANT', diff --git a/test/function/samples/implicit-dependencies/missing-dependant/_config.js b/test/function/samples/implicit-dependencies/missing-dependant/_config.js index 3b833ff05..5fbdd5d7e 100644 --- a/test/function/samples/implicit-dependencies/missing-dependant/_config.js +++ b/test/function/samples/implicit-dependencies/missing-dependant/_config.js @@ -3,21 +3,23 @@ const path = require('node:path'); module.exports = defineTest({ description: 'throws when a module that is loaded before an emitted chunk is external', options: { - plugins: { - name: 'test-plugin', - resolveId(id) { - if (id === 'external') { - return false; + plugins: [ + { + name: 'test-plugin', + resolveId(id) { + if (id === 'external') { + return false; + } + }, + buildStart() { + this.emitFile({ + type: 'chunk', + id: 'dep.js', + implicitlyLoadedAfterOneOf: ['external'] + }); } - }, - buildStart() { - this.emitFile({ - type: 'chunk', - id: 'dep.js', - implicitlyLoadedAfterOneOf: ['external'] - }); } - } + ] }, error: { code: 'MISSING_IMPLICIT_DEPENDANT', diff --git a/test/function/samples/import-assertions/plugin-assertions-this-resolve/_config.js b/test/function/samples/import-assertions/plugin-assertions-this-resolve/_config.js index fa8f8b69e..982aa5b54 100644 --- a/test/function/samples/import-assertions/plugin-assertions-this-resolve/_config.js +++ b/test/function/samples/import-assertions/plugin-assertions-this-resolve/_config.js @@ -1,7 +1,7 @@ const assert = require('node:assert'); module.exports = defineTest({ - description: 'allows plugins to provide assertions for this.resolve', + description: 'allows plugins to provide attributes for this.resolve', options: { plugins: [ { @@ -10,10 +10,10 @@ module.exports = defineTest({ assert.deepStrictEqual( await this.resolve('external', undefined, { skipSelf: true, - assertions: { a: 'c', b: 'd' } + attributes: { a: 'c', b: 'd' } }), { - assertions: { a: 'changed', b: 'changed' }, + attributes: { a: 'changed', b: 'changed' }, external: true, id: 'external', meta: {}, @@ -26,20 +26,20 @@ module.exports = defineTest({ }, { name: 'second', - async resolveId(source, importer, { assertions }) { + async resolveId(source, importer, { attributes }) { if (source === 'external') { - return this.resolve(source, importer, { assertions, skipSelf: true }); + return this.resolve(source, importer, { attributes, skipSelf: true }); } } }, { name: 'third', - async resolveId(source, importer, { assertions }) { + async resolveId(source, importer, { attributes }) { if (source === 'external') { return { id: source, external: true, - assertions: Object.fromEntries(Object.keys(assertions).map(key => [key, 'changed'])) + attributes: Object.fromEntries(Object.keys(attributes).map(key => [key, 'changed'])) }; } } diff --git a/test/function/samples/import-assertions/warn-assertion-conflicts/_config.js b/test/function/samples/import-assertions/warn-assertion-conflicts/_config.js index 45bfe811d..0b3503d14 100644 --- a/test/function/samples/import-assertions/warn-assertion-conflicts/_config.js +++ b/test/function/samples/import-assertions/warn-assertion-conflicts/_config.js @@ -2,13 +2,13 @@ const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ - description: 'warns for conflicting import assertions', + description: 'warns for conflicting import attributes', options: { external: id => id.startsWith('external') }, warnings: [ { - code: 'INCONSISTENT_IMPORT_ASSERTIONS', + code: 'INCONSISTENT_IMPORT_ATTRIBUTES', frame: ` 1: import './other.js'; 2: import 'external' assert { type: 'foo' }; @@ -23,11 +23,11 @@ module.exports = defineTest({ line: 3 }, message: - 'Module "main.js" tried to import "external" with "type": "bar" assertions, but it was already imported elsewhere with "type": "foo" assertions. Please ensure that import assertions for the same module are always consistent.', + 'Module "main.js" tried to import "external" with "type": "bar" attributes, but it was already imported elsewhere with "type": "foo" attributes. Please ensure that import attributes for the same module are always consistent.', pos: 63 }, { - code: 'INCONSISTENT_IMPORT_ASSERTIONS', + code: 'INCONSISTENT_IMPORT_ATTRIBUTES', frame: ` 2: import 'external' assert { type: 'foo' }; 3: import 'external' assert { type: 'bar' }; @@ -42,23 +42,23 @@ module.exports = defineTest({ line: 4 }, message: - 'Module "main.js" tried to import "external" with no assertions, but it was already imported elsewhere with "type": "foo" assertions. Please ensure that import assertions for the same module are always consistent.', + 'Module "main.js" tried to import "external" with no attributes, but it was already imported elsewhere with "type": "foo" attributes. Please ensure that import attributes for the same module are always consistent.', pos: 105 }, { - code: 'INCONSISTENT_IMPORT_ASSERTIONS', + code: 'INCONSISTENT_IMPORT_ATTRIBUTES', message: - 'Module "main.js" tried to import "external" with "type": "baz" assertions, but it was already imported elsewhere with "type": "foo" assertions. Please ensure that import assertions for the same module are always consistent.' + 'Module "main.js" tried to import "external" with "type": "baz" attributes, but it was already imported elsewhere with "type": "foo" attributes. Please ensure that import attributes for the same module are always consistent.' }, { - code: 'INCONSISTENT_IMPORT_ASSERTIONS', + code: 'INCONSISTENT_IMPORT_ATTRIBUTES', message: - 'Module "other.js" tried to import "external" with "type": "quuz" assertions, but it was already imported elsewhere with "type": "foo" assertions. Please ensure that import assertions for the same module are always consistent.' + 'Module "other.js" tried to import "external" with "type": "quuz" attributes, but it was already imported elsewhere with "type": "foo" attributes. Please ensure that import attributes for the same module are always consistent.' }, { - code: 'INCONSISTENT_IMPORT_ASSERTIONS', + code: 'INCONSISTENT_IMPORT_ATTRIBUTES', message: - 'Module "other.js" tried to import "dep.js" with "type": "bar" assertions, but it was already imported elsewhere with "type": "foo" assertions. Please ensure that import assertions for the same module are always consistent.' + 'Module "other.js" tried to import "dep.js" with "type": "bar" attributes, but it was already imported elsewhere with "type": "foo" attributes. Please ensure that import attributes for the same module are always consistent.' } ] }); diff --git a/test/function/samples/import-assertions/warn-unresolvable-assertions/_config.js b/test/function/samples/import-assertions/warn-unresolvable-assertions/_config.js new file mode 100644 index 000000000..a5c68b355 --- /dev/null +++ b/test/function/samples/import-assertions/warn-unresolvable-assertions/_config.js @@ -0,0 +1,141 @@ +const path = require('node:path'); +const ID_MAIN = path.join(__dirname, 'main.js'); + +module.exports = defineTest({ + description: 'warns for dynamic import attributes that cannot be resolved', + verifyAst: false, + options: { + external: id => id.startsWith('external') + }, + warnings: [ + { + code: 'INVALID_IMPORT_ATTRIBUTE', + message: + 'Rollup could not statically analyze an import attribute of a dynamic import in "main.js". Import attributes need to have string keys and values. The attribute will be removed.', + id: ID_MAIN, + pos: 0, + loc: { + column: 0, + file: ID_MAIN, + line: 1 + }, + frame: ` + 1: import('external1', undefined); + ^ + 2: import('external2', global); + 3: import('external3', { with: 'invalid' });` + }, + { + code: 'INVALID_IMPORT_ATTRIBUTE', + message: + 'Rollup could not statically analyze an import attribute of a dynamic import in "main.js". Import attributes need to have string keys and values. The attribute will be removed.', + id: ID_MAIN, + pos: 32, + loc: { + column: 0, + file: ID_MAIN, + line: 2 + }, + frame: ` + 1: import('external1', undefined); + 2: import('external2', global); + ^ + 3: import('external3', { with: 'invalid' }); + 4: import('external4', { with: { foo } });` + }, + { + code: 'INVALID_IMPORT_ATTRIBUTE', + message: + 'Rollup could not statically analyze an import attribute of a dynamic import in "main.js". Import attributes need to have string keys and values. The attribute will be removed.', + id: ID_MAIN, + pos: 133, + loc: { + column: 30, + file: ID_MAIN, + line: 4 + }, + frame: ` + 2: import('external2', global); + 3: import('external3', { with: 'invalid' }); + 4: import('external4', { with: { foo } }); + ^ + 5: import('external5', { with: { foo: bar } }); + 6: import('external6', { with: { foo() {} } });` + }, + { + code: 'INVALID_IMPORT_ATTRIBUTE', + message: + 'Rollup could not statically analyze an import attribute of a dynamic import in "main.js". Import attributes need to have string keys and values. The attribute will be removed.', + id: ID_MAIN, + pos: 173, + loc: { + column: 30, + file: ID_MAIN, + line: 5 + }, + frame: ` + 3: import('external3', { with: 'invalid' }); + 4: import('external4', { with: { foo } }); + 5: import('external5', { with: { foo: bar } }); + ^ + 6: import('external6', { with: { foo() {} } }); + 7: import('external7', { with: { [invalid]: 'foo' } });` + }, + { + code: 'INVALID_IMPORT_ATTRIBUTE', + message: + 'Rollup could not statically analyze an import attribute of a dynamic import in "main.js". Import attributes need to have string keys and values. The attribute will be removed.', + id: ID_MAIN, + pos: 218, + loc: { + column: 30, + file: ID_MAIN, + line: 6 + }, + frame: ` + 4: import('external4', { with: { foo } }); + 5: import('external5', { with: { foo: bar } }); + 6: import('external6', { with: { foo() {} } }); + ^ + 7: import('external7', { with: { [invalid]: 'foo' } }); + 8: import('external8', { with: { foo: 'valid' } });` + }, + { + code: 'INVALID_IMPORT_ATTRIBUTE', + message: + 'Rollup could not statically analyze an import attribute of a dynamic import in "main.js". Import attributes need to have string keys and values. The attribute will be removed.', + id: ID_MAIN, + pos: 263, + loc: { + column: 30, + file: ID_MAIN, + line: 7 + }, + frame: ` + 5: import('external5', { with: { foo: bar } }); + 6: import('external6', { with: { foo() {} } }); + 7: import('external7', { with: { [invalid]: 'foo' } }); + ^ + 8: import('external8', { with: { foo: 'valid' } });` + }, + { + code: 'INVALID_IMPORT_ATTRIBUTE', + message: + 'Rollup could not statically analyze the options argument of a dynamic import in "main.js". Dynamic import options need to be an object with a nested attributes object.', + id: ID_MAIN, + pos: 61, + loc: { + column: 0, + file: ID_MAIN, + line: 3 + }, + frame: ` + 1: import('external1', undefined); + 2: import('external2', global); + 3: import('external3', { with: 'invalid' }); + ^ + 4: import('external4', { with: { foo } }); + 5: import('external5', { with: { foo: bar } });` + } + ] +}); diff --git a/test/function/samples/import-assertions/warn-unresolvable-assertions/main.js b/test/function/samples/import-assertions/warn-unresolvable-assertions/main.js new file mode 100644 index 000000000..fdc32760c --- /dev/null +++ b/test/function/samples/import-assertions/warn-unresolvable-assertions/main.js @@ -0,0 +1,8 @@ +import('external1', undefined); +import('external2', global); +import('external3', { with: 'invalid' }); +import('external4', { with: { foo } }); +import('external5', { with: { foo: bar } }); +import('external6', { with: { foo() {} } }); +import('external7', { with: { [invalid]: 'foo' } }); +import('external8', { with: { foo: 'valid' } }); diff --git a/test/function/samples/import-not-at-top-level-fails/_config.js b/test/function/samples/import-not-at-top-level-fails/_config.js index 9cf9999a0..9339c8017 100644 --- a/test/function/samples/import-not-at-top-level-fails/_config.js +++ b/test/function/samples/import-not-at-top-level-fails/_config.js @@ -6,12 +6,7 @@ module.exports = defineTest({ error: { cause: { pos: 19, - loc: { - line: 2, - column: 2 - }, - raisedAt: 25, - message: "'import' and 'export' may only appear at the top level (2:2)" + message: "'import', and 'export' cannot be used outside of module code" }, code: 'PARSE_ERROR', id: ID_MAIN, @@ -28,6 +23,6 @@ module.exports = defineTest({ 3: } `, watchFiles: [ID_MAIN], - message: "'import' and 'export' may only appear at the top level" + message: "'import', and 'export' cannot be used outside of module code" } }); diff --git a/test/function/samples/inline-dynamic-imports-bundle/_config.js b/test/function/samples/inline-dynamic-imports-bundle/_config.js index c5c4a99d7..a0e47b6a7 100644 --- a/test/function/samples/inline-dynamic-imports-bundle/_config.js +++ b/test/function/samples/inline-dynamic-imports-bundle/_config.js @@ -5,13 +5,15 @@ module.exports = defineTest({ description: 'ignores non-bundled modules when inlining dynamic imports', options: { output: { inlineDynamicImports: true }, - plugins: { - generateBundle(options, bundle) { - assert.deepStrictEqual(Object.keys(bundle['main.js'].modules), [ - path.join(__dirname, 'lib.js'), - path.join(__dirname, 'main.js') - ]); + plugins: [ + { + generateBundle(options, bundle) { + assert.deepStrictEqual(Object.keys(bundle['main.js'].modules), [ + path.join(__dirname, 'lib.js'), + path.join(__dirname, 'main.js') + ]); + } } - } + ] } }); diff --git a/test/function/samples/internal-reexports-from-external/_config.js b/test/function/samples/internal-reexports-from-external/_config.js index 88e1dcb3a..ba58c6ea6 100644 --- a/test/function/samples/internal-reexports-from-external/_config.js +++ b/test/function/samples/internal-reexports-from-external/_config.js @@ -6,17 +6,19 @@ module.exports = defineTest({ description: 'supports namespaces with external star reexports', options: { external: ['fs', 'path'], - plugins: { - transform(code, id) { - if (id.endsWith('override.js')) { - return { - code, - syntheticNamedExports: true - }; + plugins: [ + { + transform(code, id) { + if (id.endsWith('override.js')) { + return { + code, + syntheticNamedExports: true + }; + } + return null; } - return null; } - } + ] }, exports(exports) { assert.strictEqual(exports.fs.readFile, fs.readFile); diff --git a/test/function/samples/invalid-addon-hook/_config.js b/test/function/samples/invalid-addon-hook/_config.js index 685dd940e..af0868765 100644 --- a/test/function/samples/invalid-addon-hook/_config.js +++ b/test/function/samples/invalid-addon-hook/_config.js @@ -1,9 +1,7 @@ module.exports = defineTest({ description: 'throws when providing a non-string value for an addon hook', options: { - plugins: { - intro: 42 - } + plugins: [{ intro: 42 }] }, generateError: { code: 'ADDON_ERROR', diff --git a/test/function/samples/manual-chunks-info/_config.js b/test/function/samples/manual-chunks-info/_config.js index 6bcbf2c1c..93dac2272 100644 --- a/test/function/samples/manual-chunks-info/_config.js +++ b/test/function/samples/manual-chunks-info/_config.js @@ -21,7 +21,7 @@ module.exports = defineTest({ { [getId('dynamic')]: { id: getId('dynamic'), - assertions: {}, + attributes: {}, ast: { type: 'Program', start: 0, @@ -82,7 +82,7 @@ module.exports = defineTest({ code: "export const promise = import('external');\nexport { default as internal } from './lib';\n", dynamicallyImportedIdResolutions: [ { - assertions: {}, + attributes: {}, external: true, id: 'external', meta: {}, @@ -101,7 +101,7 @@ module.exports = defineTest({ implicitlyLoadedBefore: [], importedIdResolutions: [ { - assertions: {}, + attributes: {}, external: false, id: getId('lib'), meta: {}, @@ -120,7 +120,7 @@ module.exports = defineTest({ }, [getId('lib')]: { id: getId('lib'), - assertions: {}, + attributes: {}, ast: { type: 'Program', start: 0, @@ -156,7 +156,7 @@ module.exports = defineTest({ }, [getId('main')]: { id: getId('main'), - assertions: {}, + attributes: {}, ast: { type: 'Program', start: 0, @@ -239,7 +239,7 @@ module.exports = defineTest({ code: "export const promise = import('./dynamic');\nexport { default as value } from './lib';\nexport { external } from 'external';\n", dynamicallyImportedIdResolutions: [ { - assertions: {}, + attributes: {}, external: false, id: getId('dynamic'), meta: {}, @@ -262,7 +262,7 @@ module.exports = defineTest({ implicitlyLoadedBefore: [], importedIdResolutions: [ { - assertions: {}, + attributes: {}, external: false, id: getId('lib'), meta: {}, @@ -271,7 +271,7 @@ module.exports = defineTest({ syntheticNamedExports: false }, { - assertions: {}, + attributes: {}, external: true, id: 'external', meta: {}, @@ -290,7 +290,7 @@ module.exports = defineTest({ }, external: { id: 'external', - assertions: {}, + attributes: {}, ast: null, code: null, dynamicallyImportedIdResolutions: [], diff --git a/test/function/samples/module-parsed-hook/_config.js b/test/function/samples/module-parsed-hook/_config.js index 3987d551c..2bc4027b4 100644 --- a/test/function/samples/module-parsed-hook/_config.js +++ b/test/function/samples/module-parsed-hook/_config.js @@ -9,129 +9,131 @@ const ID_DEP = path.join(__dirname, 'dep.js'); module.exports = defineTest({ description: 'calls the moduleParsedHook once a module is parsed', options: { - plugins: { - name: 'test-plugin', - moduleParsed(moduleInfo) { - parsedModules.push(moduleInfo); - }, - buildEnd() { - assert.deepStrictEqual(JSON.parse(JSON.stringify(parsedModules)), [ - { - id: ID_MAIN, - assertions: {}, - ast: { - type: 'Program', - start: 0, - end: 34, - body: [ - { - type: 'ExportNamedDeclaration', - start: 0, - end: 33, - declaration: null, - specifiers: [ - { - type: 'ExportSpecifier', - start: 9, - end: 14, - local: { type: 'Identifier', start: 9, end: 14, name: 'value' }, - exported: { type: 'Identifier', start: 9, end: 14, name: 'value' } - } - ], - source: { - type: 'Literal', - start: 22, - end: 32, - value: './dep.js', - raw: "'./dep.js'" - } - } - ], - sourceType: 'module' - }, - code: "export { value } from './dep.js';\n", - dynamicallyImportedIdResolutions: [], - dynamicallyImportedIds: [], - dynamicImporters: [], - exportedBindings: { '.': [], './dep.js': ['value'] }, - exports: ['value'], - hasDefaultExport: false, - moduleSideEffects: true, - implicitlyLoadedAfterOneOf: [], - implicitlyLoadedBefore: [], - importedIdResolutions: [ - { - assertions: {}, - external: false, - id: ID_DEP, - meta: {}, - moduleSideEffects: true, - resolvedBy: 'rollup', - syntheticNamedExports: false - } - ], - importedIds: [ID_DEP], - importers: [], - isEntry: true, - isExternal: false, - isIncluded: false, - meta: {}, - syntheticNamedExports: false - }, - { - id: ID_DEP, - assertions: {}, - ast: { - type: 'Program', - start: 0, - end: 25, - body: [ - { - type: 'ExportNamedDeclaration', - start: 0, - end: 24, - declaration: { - type: 'VariableDeclaration', - start: 7, - end: 24, - declarations: [ + plugins: [ + { + name: 'test-plugin', + moduleParsed(moduleInfo) { + parsedModules.push(moduleInfo); + }, + buildEnd() { + assert.deepStrictEqual(JSON.parse(JSON.stringify(parsedModules)), [ + { + id: ID_MAIN, + attributes: {}, + ast: { + type: 'Program', + start: 0, + end: 34, + body: [ + { + type: 'ExportNamedDeclaration', + start: 0, + end: 33, + declaration: null, + specifiers: [ { - type: 'VariableDeclarator', - start: 13, - end: 23, - id: { type: 'Identifier', start: 13, end: 18, name: 'value' }, - init: { type: 'Literal', start: 21, end: 23, value: 42, raw: '42' } + type: 'ExportSpecifier', + start: 9, + end: 14, + local: { type: 'Identifier', start: 9, end: 14, name: 'value' }, + exported: { type: 'Identifier', start: 9, end: 14, name: 'value' } } ], - kind: 'const' - }, - specifiers: [], - source: null + source: { + type: 'Literal', + start: 22, + end: 32, + value: './dep.js', + raw: "'./dep.js'" + } + } + ], + sourceType: 'module' + }, + code: "export { value } from './dep.js';\n", + dynamicallyImportedIdResolutions: [], + dynamicallyImportedIds: [], + dynamicImporters: [], + exportedBindings: { '.': [], './dep.js': ['value'] }, + exports: ['value'], + hasDefaultExport: false, + moduleSideEffects: true, + implicitlyLoadedAfterOneOf: [], + implicitlyLoadedBefore: [], + importedIdResolutions: [ + { + attributes: {}, + external: false, + id: ID_DEP, + meta: {}, + moduleSideEffects: true, + resolvedBy: 'rollup', + syntheticNamedExports: false } ], - sourceType: 'module' + importedIds: [ID_DEP], + importers: [], + isEntry: true, + isExternal: false, + isIncluded: false, + meta: {}, + syntheticNamedExports: false }, - code: 'export const value = 42;\n', - dynamicallyImportedIdResolutions: [], - dynamicallyImportedIds: [], - dynamicImporters: [], - exportedBindings: { '.': ['value'] }, - exports: ['value'], - hasDefaultExport: false, - moduleSideEffects: true, - implicitlyLoadedAfterOneOf: [], - implicitlyLoadedBefore: [], - importedIdResolutions: [], - importedIds: [], - importers: [ID_MAIN], - isEntry: false, - isExternal: false, - isIncluded: true, - meta: {}, - syntheticNamedExports: false - } - ]); + { + id: ID_DEP, + attributes: {}, + ast: { + type: 'Program', + start: 0, + end: 25, + body: [ + { + type: 'ExportNamedDeclaration', + start: 0, + end: 24, + declaration: { + type: 'VariableDeclaration', + start: 7, + end: 24, + declarations: [ + { + type: 'VariableDeclarator', + start: 13, + end: 23, + id: { type: 'Identifier', start: 13, end: 18, name: 'value' }, + init: { type: 'Literal', start: 21, end: 23, value: 42, raw: '42' } + } + ], + kind: 'const' + }, + specifiers: [], + source: null + } + ], + sourceType: 'module' + }, + code: 'export const value = 42;\n', + dynamicallyImportedIdResolutions: [], + dynamicallyImportedIds: [], + dynamicImporters: [], + exportedBindings: { '.': ['value'] }, + exports: ['value'], + hasDefaultExport: false, + moduleSideEffects: true, + implicitlyLoadedAfterOneOf: [], + implicitlyLoadedBefore: [], + importedIdResolutions: [], + importedIds: [], + importers: [ID_MAIN], + isEntry: false, + isExternal: false, + isIncluded: true, + meta: {}, + syntheticNamedExports: false + } + ]); + } } - } + ] } }); diff --git a/test/function/samples/module-side-effects/array/_config.js b/test/function/samples/module-side-effects/array/_config.js index 06eb5a435..0b64a85a9 100644 --- a/test/function/samples/module-side-effects/array/_config.js +++ b/test/function/samples/module-side-effects/array/_config.js @@ -35,22 +35,24 @@ module.exports = defineTest({ 'pluginsideeffects-true-external-listed' ] }, - plugins: { - name: 'test-plugin', - resolveId(id) { - if (!path.isAbsolute(id)) { - const moduleSideEffects = JSON.parse(id.split('-')[1]); - if (moduleSideEffects) { - return { id, moduleSideEffects }; + plugins: [ + { + name: 'test-plugin', + resolveId(id) { + if (!path.isAbsolute(id)) { + const moduleSideEffects = JSON.parse(id.split('-')[1]); + if (moduleSideEffects) { + return { id, moduleSideEffects }; + } + return id; + } + }, + load(id) { + if (!path.isAbsolute(id)) { + return `export const value = '${id}'; sideEffects.push(value);`; } - return id; - } - }, - load(id) { - if (!path.isAbsolute(id)) { - return `export const value = '${id}'; sideEffects.push(value);`; } } - } + ] } }); diff --git a/test/function/samples/module-side-effects/external-false/_config.js b/test/function/samples/module-side-effects/external-false/_config.js index 0b3c82f5f..c1854672f 100644 --- a/test/function/samples/module-side-effects/external-false/_config.js +++ b/test/function/samples/module-side-effects/external-false/_config.js @@ -20,29 +20,31 @@ module.exports = defineTest({ treeshake: { moduleSideEffects: 'no-external' }, - plugins: { - name: 'test-plugin', - resolveId(id) { - if (!path.isAbsolute(id)) { - if (id === 'internal') { - return id; + plugins: [ + { + name: 'test-plugin', + resolveId(id) { + if (!path.isAbsolute(id)) { + if (id === 'internal') { + return id; + } + if (id === 'implicit-external') { + return null; + } + const moduleSideEffects = JSON.parse(id.split('-')[1]); + if (moduleSideEffects) { + return { id, moduleSideEffects, external: true }; + } + return { id, external: true }; } - if (id === 'implicit-external') { - return null; + }, + load(id) { + if (!path.isAbsolute(id)) { + return `export const value = '${id}'; sideEffects.push(value);`; } - const moduleSideEffects = JSON.parse(id.split('-')[1]); - if (moduleSideEffects) { - return { id, moduleSideEffects, external: true }; - } - return { id, external: true }; - } - }, - load(id) { - if (!path.isAbsolute(id)) { - return `export const value = '${id}'; sideEffects.push(value);`; } } - } + ] }, warnings: [ { diff --git a/test/function/samples/module-side-effects/global-false/_config.js b/test/function/samples/module-side-effects/global-false/_config.js index 828d4ffe4..05f8d9f6e 100644 --- a/test/function/samples/module-side-effects/global-false/_config.js +++ b/test/function/samples/module-side-effects/global-false/_config.js @@ -19,22 +19,24 @@ module.exports = defineTest({ treeshake: { moduleSideEffects: false }, - plugins: { - name: 'test-plugin', - resolveId(id) { - if (!path.isAbsolute(id)) { - const moduleSideEffects = JSON.parse(id.split('-')[1]); - if (moduleSideEffects) { - return { id, moduleSideEffects }; + plugins: [ + { + name: 'test-plugin', + resolveId(id) { + if (!path.isAbsolute(id)) { + const moduleSideEffects = JSON.parse(id.split('-')[1]); + if (moduleSideEffects) { + return { id, moduleSideEffects }; + } + return id; + } + }, + load(id) { + if (!path.isAbsolute(id)) { + return `export const value = '${id}'; sideEffects.push(value);`; } - return id; - } - }, - load(id) { - if (!path.isAbsolute(id)) { - return `export const value = '${id}'; sideEffects.push(value);`; } } - } + ] } }); diff --git a/test/function/samples/module-side-effects/load/_config.js b/test/function/samples/module-side-effects/load/_config.js index b31dec74d..8937c4ac8 100644 --- a/test/function/samples/module-side-effects/load/_config.js +++ b/test/function/samples/module-side-effects/load/_config.js @@ -23,22 +23,24 @@ module.exports = defineTest({ return JSON.parse(id.split('-')[1]); } }, - plugins: { - name: 'test-plugin', - resolveId(id) { - if (!path.isAbsolute(id)) { - return id; - } - }, - load(id) { - if (!path.isAbsolute(id)) { - const moduleSideEffects = JSON.parse(id.split('-')[3]); - return { - code: `export const value = '${id}'; sideEffects.push(value);`, - moduleSideEffects - }; + plugins: [ + { + name: 'test-plugin', + resolveId(id) { + if (!path.isAbsolute(id)) { + return id; + } + }, + load(id) { + if (!path.isAbsolute(id)) { + const moduleSideEffects = JSON.parse(id.split('-')[3]); + return { + code: `export const value = '${id}'; sideEffects.push(value);`, + moduleSideEffects + }; + } } } - } + ] } }); diff --git a/test/function/samples/module-side-effects/resolve-id-external/_config.js b/test/function/samples/module-side-effects/resolve-id-external/_config.js index 2e0aa6c06..576cf8386 100644 --- a/test/function/samples/module-side-effects/resolve-id-external/_config.js +++ b/test/function/samples/module-side-effects/resolve-id-external/_config.js @@ -37,48 +37,50 @@ module.exports = defineTest({ return JSON.parse(id.split('-')[3]); } }, - plugins: { - name: 'test-plugin', - resolveId(id) { - if (!path.isAbsolute(id)) { - return { - id, - external: true, - moduleSideEffects: JSON.parse(id.split('-')[1]) - }; - } - }, - buildEnd() { - assert.deepStrictEqual( - getObject( - [...this.getModuleIds()] - .filter(id => !path.isAbsolute(id)) - .sort() - .map(id => [id, this.getModuleInfo(id).moduleSideEffects]) - ), - { - 'sideeffects-false-usereffects-false': false, - 'sideeffects-false-usereffects-false-unused-import': false, - 'sideeffects-false-usereffects-false-used-import': false, - 'sideeffects-false-usereffects-true': false, - 'sideeffects-false-usereffects-true-unused-import': false, - 'sideeffects-false-usereffects-true-used-import': false, - 'sideeffects-null-usereffects-false': false, - 'sideeffects-null-usereffects-false-unused-import': false, - 'sideeffects-null-usereffects-false-used-import': false, - 'sideeffects-null-usereffects-true': true, - 'sideeffects-null-usereffects-true-unused-import': true, - 'sideeffects-null-usereffects-true-used-import': true, - 'sideeffects-true-usereffects-false': true, - 'sideeffects-true-usereffects-false-unused-import': true, - 'sideeffects-true-usereffects-false-used-import': true, - 'sideeffects-true-usereffects-true': true, - 'sideeffects-true-usereffects-true-unused-import': true, - 'sideeffects-true-usereffects-true-used-import': true + plugins: [ + { + name: 'test-plugin', + resolveId(id) { + if (!path.isAbsolute(id)) { + return { + id, + external: true, + moduleSideEffects: JSON.parse(id.split('-')[1]) + }; } - ); + }, + buildEnd() { + assert.deepStrictEqual( + getObject( + [...this.getModuleIds()] + .filter(id => !path.isAbsolute(id)) + .sort() + .map(id => [id, this.getModuleInfo(id).moduleSideEffects]) + ), + { + 'sideeffects-false-usereffects-false': false, + 'sideeffects-false-usereffects-false-unused-import': false, + 'sideeffects-false-usereffects-false-used-import': false, + 'sideeffects-false-usereffects-true': false, + 'sideeffects-false-usereffects-true-unused-import': false, + 'sideeffects-false-usereffects-true-used-import': false, + 'sideeffects-null-usereffects-false': false, + 'sideeffects-null-usereffects-false-unused-import': false, + 'sideeffects-null-usereffects-false-used-import': false, + 'sideeffects-null-usereffects-true': true, + 'sideeffects-null-usereffects-true-unused-import': true, + 'sideeffects-null-usereffects-true-used-import': true, + 'sideeffects-true-usereffects-false': true, + 'sideeffects-true-usereffects-false-unused-import': true, + 'sideeffects-true-usereffects-false-used-import': true, + 'sideeffects-true-usereffects-true': true, + 'sideeffects-true-usereffects-true-unused-import': true, + 'sideeffects-true-usereffects-true-used-import': true + } + ); + } } - } + ] }, warnings(warnings) { for (const warning of warnings) { diff --git a/test/function/samples/module-side-effects/resolve-id/_config.js b/test/function/samples/module-side-effects/resolve-id/_config.js index 7ad65ab72..22fa2af86 100644 --- a/test/function/samples/module-side-effects/resolve-id/_config.js +++ b/test/function/samples/module-side-effects/resolve-id/_config.js @@ -32,58 +32,60 @@ module.exports = defineTest({ return JSON.parse(id.split('-')[3]); } }, - plugins: { - name: 'test-plugin', - resolveId(id) { - if (!path.isAbsolute(id)) { - return { - id, - external: false, - moduleSideEffects: JSON.parse(id.split('-')[1]) - }; - } - }, - load(id) { - if (!path.isAbsolute(id)) { - const sideEffects = JSON.parse(id.split('-')[1]); - const userEffects = JSON.parse(id.split('-')[3]); - assert.strictEqual( - this.getModuleInfo(id).moduleSideEffects, - typeof sideEffects === 'boolean' ? sideEffects : userEffects + plugins: [ + { + name: 'test-plugin', + resolveId(id) { + if (!path.isAbsolute(id)) { + return { + id, + external: false, + moduleSideEffects: JSON.parse(id.split('-')[1]) + }; + } + }, + load(id) { + if (!path.isAbsolute(id)) { + const sideEffects = JSON.parse(id.split('-')[1]); + const userEffects = JSON.parse(id.split('-')[3]); + assert.strictEqual( + this.getModuleInfo(id).moduleSideEffects, + typeof sideEffects === 'boolean' ? sideEffects : userEffects + ); + return `export const value = '${id}'; sideEffects.push(value);`; + } + }, + buildEnd() { + assert.deepStrictEqual( + getObject( + [...this.getModuleIds()] + .filter(id => !path.isAbsolute(id)) + .sort() + .map(id => [id, this.getModuleInfo(id).moduleSideEffects]) + ), + { + 'sideeffects-false-usereffects-false': false, + 'sideeffects-false-usereffects-false-unused-import': false, + 'sideeffects-false-usereffects-false-used-import': false, + 'sideeffects-false-usereffects-true': false, + 'sideeffects-false-usereffects-true-unused-import': false, + 'sideeffects-false-usereffects-true-used-import': false, + 'sideeffects-null-usereffects-false': false, + 'sideeffects-null-usereffects-false-unused-import': false, + 'sideeffects-null-usereffects-false-used-import': false, + 'sideeffects-null-usereffects-true': true, + 'sideeffects-null-usereffects-true-unused-import': true, + 'sideeffects-null-usereffects-true-used-import': true, + 'sideeffects-true-usereffects-false': true, + 'sideeffects-true-usereffects-false-unused-import': true, + 'sideeffects-true-usereffects-false-used-import': true, + 'sideeffects-true-usereffects-true': true, + 'sideeffects-true-usereffects-true-unused-import': true, + 'sideeffects-true-usereffects-true-used-import': true + } ); - return `export const value = '${id}'; sideEffects.push(value);`; } - }, - buildEnd() { - assert.deepStrictEqual( - getObject( - [...this.getModuleIds()] - .filter(id => !path.isAbsolute(id)) - .sort() - .map(id => [id, this.getModuleInfo(id).moduleSideEffects]) - ), - { - 'sideeffects-false-usereffects-false': false, - 'sideeffects-false-usereffects-false-unused-import': false, - 'sideeffects-false-usereffects-false-used-import': false, - 'sideeffects-false-usereffects-true': false, - 'sideeffects-false-usereffects-true-unused-import': false, - 'sideeffects-false-usereffects-true-used-import': false, - 'sideeffects-null-usereffects-false': false, - 'sideeffects-null-usereffects-false-unused-import': false, - 'sideeffects-null-usereffects-false-used-import': false, - 'sideeffects-null-usereffects-true': true, - 'sideeffects-null-usereffects-true-unused-import': true, - 'sideeffects-null-usereffects-true-used-import': true, - 'sideeffects-true-usereffects-false': true, - 'sideeffects-true-usereffects-false-unused-import': true, - 'sideeffects-true-usereffects-false-used-import': true, - 'sideeffects-true-usereffects-true': true, - 'sideeffects-true-usereffects-true-unused-import': true, - 'sideeffects-true-usereffects-true-used-import': true - } - ); } - } + ] } }); diff --git a/test/function/samples/non-function-hook-async/_config.js b/test/function/samples/non-function-hook-async/_config.js index fb9aabc78..615a143ee 100644 --- a/test/function/samples/non-function-hook-async/_config.js +++ b/test/function/samples/non-function-hook-async/_config.js @@ -1,9 +1,7 @@ module.exports = defineTest({ description: 'throws when providing a value for an async function hook', options: { - plugins: { - resolveId: 'value' - } + plugins: [{ resolveId: 'value' }] }, error: { code: 'INVALID_PLUGIN_HOOK', diff --git a/test/function/samples/non-function-hook-sync/_config.js b/test/function/samples/non-function-hook-sync/_config.js index f592d0883..3c7e75e4c 100644 --- a/test/function/samples/non-function-hook-sync/_config.js +++ b/test/function/samples/non-function-hook-sync/_config.js @@ -1,9 +1,11 @@ module.exports = defineTest({ description: 'throws when providing a value for a sync function hook', options: { - plugins: { - outputOptions: 'value' - } + plugins: [ + { + outputOptions: 'value' + } + ] }, generateError: { code: 'INVALID_PLUGIN_HOOK', diff --git a/test/function/samples/optional-catch-binding/_config.js b/test/function/samples/optional-catch-binding/_config.js index 5f8cc6162..5ecb6a927 100644 --- a/test/function/samples/optional-catch-binding/_config.js +++ b/test/function/samples/optional-catch-binding/_config.js @@ -1,7 +1,7 @@ const assert = require('node:assert'); module.exports = defineTest({ - description: 'allows optional catch binding with appropriate acorn settings', + description: 'allows optional catch binding', exports(exports) { assert.equal(exports.foo, true); } diff --git a/test/function/samples/options-async-hook/_config.js b/test/function/samples/options-async-hook/_config.js index 382cb0bac..c9d67b796 100644 --- a/test/function/samples/options-async-hook/_config.js +++ b/test/function/samples/options-async-hook/_config.js @@ -3,6 +3,7 @@ const { promises: fs } = require('node:fs'); module.exports = defineTest({ description: 'resolves promises between sequential options hooks', + verifyAst: false, options: { input: 'super-unused', treeshake: false, diff --git a/test/function/samples/options-hook/_config.js b/test/function/samples/options-hook/_config.js index 4eba7691f..c428caf5c 100644 --- a/test/function/samples/options-hook/_config.js +++ b/test/function/samples/options-hook/_config.js @@ -2,54 +2,50 @@ const assert = require('node:assert'); module.exports = defineTest({ description: 'allows to read and modify options in the options hook', + verifyAst: false, options: { input: 'unused', treeshake: false, - plugins: { - name: 'test-plugin', - buildStart(options) { - assert.deepStrictEqual(JSON.parse(JSON.stringify(options)), { - acorn: { - ecmaVersion: 'latest', - sourceType: 'module' - }, - acornInjectPlugins: [null], - context: 'undefined', - experimentalCacheExpiry: 10, - experimentalLogSideEffects: false, - input: ['used'], - logLevel: 'info', - makeAbsoluteExternalsRelative: 'ifRelativeSource', - maxParallelFileOps: 20, - maxParallelFileReads: 20, - perf: false, - plugins: [ - { - name: 'test-plugin' - } - ], - preserveEntrySignatures: 'exports-only', - preserveSymlinks: false, - shimMissingExports: false, - strictDeprecations: true, - treeshake: false - }); - assert.ok(/^\d+\.\d+\.\d+/.test(this.meta.rollupVersion)); - assert.strictEqual(this.meta.watchMode, false); - }, - options(options) { - assert.deepStrictEqual(JSON.parse(JSON.stringify(options)), { - input: 'unused', - plugins: { - name: 'test-plugin' - }, - strictDeprecations: true, - treeshake: false - }); - assert.ok(/^\d+\.\d+\.\d+/.test(this.meta.rollupVersion)); - assert.strictEqual(this.meta.watchMode, false); - return { ...options, input: 'used' }; + plugins: [ + { + name: 'test-plugin', + buildStart(options) { + assert.deepStrictEqual(JSON.parse(JSON.stringify(options)), { + context: 'undefined', + experimentalCacheExpiry: 10, + experimentalLogSideEffects: false, + input: ['used'], + logLevel: 'info', + makeAbsoluteExternalsRelative: 'ifRelativeSource', + maxParallelFileOps: 20, + maxParallelFileReads: 20, + perf: false, + plugins: [ + { + name: 'test-plugin' + } + ], + preserveEntrySignatures: 'exports-only', + preserveSymlinks: false, + shimMissingExports: false, + strictDeprecations: true, + treeshake: false + }); + assert.ok(/^\d+\.\d+\.\d+/.test(this.meta.rollupVersion)); + assert.strictEqual(this.meta.watchMode, false); + }, + options(options) { + assert.deepStrictEqual(JSON.parse(JSON.stringify(options)), { + input: 'unused', + plugins: [{ name: 'test-plugin' }], + strictDeprecations: true, + treeshake: false + }); + assert.ok(/^\d+\.\d+\.\d+/.test(this.meta.rollupVersion)); + assert.strictEqual(this.meta.watchMode, false); + return { ...options, input: 'used' }; + } } - } + ] } }); diff --git a/test/function/samples/options-in-renderstart/_config.js b/test/function/samples/options-in-renderstart/_config.js index 5ffe74bfa..1e4c7b38b 100644 --- a/test/function/samples/options-in-renderstart/_config.js +++ b/test/function/samples/options-in-renderstart/_config.js @@ -5,19 +5,23 @@ module.exports = defineTest({ description: 'makes input and output options available in renderStart', options: { context: 'global', - plugins: { - name: 'input-plugin', - renderStart(outputOptions, inputOptions) { - checkedOptions.push('input-plugin', outputOptions.format, inputOptions.context); - } - }, - output: { - plugins: { - name: 'output-plugin', + plugins: [ + { + name: 'input-plugin', renderStart(outputOptions, inputOptions) { - checkedOptions.push('output-plugin', outputOptions.format, inputOptions.context); + checkedOptions.push('input-plugin', outputOptions.format, inputOptions.context); } } + ], + output: { + plugins: [ + { + name: 'output-plugin', + renderStart(outputOptions, inputOptions) { + checkedOptions.push('output-plugin', outputOptions.format, inputOptions.context); + } + } + ] } }, exports: () => { diff --git a/test/function/samples/output-options-hook/_config.js b/test/function/samples/output-options-hook/_config.js index e967acfc4..5c3d6e338 100644 --- a/test/function/samples/output-options-hook/_config.js +++ b/test/function/samples/output-options-hook/_config.js @@ -12,68 +12,71 @@ module.exports = defineTest({ output: { banner: "throw new Error('unused')" }, - plugins: { - name: 'test-plugin', - renderChunk(code, chunk, options) { - assert.deepStrictEqual(JSON.parse(JSON.stringify(options)), { - amd: { - define: 'define', - autoId: false, - forceJsExtensionForImports: false - }, - assetFileNames: 'assets/[name]-[hash][extname]', - chunkFileNames: '[name]-[hash].js', - compact: false, - dynamicImportInCjs: true, - entryFileNames: '[name].js', - esModule: 'if-default-prop', - experimentalDeepDynamicChunkOptimization: false, - experimentalMinChunkSize: 1, - exports: 'auto', - extend: false, - externalImportAssertions: true, - externalLiveBindings: true, - format: 'cjs', - freeze: true, - generatedCode: { - arrowFunctions: false, - constBindings: false, - objectShorthand: false, - reservedNamesAsProps: true, - symbols: false - }, - globals: {}, - hoistTransitiveImports: true, - indent: true, - inlineDynamicImports: false, - manualChunks: {}, - minifyInternalExports: false, - namespaceToStringTag: false, - noConflict: false, - paths: {}, - plugins: [], - preferConst: false, - preserveModules: false, - sourcemap: false, - sourcemapExcludeSources: false, - strict: true, - systemNullSetters: true, - validate: false - }); - assert.strictEqual(options.banner(), 'exports.bar = 43;'); - assert.ok(/^\d+\.\d+\.\d+/.test(this.meta.rollupVersion)); - assert.strictEqual(this.meta.watchMode, false); - }, - outputOptions(options) { - assert.deepStrictEqual(JSON.parse(JSON.stringify(options)), { - banner: "throw new Error('unused')", - exports: 'auto', - format: 'cjs' - }); - assert.ok(/^\d+\.\d+\.\d+/.test(this.meta.rollupVersion)); - assert.strictEqual(this.meta.watchMode, false); - return { ...options, banner: 'exports.bar = 43;' }; + plugins: [ + { + name: 'test-plugin', + renderChunk(code, chunk, options) { + assert.deepStrictEqual(JSON.parse(JSON.stringify(options)), { + amd: { + define: 'define', + autoId: false, + forceJsExtensionForImports: false + }, + assetFileNames: 'assets/[name]-[hash][extname]', + chunkFileNames: '[name]-[hash].js', + compact: false, + dynamicImportInCjs: true, + entryFileNames: '[name].js', + esModule: 'if-default-prop', + experimentalDeepDynamicChunkOptimization: false, + experimentalMinChunkSize: 1, + exports: 'auto', + extend: false, + externalImportAssertions: true, + externalImportAttributes: true, + externalLiveBindings: true, + format: 'cjs', + freeze: true, + generatedCode: { + arrowFunctions: false, + constBindings: false, + objectShorthand: false, + reservedNamesAsProps: true, + symbols: false + }, + globals: {}, + hoistTransitiveImports: true, + indent: true, + inlineDynamicImports: false, + manualChunks: {}, + minifyInternalExports: false, + namespaceToStringTag: false, + noConflict: false, + paths: {}, + plugins: [], + preferConst: false, + preserveModules: false, + sourcemap: false, + sourcemapExcludeSources: false, + strict: true, + systemNullSetters: true, + validate: false + }); + assert.strictEqual(options.banner(), 'exports.bar = 43;'); + assert.ok(/^\d+\.\d+\.\d+/.test(this.meta.rollupVersion)); + assert.strictEqual(this.meta.watchMode, false); + }, + outputOptions(options) { + assert.deepStrictEqual(JSON.parse(JSON.stringify(options)), { + banner: "throw new Error('unused')", + exports: 'auto', + format: 'cjs' + }); + assert.ok(/^\d+\.\d+\.\d+/.test(this.meta.rollupVersion)); + assert.strictEqual(this.meta.watchMode, false); + return { ...options, banner: 'exports.bar = 43;' }; + } } - } + ] } }); diff --git a/test/function/samples/plugin-cache/anonymous-delete/_config.js b/test/function/samples/plugin-cache/anonymous-delete/_config.js index ce7dbf233..c75a26f99 100644 --- a/test/function/samples/plugin-cache/anonymous-delete/_config.js +++ b/test/function/samples/plugin-cache/anonymous-delete/_config.js @@ -1,11 +1,13 @@ module.exports = defineTest({ description: 'throws for anonymous plugins deleting from the cache', options: { - plugins: { - buildStart() { - this.cache.delete('asdf'); + plugins: [ + { + buildStart() { + this.cache.delete('asdf'); + } } - } + ] }, error: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/plugin-cache/anonymous-get/_config.js b/test/function/samples/plugin-cache/anonymous-get/_config.js index 8dbacf0d3..462bb41ae 100644 --- a/test/function/samples/plugin-cache/anonymous-get/_config.js +++ b/test/function/samples/plugin-cache/anonymous-get/_config.js @@ -1,11 +1,13 @@ module.exports = defineTest({ description: 'throws for anonymous plugins reading the cache', options: { - plugins: { - buildStart() { - this.cache.get('asdf'); + plugins: [ + { + buildStart() { + this.cache.get('asdf'); + } } - } + ] }, error: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/plugin-cache/anonymous-has/_config.js b/test/function/samples/plugin-cache/anonymous-has/_config.js index ef142eda8..1822b951a 100644 --- a/test/function/samples/plugin-cache/anonymous-has/_config.js +++ b/test/function/samples/plugin-cache/anonymous-has/_config.js @@ -1,11 +1,13 @@ module.exports = defineTest({ description: 'throws for anonymous plugins checking the cache', options: { - plugins: { - buildStart() { - this.cache.has('asdf'); + plugins: [ + { + buildStart() { + this.cache.has('asdf'); + } } - } + ] }, error: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/plugin-cache/anonymous-set/_config.js b/test/function/samples/plugin-cache/anonymous-set/_config.js index 5349a5234..8aee27bf0 100644 --- a/test/function/samples/plugin-cache/anonymous-set/_config.js +++ b/test/function/samples/plugin-cache/anonymous-set/_config.js @@ -1,11 +1,13 @@ module.exports = defineTest({ description: 'throws for anonymous plugins adding to the cache', options: { - plugins: { - buildStart() { - this.cache.set('asdf', 'asdf'); + plugins: [ + { + buildStart() { + this.cache.set('asdf', 'asdf'); + } } - } + ] }, error: { code: 'PLUGIN_ERROR', diff --git a/test/function/samples/plugin-module-information-no-cache/_config.js b/test/function/samples/plugin-module-information-no-cache/_config.js index 3ea09c6a8..33d04f0da 100644 --- a/test/function/samples/plugin-module-information-no-cache/_config.js +++ b/test/function/samples/plugin-module-information-no-cache/_config.js @@ -32,7 +32,7 @@ module.exports = defineTest({ sourceType: 'module' }; assert.deepStrictEqual(JSON.parse(JSON.stringify(info)), { - assertions: {}, + attributes: {}, ast, code: 'export default 42;\n', dynamicallyImportedIdResolutions: [], diff --git a/test/function/samples/plugin-module-information/_config.js b/test/function/samples/plugin-module-information/_config.js index 9890061d0..4624d7348 100644 --- a/test/function/samples/plugin-module-information/_config.js +++ b/test/function/samples/plugin-module-information/_config.js @@ -13,437 +13,444 @@ module.exports = defineTest({ description: 'provides module information on the plugin context', options: { external: ['path'], - plugins: { - load(id) { - assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(id))), { - assertions: {}, - ast: null, - code: null, - dynamicImporters: [], - exportedBindings: { - '.': [] - }, - exports: [], - hasDefaultExport: null, - dynamicallyImportedIdResolutions: [], - dynamicallyImportedIds: [], - moduleSideEffects: true, - id, - implicitlyLoadedAfterOneOf: [], - implicitlyLoadedBefore: [], - importedIdResolutions: [], - importedIds: [], - importers: [], - isEntry: id === ID_MAIN, - isExternal: false, - isIncluded: null, - meta: {}, - syntheticNamedExports: false - }); - }, - renderStart() { - rendered = true; - assert.deepStrictEqual( - getObject( - [...this.getModuleIds()].map(id => [ - id, - JSON.parse(JSON.stringify(this.getModuleInfo(id))) - ]) - ), - { - [ID_FOO]: { - id: ID_FOO, - assertions: {}, - ast: { - type: 'Program', - start: 0, - end: 66, - body: [ - { - type: 'ImportDeclaration', - start: 0, - end: 24, - specifiers: [ - { - type: 'ImportDefaultSpecifier', - start: 7, - end: 11, - local: { type: 'Identifier', start: 7, end: 11, name: 'path' } - } - ], - source: { type: 'Literal', start: 17, end: 23, value: 'path', raw: "'path'" } - }, - { - type: 'ExportNamedDeclaration', - start: 26, - end: 65, - declaration: { - type: 'VariableDeclaration', - start: 33, - end: 65, - declarations: [ + plugins: [ + { + load(id) { + assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(id))), { + attributes: {}, + ast: null, + code: null, + dynamicImporters: [], + exportedBindings: { + '.': [] + }, + exports: [], + hasDefaultExport: null, + dynamicallyImportedIdResolutions: [], + dynamicallyImportedIds: [], + moduleSideEffects: true, + id, + implicitlyLoadedAfterOneOf: [], + implicitlyLoadedBefore: [], + importedIdResolutions: [], + importedIds: [], + importers: [], + isEntry: id === ID_MAIN, + isExternal: false, + isIncluded: null, + meta: {}, + syntheticNamedExports: false + }); + }, + renderStart() { + rendered = true; + assert.deepStrictEqual( + getObject( + [...this.getModuleIds()].map(id => [ + id, + JSON.parse(JSON.stringify(this.getModuleInfo(id))) + ]) + ), + { + [ID_FOO]: { + id: ID_FOO, + attributes: {}, + ast: { + type: 'Program', + start: 0, + end: 66, + body: [ + { + type: 'ImportDeclaration', + start: 0, + end: 24, + specifiers: [ { - type: 'VariableDeclarator', - start: 39, - end: 64, - id: { type: 'Identifier', start: 39, end: 42, name: 'foo' }, - init: { - type: 'CallExpression', - start: 45, + type: 'ImportDefaultSpecifier', + start: 7, + end: 11, + local: { type: 'Identifier', start: 7, end: 11, name: 'path' } + } + ], + source: { type: 'Literal', start: 17, end: 23, value: 'path', raw: "'path'" } + }, + { + type: 'ExportNamedDeclaration', + start: 26, + end: 65, + declaration: { + type: 'VariableDeclaration', + start: 33, + end: 65, + declarations: [ + { + type: 'VariableDeclarator', + start: 39, end: 64, - callee: { - type: 'MemberExpression', + id: { type: 'Identifier', start: 39, end: 42, name: 'foo' }, + init: { + type: 'CallExpression', start: 45, - end: 57, - object: { type: 'Identifier', start: 45, end: 49, name: 'path' }, - property: { type: 'Identifier', start: 50, end: 57, name: 'resolve' }, - computed: false, + end: 64, + callee: { + type: 'MemberExpression', + start: 45, + end: 57, + object: { type: 'Identifier', start: 45, end: 49, name: 'path' }, + property: { + type: 'Identifier', + start: 50, + end: 57, + name: 'resolve' + }, + computed: false, + optional: false + }, + arguments: [ + { type: 'Literal', start: 58, end: 63, value: 'foo', raw: "'foo'" } + ], optional: false - }, - arguments: [ - { type: 'Literal', start: 58, end: 63, value: 'foo', raw: "'foo'" } - ], - optional: false + } } - } - ], - kind: 'const' - }, - specifiers: [], - source: null + ], + kind: 'const' + }, + specifiers: [], + source: null + } + ], + sourceType: 'module' + }, + code: "import path from 'path';\n\nexport const foo = path.resolve('foo');\n", + dynamicallyImportedIdResolutions: [], + exportedBindings: { '.': ['foo'] }, + exports: ['foo'], + dynamicallyImportedIds: [], + dynamicImporters: [], + hasDefaultExport: false, + moduleSideEffects: true, + implicitlyLoadedAfterOneOf: [], + implicitlyLoadedBefore: [], + importedIdResolutions: [ + { + attributes: {}, + external: true, + id: ID_PATH, + meta: {}, + moduleSideEffects: true, + resolvedBy: 'rollup', + syntheticNamedExports: false } ], - sourceType: 'module' + importedIds: [ID_PATH], + importers: [ID_MAIN, ID_NESTED], + isEntry: false, + isExternal: false, + isIncluded: true, + meta: {}, + syntheticNamedExports: false }, - code: "import path from 'path';\n\nexport const foo = path.resolve('foo');\n", - dynamicallyImportedIdResolutions: [], - exportedBindings: { '.': ['foo'] }, - exports: ['foo'], - dynamicallyImportedIds: [], - dynamicImporters: [], - hasDefaultExport: false, - moduleSideEffects: true, - implicitlyLoadedAfterOneOf: [], - implicitlyLoadedBefore: [], - importedIdResolutions: [ - { - assertions: {}, - external: true, - id: ID_PATH, - meta: {}, - moduleSideEffects: true, - resolvedBy: 'rollup', - syntheticNamedExports: false - } - ], - importedIds: [ID_PATH], - importers: [ID_MAIN, ID_NESTED], - isEntry: false, - isExternal: false, - isIncluded: true, - meta: {}, - syntheticNamedExports: false - }, - [ID_MAIN]: { - id: ID_MAIN, - assertions: {}, - ast: { - type: 'Program', - start: 0, - end: 159, - body: [ - { - type: 'ExportNamedDeclaration', - start: 0, - end: 31, - declaration: null, - specifiers: [ - { - type: 'ExportSpecifier', - start: 9, - end: 12, - local: { type: 'Identifier', start: 9, end: 12, name: 'foo' }, - exported: { type: 'Identifier', start: 9, end: 12, name: 'foo' } + [ID_MAIN]: { + id: ID_MAIN, + attributes: {}, + ast: { + type: 'Program', + start: 0, + end: 159, + body: [ + { + type: 'ExportNamedDeclaration', + start: 0, + end: 31, + declaration: null, + specifiers: [ + { + type: 'ExportSpecifier', + start: 9, + end: 12, + local: { type: 'Identifier', start: 9, end: 12, name: 'foo' }, + exported: { type: 'Identifier', start: 9, end: 12, name: 'foo' } + } + ], + source: { + type: 'Literal', + start: 20, + end: 30, + value: './foo.js', + raw: "'./foo.js'" } - ], - source: { - type: 'Literal', - start: 20, - end: 30, - value: './foo.js', - raw: "'./foo.js'" - } - }, - { - type: 'ExportNamedDeclaration', - start: 32, - end: 80, - declaration: { - type: 'VariableDeclaration', - start: 39, + }, + { + type: 'ExportNamedDeclaration', + start: 32, end: 80, - declarations: [ - { - type: 'VariableDeclarator', - start: 45, - end: 79, - id: { type: 'Identifier', start: 45, end: 51, name: 'nested' }, - init: { - type: 'ImportExpression', - start: 54, + declaration: { + type: 'VariableDeclaration', + start: 39, + end: 80, + declarations: [ + { + type: 'VariableDeclarator', + start: 45, end: 79, - source: { - type: 'Literal', - start: 61, - end: 78, - value: './nested/nested', - raw: "'./nested/nested'" + id: { type: 'Identifier', start: 45, end: 51, name: 'nested' }, + init: { + type: 'ImportExpression', + start: 54, + end: 79, + source: { + type: 'Literal', + start: 61, + end: 78, + value: './nested/nested', + raw: "'./nested/nested'" + } } } - } - ], - kind: 'const' + ], + kind: 'const' + }, + specifiers: [], + source: null }, - specifiers: [], - source: null - }, - { - type: 'ExportNamedDeclaration', - start: 81, - end: 116, - declaration: { - type: 'VariableDeclaration', - start: 88, + { + type: 'ExportNamedDeclaration', + start: 81, end: 116, - declarations: [ - { - type: 'VariableDeclarator', - start: 94, - end: 115, - id: { type: 'Identifier', start: 94, end: 98, name: 'path' }, - init: { - type: 'ImportExpression', - start: 101, + declaration: { + type: 'VariableDeclaration', + start: 88, + end: 116, + declarations: [ + { + type: 'VariableDeclarator', + start: 94, end: 115, - source: { - type: 'Literal', - start: 108, - end: 114, - value: 'path', - raw: "'path'" + id: { type: 'Identifier', start: 94, end: 98, name: 'path' }, + init: { + type: 'ImportExpression', + start: 101, + end: 115, + source: { + type: 'Literal', + start: 108, + end: 114, + value: 'path', + raw: "'path'" + } } } - } - ], - kind: 'const' + ], + kind: 'const' + }, + specifiers: [], + source: null }, - specifiers: [], - source: null - }, - { - type: 'ExportNamedDeclaration', - start: 117, - end: 158, - declaration: { - type: 'VariableDeclaration', - start: 124, + { + type: 'ExportNamedDeclaration', + start: 117, end: 158, - declarations: [ - { - type: 'VariableDeclarator', - start: 130, - end: 157, - id: { type: 'Identifier', start: 130, end: 139, name: 'pathAgain' }, - init: { - type: 'ImportExpression', - start: 142, + declaration: { + type: 'VariableDeclaration', + start: 124, + end: 158, + declarations: [ + { + type: 'VariableDeclarator', + start: 130, end: 157, - source: { type: 'Identifier', start: 149, end: 156, name: 'thePath' } + id: { type: 'Identifier', start: 130, end: 139, name: 'pathAgain' }, + init: { + type: 'ImportExpression', + start: 142, + end: 157, + source: { type: 'Identifier', start: 149, end: 156, name: 'thePath' } + } } - } - ], - kind: 'const' - }, - specifiers: [], - source: null + ], + kind: 'const' + }, + specifiers: [], + source: null + } + ], + sourceType: 'module' + }, + code: "export { foo } from './foo.js';\nexport const nested = import('./nested/nested');\nexport const path = import('path');\nexport const pathAgain = import(thePath);\n", + dynamicallyImportedIdResolutions: [ + { + attributes: {}, + external: false, + id: ID_NESTED, + meta: {}, + moduleSideEffects: true, + resolvedBy: 'rollup', + syntheticNamedExports: false + }, + { + attributes: {}, + external: true, + id: ID_PATH, + meta: {}, + moduleSideEffects: true, + resolvedBy: 'rollup', + syntheticNamedExports: false } ], - sourceType: 'module' - }, - code: "export { foo } from './foo.js';\nexport const nested = import('./nested/nested');\nexport const path = import('path');\nexport const pathAgain = import(thePath);\n", - dynamicallyImportedIdResolutions: [ - { - assertions: {}, - external: false, - id: ID_NESTED, - meta: {}, - moduleSideEffects: true, - resolvedBy: 'rollup', - syntheticNamedExports: false + dynamicallyImportedIds: [ID_NESTED, ID_PATH], + dynamicImporters: [], + exportedBindings: { + '.': ['nested', 'path', 'pathAgain'], + './foo.js': ['foo'] }, - { - assertions: {}, - external: true, - id: ID_PATH, - meta: {}, - moduleSideEffects: true, - resolvedBy: 'rollup', - syntheticNamedExports: false - } - ], - dynamicallyImportedIds: [ID_NESTED, ID_PATH], - dynamicImporters: [], - exportedBindings: { - '.': ['nested', 'path', 'pathAgain'], - './foo.js': ['foo'] - }, - exports: ['nested', 'path', 'pathAgain', 'foo'], - hasDefaultExport: false, - moduleSideEffects: true, - implicitlyLoadedAfterOneOf: [], - implicitlyLoadedBefore: [], - importedIdResolutions: [ - { - assertions: {}, - external: false, - id: ID_FOO, - meta: {}, - moduleSideEffects: true, - resolvedBy: 'rollup', - syntheticNamedExports: false - } - ], - importedIds: [ID_FOO], - importers: [], - isEntry: true, - isExternal: false, - isIncluded: true, - meta: {}, - syntheticNamedExports: false - }, - [ID_NESTED]: { - id: ID_NESTED, - assertions: {}, - ast: { - type: 'Program', - start: 0, - end: 72, - body: [ + exports: ['nested', 'path', 'pathAgain', 'foo'], + hasDefaultExport: false, + moduleSideEffects: true, + implicitlyLoadedAfterOneOf: [], + implicitlyLoadedBefore: [], + importedIdResolutions: [ { - type: 'ImportDeclaration', - start: 0, - end: 32, - specifiers: [ - { - type: 'ImportSpecifier', - start: 9, - end: 12, - imported: { type: 'Identifier', start: 9, end: 12, name: 'foo' }, - local: { type: 'Identifier', start: 9, end: 12, name: 'foo' } + attributes: {}, + external: false, + id: ID_FOO, + meta: {}, + moduleSideEffects: true, + resolvedBy: 'rollup', + syntheticNamedExports: false + } + ], + importedIds: [ID_FOO], + importers: [], + isEntry: true, + isExternal: false, + isIncluded: true, + meta: {}, + syntheticNamedExports: false + }, + [ID_NESTED]: { + id: ID_NESTED, + attributes: {}, + ast: { + type: 'Program', + start: 0, + end: 72, + body: [ + { + type: 'ImportDeclaration', + start: 0, + end: 32, + specifiers: [ + { + type: 'ImportSpecifier', + start: 9, + end: 12, + imported: { type: 'Identifier', start: 9, end: 12, name: 'foo' }, + local: { type: 'Identifier', start: 9, end: 12, name: 'foo' } + } + ], + source: { + type: 'Literal', + start: 20, + end: 31, + value: '../foo.js', + raw: "'../foo.js'" } - ], - source: { - type: 'Literal', - start: 20, - end: 31, - value: '../foo.js', - raw: "'../foo.js'" - } - }, - { - type: 'ExportNamedDeclaration', - start: 34, - end: 71, - declaration: { - type: 'VariableDeclaration', - start: 41, + }, + { + type: 'ExportNamedDeclaration', + start: 34, end: 71, - declarations: [ - { - type: 'VariableDeclarator', - start: 47, - end: 70, - id: { type: 'Identifier', start: 47, end: 53, name: 'nested' }, - init: { - type: 'BinaryExpression', - start: 56, + declaration: { + type: 'VariableDeclaration', + start: 41, + end: 71, + declarations: [ + { + type: 'VariableDeclarator', + start: 47, end: 70, - left: { - type: 'Literal', + id: { type: 'Identifier', start: 47, end: 53, name: 'nested' }, + init: { + type: 'BinaryExpression', start: 56, - end: 64, - value: 'nested', - raw: "'nested'" - }, - operator: '+', - right: { type: 'Identifier', start: 67, end: 70, name: 'foo' } + end: 70, + left: { + type: 'Literal', + start: 56, + end: 64, + value: 'nested', + raw: "'nested'" + }, + operator: '+', + right: { type: 'Identifier', start: 67, end: 70, name: 'foo' } + } } - } - ], - kind: 'const' - }, - specifiers: [], - source: null + ], + kind: 'const' + }, + specifiers: [], + source: null + } + ], + sourceType: 'module' + }, + code: "import { foo } from '../foo.js';\n\nexport const nested = 'nested' + foo;\n", + dynamicallyImportedIdResolutions: [], + dynamicallyImportedIds: [], + dynamicImporters: [ID_MAIN], + exports: ['nested'], + exportedBindings: { '.': ['nested'] }, + hasDefaultExport: false, + moduleSideEffects: true, + implicitlyLoadedAfterOneOf: [], + implicitlyLoadedBefore: [], + importedIdResolutions: [ + { + attributes: {}, + external: false, + id: ID_FOO, + meta: {}, + moduleSideEffects: true, + resolvedBy: 'rollup', + syntheticNamedExports: false } ], - sourceType: 'module' + importedIds: [ID_FOO], + importers: [], + isEntry: false, + isExternal: false, + isIncluded: true, + meta: {}, + syntheticNamedExports: false }, - code: "import { foo } from '../foo.js';\n\nexport const nested = 'nested' + foo;\n", - dynamicallyImportedIdResolutions: [], - dynamicallyImportedIds: [], - dynamicImporters: [ID_MAIN], - exports: ['nested'], - exportedBindings: { '.': ['nested'] }, - hasDefaultExport: false, - moduleSideEffects: true, - implicitlyLoadedAfterOneOf: [], - implicitlyLoadedBefore: [], - importedIdResolutions: [ - { - assertions: {}, - external: false, - id: ID_FOO, - meta: {}, - moduleSideEffects: true, - resolvedBy: 'rollup', - syntheticNamedExports: false - } - ], - importedIds: [ID_FOO], - importers: [], - isEntry: false, - isExternal: false, - isIncluded: true, - meta: {}, - syntheticNamedExports: false - }, - [ID_PATH]: { - id: ID_PATH, - assertions: {}, - ast: null, - code: null, - dynamicallyImportedIdResolutions: [], - dynamicallyImportedIds: [], - dynamicImporters: [ID_MAIN], - exportedBindings: null, - exports: null, - hasDefaultExport: null, - moduleSideEffects: true, - implicitlyLoadedAfterOneOf: [], - implicitlyLoadedBefore: [], - importedIdResolutions: [], - importedIds: [], - importers: [ID_FOO], - isEntry: false, - isExternal: true, - isIncluded: null, - meta: {}, - syntheticNamedExports: false + [ID_PATH]: { + id: ID_PATH, + attributes: {}, + ast: null, + code: null, + dynamicallyImportedIdResolutions: [], + dynamicallyImportedIds: [], + dynamicImporters: [ID_MAIN], + exportedBindings: null, + exports: null, + hasDefaultExport: null, + moduleSideEffects: true, + implicitlyLoadedAfterOneOf: [], + implicitlyLoadedBefore: [], + importedIdResolutions: [], + importedIds: [], + importers: [ID_FOO], + isEntry: false, + isExternal: true, + isIncluded: null, + meta: {}, + syntheticNamedExports: false + } } - } - ); + ); + } } - } + ] }, context: { thePath: 'path' diff --git a/test/function/samples/plugin-parse-ast-receives-comments/_config.js b/test/function/samples/plugin-parse-ast-receives-comments/_config.js deleted file mode 100644 index 2b25e4518..000000000 --- a/test/function/samples/plugin-parse-ast-receives-comments/_config.js +++ /dev/null @@ -1,24 +0,0 @@ -const assert = require('node:assert'); - -const comments = []; - -module.exports = defineTest({ - description: 'plugin parse ast receives comments', - options: { - plugins: [ - { - transform(code) { - const ast = this.parse(code, { - onComment(...parameters) { - comments.push(parameters); - } - }); - return { ast, code, map: null }; - } - } - ] - }, - after() { - assert.ok(comments.length > 0); - } -}); diff --git a/test/function/samples/plugin-parse-ast-receives-comments/main.js b/test/function/samples/plugin-parse-ast-receives-comments/main.js deleted file mode 100644 index fbc4f47c0..000000000 --- a/test/function/samples/plugin-parse-ast-receives-comments/main.js +++ /dev/null @@ -1,4 +0,0 @@ -/* this is a comment */ -export function main() { - // this is also a comment -} \ No newline at end of file diff --git a/test/function/samples/preload-module/_config.js b/test/function/samples/preload-module/_config.js index 9cc42cc09..80c169f58 100644 --- a/test/function/samples/preload-module/_config.js +++ b/test/function/samples/preload-module/_config.js @@ -32,7 +32,7 @@ module.exports = defineTest({ }); assert.deepStrictEqual(moduleInfo, { id: ID_MAIN, - assertions: {}, + attributes: {}, code: "import './dep';\nassert.ok(true);\n", dynamicImporters: [], exportedBindings: { @@ -75,7 +75,7 @@ module.exports = defineTest({ }); assert.deepStrictEqual(moduleInfo, { id: ID_DEP, - assertions: {}, + attributes: {}, code: 'assert.ok(true);\n', dynamicImporters: [], exportedBindings: { diff --git a/test/function/samples/preserve-symlink/_config.js b/test/function/samples/preserve-symlink/_config.js index cdc08ad12..60c64eb5a 100644 --- a/test/function/samples/preserve-symlink/_config.js +++ b/test/function/samples/preserve-symlink/_config.js @@ -1,5 +1,5 @@ module.exports = defineTest({ - skip: process.platform === 'win32', + skipIfWindows: true, description: 'follows symlinks', options: { preserveSymlinks: true diff --git a/test/function/samples/reassign-import-fails/_config.js b/test/function/samples/reassign-import-fails/_config.js index 71ca9a3ee..48cd70097 100644 --- a/test/function/samples/reassign-import-fails/_config.js +++ b/test/function/samples/reassign-import-fails/_config.js @@ -1,11 +1,14 @@ const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); -const ID_FOO = path.join(__dirname, 'foo.js'); module.exports = defineTest({ description: 'disallows assignments to imported bindings', error: { - code: 'ILLEGAL_REASSIGNMENT', + code: 'PARSE_ERROR', + cause: { + message: 'cannot reassign to an imported binding', + pos: 113 + }, id: ID_MAIN, pos: 113, loc: { @@ -18,8 +21,8 @@ module.exports = defineTest({ 7: 8: x = 10; ^`, - watchFiles: [ID_FOO, ID_MAIN], - message: 'Illegal reassignment of import "x" in "main.js".' + watchFiles: [ID_MAIN], + message: 'cannot reassign to an imported binding' } }); diff --git a/test/function/samples/reassign-import-fails/foo.js b/test/function/samples/reassign-import-fails/foo.js deleted file mode 100644 index 35ba80666..000000000 --- a/test/function/samples/reassign-import-fails/foo.js +++ /dev/null @@ -1 +0,0 @@ -export var x = 1; diff --git a/test/function/samples/reassign-import-not-at-top-level-fails/_config.js b/test/function/samples/reassign-import-not-at-top-level-fails/_config.js index d26f7c87f..fe0020431 100644 --- a/test/function/samples/reassign-import-not-at-top-level-fails/_config.js +++ b/test/function/samples/reassign-import-not-at-top-level-fails/_config.js @@ -1,11 +1,14 @@ const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); -const ID_FOO = path.join(__dirname, 'foo.js'); module.exports = defineTest({ description: 'disallows assignments to imported bindings not at the top level', error: { - code: 'ILLEGAL_REASSIGNMENT', + code: 'PARSE_ERROR', + cause: { + message: 'cannot reassign to an imported binding', + pos: 95 + }, id: ID_MAIN, pos: 95, loc: { @@ -19,8 +22,8 @@ module.exports = defineTest({ 7: x = 1; ^ 8: }`, - watchFiles: [ID_FOO, ID_MAIN], - message: 'Illegal reassignment of import "x" in "main.js".' + watchFiles: [ID_MAIN], + message: 'cannot reassign to an imported binding' } }); diff --git a/test/function/samples/reassign-import-not-at-top-level-fails/foo.js b/test/function/samples/reassign-import-not-at-top-level-fails/foo.js deleted file mode 100644 index 35ba80666..000000000 --- a/test/function/samples/reassign-import-not-at-top-level-fails/foo.js +++ /dev/null @@ -1 +0,0 @@ -export var x = 1; diff --git a/test/function/samples/resolve-id-object/_config.js b/test/function/samples/resolve-id-object/_config.js index 0b7d12261..ebb1f5b50 100644 --- a/test/function/samples/resolve-id-object/_config.js +++ b/test/function/samples/resolve-id-object/_config.js @@ -3,22 +3,24 @@ const path = require('node:path'); module.exports = defineTest({ description: 'allows resolving an id with an object', options: { - plugins: { - resolveId(importee) { - const fooId = path.join(__dirname, 'foo.js'); - switch (importee) { - case 'internal1': { - return { id: fooId }; - } - case 'internal2': { - return { id: fooId, external: false }; - } - case 'external': { - return { id: 'my-external', external: true }; + plugins: [ + { + resolveId(importee) { + const fooId = path.join(__dirname, 'foo.js'); + switch (importee) { + case 'internal1': { + return { id: fooId }; + } + case 'internal2': { + return { id: fooId, external: false }; + } + case 'external': { + return { id: 'my-external', external: true }; + } } } } - } + ] }, context: { require(id) { diff --git a/test/function/samples/resolve-relative-external-id/_config.js b/test/function/samples/resolve-relative-external-id/_config.js index c56c40537..07a900195 100644 --- a/test/function/samples/resolve-relative-external-id/_config.js +++ b/test/function/samples/resolve-relative-external-id/_config.js @@ -5,30 +5,32 @@ module.exports = defineTest({ description: 'resolves relative external ids', options: { external: [path.join(__dirname, 'external.js'), path.join(__dirname, 'nested', 'external.js')], - plugins: { - async buildStart() { - assert.deepStrictEqual(await this.resolve('./external.js'), { - assertions: {}, - external: true, - id: path.join(__dirname, 'external.js'), - meta: {}, - moduleSideEffects: true, - resolvedBy: 'rollup', - syntheticNamedExports: false - }); - assert.deepStrictEqual( - await this.resolve('./external.js', path.join(__dirname, 'nested', 'some-file.js')), - { - assertions: {}, + plugins: [ + { + async buildStart() { + assert.deepStrictEqual(await this.resolve('./external.js'), { + attributes: {}, external: true, - id: path.join(__dirname, 'nested', 'external.js'), + id: path.join(__dirname, 'external.js'), meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false - } - ); + }); + assert.deepStrictEqual( + await this.resolve('./external.js', path.join(__dirname, 'nested', 'some-file.js')), + { + attributes: {}, + external: true, + id: path.join(__dirname, 'nested', 'external.js'), + meta: {}, + moduleSideEffects: true, + resolvedBy: 'rollup', + syntheticNamedExports: false + } + ); + } } - } + ] } }); diff --git a/test/function/samples/side-effect-free-module-function/_config.js b/test/function/samples/side-effect-free-module-function/_config.js index 827d480db..d354e3143 100644 --- a/test/function/samples/side-effect-free-module-function/_config.js +++ b/test/function/samples/side-effect-free-module-function/_config.js @@ -2,10 +2,12 @@ module.exports = defineTest({ description: 'correctly include functions with side effects from side-effect-free modules (#3942)', options: { - plugins: { - transform() { - return { moduleSideEffects: false }; + plugins: [ + { + transform() { + return { moduleSideEffects: false }; + } } - } + ] } }); diff --git a/test/function/samples/symlink/_config.js b/test/function/samples/symlink/_config.js index 39859d6f1..65f9bbbb2 100644 --- a/test/function/samples/symlink/_config.js +++ b/test/function/samples/symlink/_config.js @@ -1,4 +1,4 @@ module.exports = defineTest({ - skip: process.platform === 'win32', + skipIfWindows: true, description: 'follows symlinks' }); diff --git a/test/function/samples/synthetic-named-exports/synthetic-named-export-as-default/_config.js b/test/function/samples/synthetic-named-exports/synthetic-named-export-as-default/_config.js index 3bbcc0207..7de33d901 100644 --- a/test/function/samples/synthetic-named-exports/synthetic-named-export-as-default/_config.js +++ b/test/function/samples/synthetic-named-exports/synthetic-named-export-as-default/_config.js @@ -1,11 +1,13 @@ module.exports = defineTest({ description: 'makes sure default exports of synthetic named exports are snapshots', options: { - plugins: { - name: 'test-plugin', - transform() { - return { syntheticNamedExports: '__synthetic' }; + plugins: [ + { + name: 'test-plugin', + transform() { + return { syntheticNamedExports: '__synthetic' }; + } } - } + ] } }); diff --git a/test/function/samples/transform-empty-string/_config.js b/test/function/samples/transform-empty-string/_config.js index 77af26005..0af89d975 100644 --- a/test/function/samples/transform-empty-string/_config.js +++ b/test/function/samples/transform-empty-string/_config.js @@ -9,13 +9,15 @@ module.exports = defineTest({ assert.deepStrictEqual(sideEffects, ['this happens']); }, options: { - plugins: { - name: 'test-plugin', - transform(code, id) { - if (id.endsWith('transformed.js')) { - return ''; + plugins: [ + { + name: 'test-plugin', + transform(code, id) { + if (id.endsWith('transformed.js')) { + return ''; + } } } - } + ] } }); diff --git a/test/function/samples/transform-without-code-warn-ast/_config.js b/test/function/samples/transform-without-code-warn-ast/_config.js index 891825a0e..405b92e74 100644 --- a/test/function/samples/transform-without-code-warn-ast/_config.js +++ b/test/function/samples/transform-without-code-warn-ast/_config.js @@ -1,12 +1,14 @@ module.exports = defineTest({ description: 'warns when returning a map but no code from a transform hook', options: { - plugins: { - name: 'test-plugin', - transform() { - return { ast: {} }; + plugins: [ + { + name: 'test-plugin', + transform() { + return { ast: {} }; + } } - } + ] }, warnings: [ { diff --git a/test/function/samples/transform-without-code-warn-map/_config.js b/test/function/samples/transform-without-code-warn-map/_config.js index 26221ba80..4b91262e6 100644 --- a/test/function/samples/transform-without-code-warn-map/_config.js +++ b/test/function/samples/transform-without-code-warn-map/_config.js @@ -1,12 +1,14 @@ module.exports = defineTest({ description: 'warns when returning a map but no code from a transform hook', options: { - plugins: { - name: 'test-plugin', - transform() { - return { map: { mappings: '' } }; + plugins: [ + { + name: 'test-plugin', + transform() { + return { map: { mappings: '' } }; + } } - } + ] }, warnings: [ { diff --git a/test/function/samples/transform-without-code/_config.js b/test/function/samples/transform-without-code/_config.js index 7f145702a..71e49ed2f 100644 --- a/test/function/samples/transform-without-code/_config.js +++ b/test/function/samples/transform-without-code/_config.js @@ -7,33 +7,35 @@ module.exports = defineTest({ description: 'allows using the transform hook for annotations only without returning a code property and breaking sourcemaps', options: { - plugins: { - name: 'test-plugin', - transform() { - return { meta: { test: true } }; - }, - async generateBundle(options, bundle) { - const { code, map } = bundle['main.js']; - const line = 3; - const column = 11; - assert.strictEqual(code.split('\n')[line - 1].slice(column, column + 2), '42'); + plugins: [ + { + name: 'test-plugin', + transform() { + return { meta: { test: true } }; + }, + async generateBundle(options, bundle) { + const { code, map } = bundle['main.js']; + const line = 3; + const column = 11; + assert.strictEqual(code.split('\n')[line - 1].slice(column, column + 2), '42'); - const smc = await new SourceMapConsumer(map); - const originalLoc = smc.originalPositionFor({ line, column }); - assert.notStrictEqual(originalLoc.line, null); - const originalCode = readFileSync(path.join(__dirname, 'main.js'), 'utf8'); - assert.strictEqual( - originalCode - .split('\n') - [originalLoc.line - 1].slice(originalLoc.column, originalLoc.column + 2), - '42' - ); + const smc = await new SourceMapConsumer(map); + const originalLoc = smc.originalPositionFor({ line, column }); + assert.notStrictEqual(originalLoc.line, null); + const originalCode = readFileSync(path.join(__dirname, 'main.js'), 'utf8'); + assert.strictEqual( + originalCode + .split('\n') + [originalLoc.line - 1].slice(originalLoc.column, originalLoc.column + 2), + '42' + ); - for (const id of this.getModuleIds()) { - assert.strictEqual(this.getModuleInfo(id).meta.test, true); + for (const id of this.getModuleIds()) { + assert.strictEqual(this.getModuleInfo(id).meta.test, true); + } } } - }, + ], output: { sourcemap: true } diff --git a/test/function/samples/update-expression-of-import-fails/_config.js b/test/function/samples/update-expression-of-import-fails/_config.js index c4a525ab4..a961315b1 100644 --- a/test/function/samples/update-expression-of-import-fails/_config.js +++ b/test/function/samples/update-expression-of-import-fails/_config.js @@ -1,11 +1,14 @@ const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); -const ID_FOO = path.join(__dirname, 'foo.js'); module.exports = defineTest({ description: 'disallows updates to imported bindings', error: { - code: 'ILLEGAL_REASSIGNMENT', + code: 'PARSE_ERROR', + cause: { + message: 'cannot reassign to an imported binding', + pos: 28 + }, id: ID_MAIN, pos: 28, loc: { @@ -18,8 +21,8 @@ module.exports = defineTest({ 2: 3: a++; ^`, - watchFiles: [ID_FOO, ID_MAIN], - message: 'Illegal reassignment of import "a" in "main.js".' + watchFiles: [ID_MAIN], + message: 'cannot reassign to an imported binding' } }); diff --git a/test/function/samples/update-expression-of-import-fails/foo.js b/test/function/samples/update-expression-of-import-fails/foo.js deleted file mode 100644 index 7fad5c5de..000000000 --- a/test/function/samples/update-expression-of-import-fails/foo.js +++ /dev/null @@ -1 +0,0 @@ -export var a = 0; diff --git a/test/function/samples/uses-supplied-ast/_config.js b/test/function/samples/uses-supplied-ast/_config.js index 367086d73..6ac87f34c 100644 --- a/test/function/samples/uses-supplied-ast/_config.js +++ b/test/function/samples/uses-supplied-ast/_config.js @@ -22,6 +22,7 @@ modules.foo.ast._ignoredProp = {}; module.exports = defineTest({ description: 'uses supplied AST', + verifyAst: false, options: { plugins: [ { diff --git a/test/function/samples/validate-output/_config.js b/test/function/samples/validate-output/_config.js index 42b7cc5bf..4cb4989a4 100644 --- a/test/function/samples/validate-output/_config.js +++ b/test/function/samples/validate-output/_config.js @@ -11,7 +11,7 @@ module.exports = defineTest({ }, generateError: { code: 'CHUNK_INVALID', - message: 'Chunk "main.js" is not valid JavaScript: Unterminated comment (5:0).', + message: 'Chunk "main.js" is not valid JavaScript: Unterminated block comment.', frame: ` 3: throw new Error('Not executed'); 4: @@ -21,6 +21,7 @@ module.exports = defineTest({ column: 0, file: 'main.js', line: 5 - } + }, + pos: 49 } }); diff --git a/test/function/samples/warning-low-resolution-location/_config.js b/test/function/samples/warning-low-resolution-location/_config.js index 3c6fc0f4c..885a9df7b 100644 --- a/test/function/samples/warning-low-resolution-location/_config.js +++ b/test/function/samples/warning-low-resolution-location/_config.js @@ -5,16 +5,21 @@ const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'handles when a low resolution sourcemap is used to report an error', options: { - plugins: { - name: 'test-plugin', - transform() { - // each entry of each line consist of - // [generatedColumn, sourceIndex, sourceLine, sourceColumn]; - // this mapping only maps the first line to itself - const decodedMap = [[[0], [0, 0, 0, 0], [1]]]; - return { code: 'export default this', map: { mappings: encode(decodedMap), sources: [] } }; + plugins: [ + { + name: 'test-plugin', + transform() { + // each entry of each line consist of + // [generatedColumn, sourceIndex, sourceLine, sourceColumn]; + // this mapping only maps the first line to itself + const decodedMap = [[[0], [0, 0, 0, 0], [1]]]; + return { + code: 'export default this', + map: { mappings: encode(decodedMap), sources: [] } + }; + } } - } + ] }, warnings: [ { diff --git a/test/function/samples/warnings-to-string/_config.js b/test/function/samples/warnings-to-string/_config.js index afc8c0dd9..678c9739f 100644 --- a/test/function/samples/warnings-to-string/_config.js +++ b/test/function/samples/warnings-to-string/_config.js @@ -3,12 +3,14 @@ const assert = require('node:assert'); module.exports = defineTest({ description: 'provides a string conversion for warnings', options: { - plugins: { - name: 'test-plugin', - transform(code) { - this.warn('This might be removed', code.indexOf('removed')); + plugins: [ + { + name: 'test-plugin', + transform(code) { + this.warn('This might be removed', code.indexOf('removed')); + } } - } + ] }, warnings(warnings) { assert.deepStrictEqual(warnings.map(String), [ diff --git a/test/incremental/index.js b/test/incremental/index.js index 304b73e48..fc949c30f 100644 --- a/test/incremental/index.js +++ b/test/incremental/index.js @@ -1,5 +1,4 @@ const assert = require('node:assert'); -const acorn = require('acorn'); /** * @type {import('../../src/rollup/types')} Rollup */ @@ -188,28 +187,6 @@ describe('incremental', () => { }); }); - it('keeps ASTs between runs', () => - rollup - .rollup({ - input: 'entry', - plugins: [plugin] - }) - .then(bundle => { - const asts = {}; - for (const module of bundle.cache.modules) { - asts[module.id] = module.ast; - } - - assert.deepEqual( - asts.entry, - acorn.parse(modules.entry, { sourceType: 'module', ecmaVersion: 2020 }) - ); - assert.deepEqual( - asts.foo, - acorn.parse(modules.foo, { sourceType: 'module', ecmaVersion: 2020 }) - ); - })); - it('recovers from errors', () => { modules.entry = `import foo from 'foo'; import bar from 'bar'; export default foo + bar;`; @@ -264,7 +241,7 @@ describe('incremental', () => { assert.deepEqual(bundle.cache.modules[1].resolvedIds, { foo: { id: 'foo', - assertions: {}, + attributes: {}, external: false, meta: {}, moduleSideEffects: true, @@ -273,7 +250,7 @@ describe('incremental', () => { }, external: { id: 'external', - assertions: {}, + attributes: {}, external: true, meta: {}, moduleSideEffects: true, @@ -361,7 +338,7 @@ describe('incremental', () => { assert.deepStrictEqual(resolvedSources, { __proto__: null, bar: { - assertions: {}, + attributes: {}, external: false, id: 'bar', meta: {}, @@ -383,7 +360,7 @@ describe('incremental', () => { assert.deepStrictEqual(resolvedSources, { __proto__: null, foo: { - assertions: {}, + attributes: {}, external: false, id: 'foo', meta: {}, diff --git a/test/misc/acorn-plugins.js b/test/misc/acorn-plugins.js deleted file mode 100644 index 618c6b3c3..000000000 --- a/test/misc/acorn-plugins.js +++ /dev/null @@ -1,45 +0,0 @@ -const assert = require('node:assert'); -const rollup = require('../../dist/rollup'); -const { executeBundle, loader } = require('../utils.js'); - -describe('acorn plugins', () => { - it('injects plugins passed in acornInjectPlugins', async () => { - let pluginAInjected = false; - let pluginBInjected = false; - - const bundle = await rollup.rollup({ - input: 'x.js', - plugins: [loader({ 'x.js': `export const foo = 42` })], - acornInjectPlugins: [ - function pluginA(Parser) { - assert.equal(typeof Parser.parse, 'function'); - return class extends Parser { - readToken(code) { - pluginAInjected = true; - super.readToken(code); - } - }; - }, - function pluginB(Parser) { - assert.equal(typeof Parser.parse, 'function'); - return class extends Parser { - readToken(code) { - pluginBInjected = true; - super.readToken(code); - } - }; - } - ] - }); - const result = await executeBundle(bundle); - assert.equal(result.foo, 42); - assert( - pluginAInjected, - 'A plugin passed via acornInjectPlugins should inject itself into Acorn.' - ); - assert( - pluginBInjected, - 'A plugin passed via acornInjectPlugins should inject itself into Acorn.' - ); - }); -}); diff --git a/test/misc/index.js b/test/misc/index.js index 39d3f8846..2782f23e2 100644 --- a/test/misc/index.js +++ b/test/misc/index.js @@ -1,4 +1,3 @@ -require('./acorn-plugins'); require('./bundle-information'); require('./get-log-filter'); require('./iife'); diff --git a/test/misc/misc.js b/test/misc/misc.js index 76e4d68af..560af20f2 100644 --- a/test/misc/misc.js +++ b/test/misc/misc.js @@ -16,8 +16,6 @@ describe('misc', () => { load: freeze(() => `export default 0;`) } ]), - acornInjectPlugins: freeze([]), - acorn: freeze({}), treeshake: freeze({}) }) ); @@ -249,32 +247,6 @@ console.log(x); assert.ok(subsubfeature.code.startsWith("import { fn } from '../../../main'")); }); - it('throws the proper error on max call stack exception', async () => { - const count = 10_000; - let source = ''; - for (let index = 0; index < count; index++) { - source += `if (foo) {`; - } - for (let index = 0; index < count; index++) { - source += '}'; - } - try { - await rollup.rollup({ - input: { - input: 'input' - }, - plugins: [ - loader({ - input: source - }) - ] - }); - } catch (error) { - assert.notDeepStrictEqual(error.message, 'Maximum call stack size exceeded'); - assert.strictEqual(error.name, 'RollupError'); - } - }); - it('supports rendering es after rendering iife with inlined dynamic imports', async () => { const bundle = await rollup.rollup({ input: 'main.js', diff --git a/test/misc/optionList.js b/test/misc/optionList.js index e34a54586..b869f7e7b 100644 --- a/test/misc/optionList.js +++ b/test/misc/optionList.js @@ -1,6 +1,6 @@ exports.input = - 'acorn, acornInjectPlugins, cache, context, experimentalCacheExpiry, experimentalLogSideEffects, external, inlineDynamicImports, input, logLevel, makeAbsoluteExternalsRelative, manualChunks, maxParallelFileOps, maxParallelFileReads, moduleContext, onLog, onwarn, perf, plugins, preserveEntrySignatures, preserveModules, preserveSymlinks, shimMissingExports, strictDeprecations, treeshake, watch'; + 'cache, context, experimentalCacheExpiry, experimentalLogSideEffects, external, inlineDynamicImports, input, logLevel, makeAbsoluteExternalsRelative, manualChunks, maxParallelFileOps, maxParallelFileReads, moduleContext, onLog, onwarn, perf, plugins, preserveEntrySignatures, preserveModules, preserveSymlinks, shimMissingExports, strictDeprecations, treeshake, watch'; exports.flags = - 'acorn, acornInjectPlugins, amd, assetFileNames, banner, bundleConfigAsCjs, c, cache, chunkFileNames, compact, config, configPlugin, context, d, dir, dynamicImportFunction, dynamicImportInCjs, e, entryFileNames, environment, esModule, experimentalCacheExpiry, experimentalDeepDynamicChunkOptimization, experimentalLogSideEffects, experimentalMinChunkSize, exports, extend, external, externalImportAssertions, externalLiveBindings, f, failAfterWarnings, file, filterLogs, footer, format, freeze, g, generatedCode, globals, h, hoistTransitiveImports, i, indent, inlineDynamicImports, input, interop, intro, logLevel, m, makeAbsoluteExternalsRelative, manualChunks, maxParallelFileOps, maxParallelFileReads, minifyInternalExports, moduleContext, n, name, namespaceToStringTag, noConflict, o, onLog, onwarn, outro, p, paths, perf, plugin, plugins, preferConst, preserveEntrySignatures, preserveModules, preserveModulesRoot, preserveSymlinks, sanitizeFileName, shimMissingExports, silent, sourcemap, sourcemapBaseUrl, sourcemapExcludeSources, sourcemapFile, sourcemapFileNames, stdin, strict, strictDeprecations, systemNullSetters, treeshake, v, validate, w, waitForBundleInput, watch'; + 'amd, assetFileNames, banner, bundleConfigAsCjs, c, cache, chunkFileNames, compact, config, configPlugin, context, d, dir, dynamicImportFunction, dynamicImportInCjs, e, entryFileNames, environment, esModule, experimentalCacheExpiry, experimentalDeepDynamicChunkOptimization, experimentalLogSideEffects, experimentalMinChunkSize, exports, extend, external, externalImportAssertions, externalImportAttributes, externalLiveBindings, f, failAfterWarnings, file, filterLogs, footer, format, freeze, g, generatedCode, globals, h, hoistTransitiveImports, i, indent, inlineDynamicImports, input, interop, intro, logLevel, m, makeAbsoluteExternalsRelative, manualChunks, maxParallelFileOps, maxParallelFileReads, minifyInternalExports, moduleContext, n, name, namespaceToStringTag, noConflict, o, onLog, onwarn, outro, p, paths, perf, plugin, plugins, preferConst, preserveEntrySignatures, preserveModules, preserveModulesRoot, preserveSymlinks, sanitizeFileName, shimMissingExports, silent, sourcemap, sourcemapBaseUrl, sourcemapExcludeSources, sourcemapFile, sourcemapFileNames, stdin, strict, strictDeprecations, systemNullSetters, treeshake, v, validate, w, waitForBundleInput, watch'; exports.output = - 'amd, assetFileNames, banner, chunkFileNames, compact, dir, dynamicImportFunction, dynamicImportInCjs, entryFileNames, esModule, experimentalDeepDynamicChunkOptimization, experimentalMinChunkSize, exports, extend, externalImportAssertions, externalLiveBindings, file, footer, format, freeze, generatedCode, globals, hoistTransitiveImports, indent, inlineDynamicImports, interop, intro, manualChunks, minifyInternalExports, name, namespaceToStringTag, noConflict, outro, paths, plugins, preferConst, preserveModules, preserveModulesRoot, sanitizeFileName, sourcemap, sourcemapBaseUrl, sourcemapExcludeSources, sourcemapFile, sourcemapFileNames, sourcemapIgnoreList, sourcemapPathTransform, strict, systemNullSetters, validate'; + 'amd, assetFileNames, banner, chunkFileNames, compact, dir, dynamicImportFunction, dynamicImportInCjs, entryFileNames, esModule, experimentalDeepDynamicChunkOptimization, experimentalMinChunkSize, exports, extend, externalImportAssertions, externalImportAttributes, externalLiveBindings, file, footer, format, freeze, generatedCode, globals, hoistTransitiveImports, indent, inlineDynamicImports, interop, intro, manualChunks, minifyInternalExports, name, namespaceToStringTag, noConflict, outro, paths, plugins, preferConst, preserveModules, preserveModulesRoot, sanitizeFileName, sourcemap, sourcemapBaseUrl, sourcemapExcludeSources, sourcemapFile, sourcemapFileNames, sourcemapIgnoreList, sourcemapPathTransform, strict, systemNullSetters, validate'; diff --git a/test/utils.js b/test/utils.js index f2fae99d1..fdd1433a4 100644 --- a/test/utils.js +++ b/test/utils.js @@ -20,6 +20,8 @@ const { } = require('node:fs'); const { basename, join } = require('node:path'); const { platform, version } = require('node:process'); +const { Parser } = require('acorn'); +const { importAssertions } = require('acorn-import-assertions'); const fixturify = require('fixturify'); if (!globalThis.defineTest) { @@ -418,3 +420,57 @@ exports.replaceDirectoryInStringifiedObject = function replaceDirectoryInStringi '**/' ); }; + +const acornParser = Parser.extend(importAssertions); + +exports.verifyAstPlugin = { + name: 'verify-ast', + moduleParsed: ({ ast, code }) => { + const acornAst = acornParser.parse(code, { ecmaVersion: 'latest', sourceType: 'module' }); + assert.deepStrictEqual( + JSON.parse(JSON.stringify(ast, replaceStringifyValues), reviveStringifyValues), + JSON.parse(JSON.stringify(acornAst, replaceStringifyValues), reviveStringifyValues) + ); + } +}; + +const replaceStringifyValues = (key, value) => { + switch (value?.type) { + case 'ImportDeclaration': + case 'ExportNamedDeclaration': + case 'ExportAllDeclaration': { + const { attributes } = value; + if (attributes) { + delete value.attributes; + if (attributes.length > 0) { + value.assertions = attributes; + } + } + break; + } + case 'ImportExpression': { + const { options } = value; + delete value.options; + if (options) { + value.arguments = [options]; + } + } + } + + return key.startsWith('_') + ? undefined + : typeof value == 'bigint' + ? `~BigInt${value.toString()}` + : value instanceof RegExp + ? `~RegExp${JSON.stringify({ flags: value.flags, source: value.source })}` + : value; +}; + +const reviveStringifyValues = (_, value) => + typeof value === 'string' + ? value.startsWith('~BigInt') + ? BigInt(value.slice(7)) + : value.startsWith('~RegExp') + ? new RegExp(JSON.parse(value.slice(7)).source, JSON.parse(value.slice(7)).flags) + : value + : value; diff --git a/test/watch/index.js b/test/watch/index.js index e7b8cf973..10f2516fb 100644 --- a/test/watch/index.js +++ b/test/watch/index.js @@ -524,7 +524,7 @@ describe('rollup.watch', () => { }, 'START', 'BUNDLE_START', - 'ERROR:Unexpected token', + "ERROR:Expected '{', got 'nope'", 'END', () => { atomicWriteFileSync('test/_tmp/input/main.js', 'export default 43;'); @@ -552,7 +552,7 @@ describe('rollup.watch', () => { return sequence(watcher, [ 'START', 'BUNDLE_START', - 'ERROR:Unexpected token', + 'ERROR:Expression expected', 'END', () => { assert.strictEqual(existsSync('../_tmp/output/bundle.js'), false); @@ -671,7 +671,7 @@ describe('rollup.watch', () => { }, 'START', 'BUNDLE_START', - 'ERROR:Unexpected token', + "ERROR:Expected '{', got 'nope'", 'END', () => { unlinkSync('test/_tmp/input/main.js'); @@ -709,7 +709,7 @@ describe('rollup.watch', () => { }, 'START', 'BUNDLE_START', - 'ERROR:Unexpected token', + "ERROR:Expected '{', got 'nope'", 'END', () => { unlinkSync('test/_tmp/input/dep.js'); diff --git a/tsconfig.json b/tsconfig.json index 4b0974ca4..0ae0e885e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,6 +12,6 @@ "strict": true, "target": "ES2022" }, - "include": ["typings/**/*.d.ts", "src", "cli", "browser", "rollup.config.ts"], + "include": ["typings/**/*.d.ts", "src", "cli", "browser", "rollup.config.ts", "native", "wasm.d.ts"], "exclude": ["dist", "node_modules", "test/typescript", "browser/dist"] } diff --git a/wasm.d.ts b/wasm.d.ts new file mode 100644 index 000000000..cbd5efcac --- /dev/null +++ b/wasm.d.ts @@ -0,0 +1,6 @@ +// eslint-disable-next-line import/no-unresolved +import './wasm/bindings_wasm_bg.wasm'; + +declare module './wasm/bindings_wasm_bg.wasm' { + export default function wasm(): Promise; +} diff --git a/wasm/bindings_wasm.d.ts b/wasm/bindings_wasm.d.ts new file mode 100644 index 000000000..07c63eddf --- /dev/null +++ b/wasm/bindings_wasm.d.ts @@ -0,0 +1,47 @@ +/* tslint:disable */ +/* eslint-disable */ +/** +* @param {string} code +* @returns {Uint8Array} +*/ +export function parse(code: string): Uint8Array; +/** +* @param {string} query +* @param {any} opts +* @returns {any} +*/ +export function browserslist(query: string, opts: any): any; + +export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; + +export interface InitOutput { + readonly memory: WebAssembly.Memory; + readonly parse: (a: number, b: number, c: number) => void; + readonly browserslist: (a: number, b: number, c: number, d: number) => void; + readonly __wbindgen_malloc: (a: number, b: number) => number; + readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; + readonly __wbindgen_add_to_stack_pointer: (a: number) => number; + readonly __wbindgen_free: (a: number, b: number, c: number) => void; + readonly __wbindgen_exn_store: (a: number) => void; +} + +export type SyncInitInput = BufferSource | WebAssembly.Module; +/** +* Instantiates the given `module`, which can either be bytes or +* a precompiled `WebAssembly.Module`. +* +* @param {SyncInitInput} module +* +* @returns {InitOutput} +*/ +export function initSync(module: SyncInitInput): InitOutput; + +/** +* If `module_or_path` is {RequestInfo} or {URL}, makes a request and +* for everything else, calls `WebAssembly.instantiate` directly. +* +* @param {InitInput | Promise} module_or_path +* +* @returns {Promise} +*/ +export default function __wbg_init (module_or_path?: InitInput | Promise): Promise; diff --git a/wasm/bindings_wasm_bg.wasm.d.ts b/wasm/bindings_wasm_bg.wasm.d.ts new file mode 100644 index 000000000..2c81912b7 --- /dev/null +++ b/wasm/bindings_wasm_bg.wasm.d.ts @@ -0,0 +1,10 @@ +/* tslint:disable */ +/* eslint-disable */ +export const memory: WebAssembly.Memory; +export function parse(a: number, b: number, c: number): void; +export function browserslist(a: number, b: number, c: number, d: number): void; +export function __wbindgen_malloc(a: number, b: number): number; +export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; +export function __wbindgen_add_to_stack_pointer(a: number): number; +export function __wbindgen_free(a: number, b: number, c: number): void; +export function __wbindgen_exn_store(a: number): void; From 92864d48896dd09c0381d4b1cbef769a03c3f7d1 Mon Sep 17 00:00:00 2001 From: XiaoPi <530257315@qq.com> Date: Mon, 18 Sep 2023 15:47:07 +0800 Subject: [PATCH 03/44] [v4.0] Set the default of skipSelf to true (#5142) * Set minimum Node version to 18 * Set the default of skipSelf to true * [v4.0] Switch parser to SWC and introduce native/WASM code (#5073) * Add native compilation for local NodeJS * Link instead of copying for faster dev cycles for now * Parse AST * Convert first trivial AST to a buffer * Use SWC for parsing * Extend AST conversion * Make AST more similar * Fix line number issue by creating a new sourcemap (and thus compiler) for each run * Collect timings * Add code_length to struct * Refine parsing * Extend parsing * Extend AST: ImportDefaultSpecifier, LiteralBoolean, LiteralNull, ExportDefaultExpression * Extend AST: ImportNamespaceSpecifier, ExportAll * Extend AST: BinaryExpression, ArrayPattern, ObjectPattern, AssignmentPatternProperty, ArrayLiteral, ImportExpression * Extend AST: ConditionalExpression * Extend AST: FunctionDeclaration, ClassDeclaration, ClassBody, ReturnStatement * Extend AST: ObjectLiteral, KeyValueProperty * Extend AST: ShorthandProperty * Extend AST: GetterProperty, AssignmentExpression, NewExpression, FunctionExpression * Extend AST: ThrowStatement * Extend AST: ExportDefaultDeclaration * Extend AST: AssignmentPattern, AwaitExpression, BreakStatement Start sorting AST nodes * Extend AST: TryStatement, CatchClause, ChainExpression * Extend AST: ClassExpression, ContinueStatement, DebuggerStatement, DoWhileStatement, EmptyStatement * Extend AST: ExportNamedDeclaration, ForInStatement, ForOfStatement, ForStatement * Extend AST: IfStatement * Extend AST: Import attributes * Extend AST: Literal, Literal * Extend AST: LogicalExpression * Extend AST: MetaProperty * Extend AST: Various Property types * Extend AST: Progress on classes * Extend AST: MethodDefinition, PropertyDefinition, PrivateName, ThisExpression * Extend AST: StaticBlock, Super * Extend AST: RestElement, SequenceExpression, SwitchCase, SwitchStatement * Extend AST: TaggedTemplateExpression, TemplateElement, TemplateLiteral, UnaryExpression, UpdateExpression, YieldExpression * Extend AST: Properties in object patterns * Finishing Fixes * More fixes * Run cargo fmt * Handle directives * Minor fixes * Unicode support * Fix optional chain expressions * Adapt tests * Do not run acorn anymore * Update lockfile * Minor fixes * Move to rust folder * Separate Rust Node bindings to allow adding WASM bindings in another workspace * Make Napi build closer to how rs.napi works * Fix path issues * Disable browser build for now * Add native package directories * Refine runWithEcho * Try initial steps with Github flow * Trigger change * Temporarily add yarn lockfile until we figured out if we get it to work with npm * Use nightly toolchain * Use default locations for Napi files to make things easier * Adapt workflow * Skip regular tests for now * Attempt to fix broken workflows * Attempt to fix broken workflows * Attempt to fix broken workflows * Test MacOS/WIndows * Fix bootstrap build * Skip tests * Rename workflow * Add additional tests * Use zig differently * Try to fix musl build * Skip musl again for now * Add publish to workflow * 4.0.0-0 * Remove yarn lock again * Fix coverage job * Fix artefact handling * Revert "4.0.0-0" This reverts commit 734806f0ae9a4cfa63e996c2d9be099b2a4580bf. * 4.0.0-0 * Do not include default triples twice * Fix native npm packages * 4.0.0-1 * Add missing additional tests except browser tests * Try to fix publish and tests * 4.0.0-2 * Switch to faster utf-16 conversion * 4.0.0-3 * Fix positioning algorithm when manually searching the code * 4.0.0-4 * feat: Add WASM browser build (#5077) * feat: add wasm browser build * move wasm binding into a separate cargo workspace * use imports replacing * set the targetEnv option of wasm to browser in browser build * add the wasm build to build command * fix lint error and ci error * add more comments to silence the linter * big change * trigger change * run browser tests * trigger change * tweak wasm build on CI * Increase build timeout * Use shared string constants * Extract fixed strings into constants * Remove comment * Get rid of dbg! calls * Add lockfile hash to cargo cache * Use if let over match in some cases * Return the buffer of the syntax error in parse_ast * Initial annotation support * Put annotation types into string table * Remove invalid annotations * Support nested calls and new expressions * Improve tree-shaking for annotations * Adapt test * Properly handle line-breaks, commas etc. * Mark nested pure annotations as pure * Remove sourcemap comments * Handle function side effect annotatinos * Remove old comment-handling code * Increase timeout for browser tests * Only skip the tests that still fail * Run coverage again on CI * Get the buffer of pos and message from the Syntax error * Handle the lint errors from SWC * Reenable tests about parse errors and adjust some relevant code * Emit native.js to native.cjs * Add cjs extension for native importee when bundling for ESM * Change native importee with replace plugin and emit native.cjs in napi build * Silence the linter for importing native * Use node:path to resolve native binding files * Add Node WASM files to Native packages for StackBlitz and similar use cases * Unignore *.d.ts in the wasm dir * 4.0.0-5 * Fix copy-wasm-node.js * 4.0.0-6 * Remove .gitignore in wasm-node directory * 4.0.0-7 * Include .cjs files when publishing rollup to npm * 4.0.0-8 * Get readString function at runtime * eslint: ignore wasm-node and set node extensions of import/resolver * 4.0.0-9 * Change the required node to >=14.18.0 as before * 4.0.0-10 * Prepare to fix ESM build Still requires bug-fix on Rollup side for relative external dependencies outside the ouput directory * Update Rollup * Enable ESM tests * Re-enable another test * Remove CJS eslint configuration * Fix extension * Fix test * Fix entension for native import * Support for publishing a completely separate package @rollup/wasm-node * 4.0.0-11 * Fix publish for wasm node package * Add AST verification to function tests * Only use plugin arrays in form and function tests * Fix spans in function tests * Verify AST in form tests as well * Try to publish @rollup/browser and fix publish-wasm-node-package.js * 4.0.0-12 * Tweak publish scripts * Fix importing wasm file in browser * Parse code as unknown module type for greater compatibility * Remove acorn options * Tweak getReadStringFunction * Fix browser tests * 4.0.0-13 * Remove polyfills that are no longer needed in browser tests * Convert to new import attributes AST format * Rename assertions to attributes * Deprecate externalImportAssertions in favor of externalImportAttributes * Update SWC version * Remove max-call-stack test SWC is not capable of handling it and we cannot fix it * Improve coverage * re-enable repl-artefacts workflow * Fix test * Preload wasm file in docs * docs: add functions to get full path of url * Delete the build plugin handleImportMetaUrl * Make 'npm install github/branch' work * Verify there is a valid changelog entry before releasing * Create release notes and comments from CI Minor change to maybe trigger a CI run * Fix RegExp * 4.0.0-14 * Minor changes for a test PR (#5139) * Fix RegExp use * 4.0.0-15 * Do not rely on current branch to find the PR * 4.0.0-16 * Fix how to determine git commit range * 4.0.0-17 * Make sure we fetch all history on publish * 4.0.0-18 * Add proper permissions * 4.0.0-19 * Use Double quotation marks instead of Single quotation marks if concurrently scripts with flags * Remove "engines" from native packages * Update CONTRIBUTING.md --------- Co-authored-by: XiaoPi <530257315@qq.com> * Update tests * Retrieve the code that was omitted during the merge * Restore test coverage * Update docs/plugin-development/index.md Co-authored-by: Lukas Taegert-Atkinson --------- Co-authored-by: Lukas Taegert-Atkinson Co-authored-by: Lukas Taegert-Atkinson --- docs/plugin-development/index.md | 15 +++-------- src/utils/PluginContext.ts | 1 + src/utils/resolveIdViaPlugins.ts | 8 +++--- .../samples/preserve-modules-root/_config.js | 2 +- .../make-relative-false/_config.js | 2 +- .../make-relative-relative/_config.js | 2 +- .../make-relative-true/_config.js | 2 +- .../context-resolve-skipself/_config.js | 26 ++++++++++++++++--- .../context-resolve-skipself/existing.js | 1 - .../samples/context-resolve-skipself/main.js | 8 ++++-- .../plugin-assertions-this-resolve/_config.js | 3 +-- .../module-side-effects/writable/_config.js | 5 ++-- .../samples/preload-cyclic-module/_config.js | 2 +- .../samples/preload-module/_config.js | 2 +- .../prevent-context-resolve-loop/_config.js | 14 +++------- .../samples/reuse-resolve-meta/_config.js | 2 +- 16 files changed, 53 insertions(+), 42 deletions(-) delete mode 100644 test/function/samples/context-resolve-skipself/existing.js diff --git a/docs/plugin-development/index.md b/docs/plugin-development/index.md index 404fa9c2b..175bdb34c 100644 --- a/docs/plugin-development/index.md +++ b/docs/plugin-development/index.md @@ -508,12 +508,8 @@ function injectPolyfillPlugin() { return { id: POLYFILL_ID, moduleSideEffects: true }; } if (options.isEntry) { - // Determine what the actual entry would have been. We need - // "skipSelf" to avoid an infinite loop. - const resolution = await this.resolve(source, importer, { - skipSelf: true, - ...options - }); + // Determine what the actual entry would have been. + const resolution = await this.resolve(source, importer, options); // If it cannot be resolved or is external, just return it // so that Rollup can display an error if (!resolution || resolution.external) return resolution; @@ -1536,10 +1532,7 @@ export default function addProxyPlugin() { } // We make sure to pass on any resolveId options to // this.resolve to get the module id - const resolution = await this.resolve(source, importer, { - skipSelf: true, - ...options - }); + const resolution = await this.resolve(source, importer, options); // We can only pre-load existing and non-external ids if (resolution && !resolution.external) { // we pass on the entire resolution information @@ -1699,7 +1692,7 @@ The return type **ResolvedId** of this hook is defined in [`this.getModuleInfo`] Resolve imports to module ids (i.e. file names) using the same plugins that Rollup uses, and determine if an import should be external. If `null` is returned, the import could not be resolved by Rollup or any plugin but was not explicitly marked as external by the user. If an absolute external id is returned that should remain absolute in the output either via the [`makeAbsoluteExternalsRelative`](../configuration-options/index.md#makeabsoluteexternalsrelative) option or by explicit plugin choice in the [`resolveId`](#resolveid) hook, `external` will be `"absolute"` instead of `true`. -If you pass `skipSelf: true`, then the `resolveId` hook of the plugin from which `this.resolve` is called will be skipped when resolving. When other plugins themselves also call `this.resolve` in their `resolveId` hooks with the _exact same `source` and `importer`_ while handling the original `this.resolve` call, then the `resolveId` hook of the original plugin will be skipped for those calls as well. The rationale here is that the plugin already stated that it "does not know" how to resolve this particular combination of `source` and `importer` at this point in time. If you do not want this behaviour, do not use `skipSelf` but implement your own infinite loop prevention mechanism if necessary. +The default of `skipSelf` is `true`, So the `resolveId` hook of the plugin from which `this.resolve` is called will be skipped when resolving. When other plugins themselves also call `this.resolve` in their `resolveId` hooks with the _exact same `source` and `importer`_ while handling the original `this.resolve` call, then the `resolveId` hook of the original plugin will be skipped for those calls as well. The rationale here is that the plugin already stated that it "does not know" how to resolve this particular combination of `source` and `importer` at this point in time. If you do not want this behaviour, set `skipSelf` to `false` and implement your own infinite loop prevention mechanism if necessary. You can also pass an object of plugin-specific options via the `custom` option, see [custom resolver options](#custom-resolver-options) for details. diff --git a/src/utils/PluginContext.ts b/src/utils/PluginContext.ts index 4bde06fd8..7fff45919 100644 --- a/src/utils/PluginContext.ts +++ b/src/utils/PluginContext.ts @@ -100,6 +100,7 @@ export function getPluginContext( }, parse: graph.contextParse.bind(graph), resolve(source, importer, { attributes, custom, isEntry, skipSelf } = BLANK) { + skipSelf ??= true; return graph.moduleLoader.resolveId( source, importer, diff --git a/src/utils/resolveIdViaPlugins.ts b/src/utils/resolveIdViaPlugins.ts index afe96a821..d33a9ed39 100644 --- a/src/utils/resolveIdViaPlugins.ts +++ b/src/utils/resolveIdViaPlugins.ts @@ -24,15 +24,17 @@ export function resolveIdViaPlugins( } replaceContext = (pluginContext, plugin): PluginContext => ({ ...pluginContext, - resolve: (source, importer, { attributes, custom, isEntry, skipSelf } = BLANK) => - moduleLoaderResolveId( + resolve: (source, importer, { attributes, custom, isEntry, skipSelf } = BLANK) => { + skipSelf ??= true; + return moduleLoaderResolveId( source, importer, custom, isEntry, attributes || EMPTY_OBJECT, skipSelf ? [...skip, { importer, plugin, source }] : skip - ) + ); + } }); } return pluginDriver.hookFirstAndGetPlugin( diff --git a/test/chunking-form/samples/preserve-modules-root/_config.js b/test/chunking-form/samples/preserve-modules-root/_config.js index f9390f4e2..bc486962d 100644 --- a/test/chunking-form/samples/preserve-modules-root/_config.js +++ b/test/chunking-form/samples/preserve-modules-root/_config.js @@ -11,7 +11,7 @@ module.exports = defineTest({ name: 'convert-slashes', // This simulates converted slashes as used by e.g. Vite async resolveId(source, importer, options) { - const resolved = await this.resolve(source, importer, { ...options, skipSelf: true }); + const resolved = await this.resolve(source, importer, options); return { ...resolved, id: resolved.id.replace(/\\/g, '/') }; } }, diff --git a/test/form/samples/make-absolute-externals-relative/make-relative-false/_config.js b/test/form/samples/make-absolute-externals-relative/make-relative-false/_config.js index 753fdada4..198fbd68b 100644 --- a/test/form/samples/make-absolute-externals-relative/make-relative-false/_config.js +++ b/test/form/samples/make-absolute-externals-relative/make-relative-false/_config.js @@ -25,7 +25,7 @@ module.exports = defineTest({ // eslint-disable-next-line unicorn/consistent-function-scoping const testExternal = async (source, expected) => assert.deepStrictEqual( - (await this.resolve(source, ID_MAIN)).external, + (await this.resolve(source, ID_MAIN, { skipSelf: false })).external, expected, source ); diff --git a/test/form/samples/make-absolute-externals-relative/make-relative-relative/_config.js b/test/form/samples/make-absolute-externals-relative/make-relative-relative/_config.js index bfb7505bb..90defe1d4 100644 --- a/test/form/samples/make-absolute-externals-relative/make-relative-relative/_config.js +++ b/test/form/samples/make-absolute-externals-relative/make-relative-relative/_config.js @@ -28,7 +28,7 @@ module.exports = defineTest({ // eslint-disable-next-line unicorn/consistent-function-scoping const testExternal = async (source, expected) => assert.deepStrictEqual( - (await this.resolve(source, ID_MAIN)).external, + (await this.resolve(source, ID_MAIN, { skipSelf: false })).external, expected, source ); diff --git a/test/form/samples/make-absolute-externals-relative/make-relative-true/_config.js b/test/form/samples/make-absolute-externals-relative/make-relative-true/_config.js index d78601043..f5167a5e1 100644 --- a/test/form/samples/make-absolute-externals-relative/make-relative-true/_config.js +++ b/test/form/samples/make-absolute-externals-relative/make-relative-true/_config.js @@ -27,7 +27,7 @@ module.exports = defineTest({ // eslint-disable-next-line unicorn/consistent-function-scoping const testExternal = async (source, expected) => assert.deepStrictEqual( - (await this.resolve(source, ID_MAIN)).external, + (await this.resolve(source, ID_MAIN, { skipSelf: false })).external, expected, source ); diff --git a/test/function/samples/context-resolve-skipself/_config.js b/test/function/samples/context-resolve-skipself/_config.js index 75662842f..3f1d53a71 100644 --- a/test/function/samples/context-resolve-skipself/_config.js +++ b/test/function/samples/context-resolve-skipself/_config.js @@ -1,5 +1,8 @@ const path = require('node:path'); +let hasInfinite = false; +const importer = path.join(__dirname, 'main.js'); + module.exports = defineTest({ description: 'allows a plugin to skip its own resolveId hook when using this.resolve', options: { @@ -9,15 +12,15 @@ module.exports = defineTest({ if (id === 'resolutions') { return id; } - if (id.startsWith('test')) { + if (id.startsWith('test') || id.startsWith('foo') || id.startsWith('bar')) { return 'own-resolution'; } }, load(id) { if (id === 'resolutions') { - const importer = path.join(__dirname, 'main.js'); return Promise.all([ - this.resolve('test', importer).then(result => ({ id: result.id, text: 'all' })), + this.resolve('bar', importer).then(result => ({ id: result.id, text: 'bar' })), + this.resolve('foo', importer).then(result => ({ id: result.id, text: 'foo' })), this.resolve('test', importer, { skipSelf: false }).then(result => ({ id: result.id, text: 'unskipped' @@ -32,10 +35,27 @@ module.exports = defineTest({ }, { resolveId(id) { + if (id.startsWith('bar')) { + return this.resolve('bar', importer); + } + if (id.startsWith('foo')) { + if (hasInfinite) { + return 'foo-resolution'; + } + hasInfinite = true; + return this.resolve('foo', importer, { skipSelf: false }); + } if (id.startsWith('test')) { return 'other-resolution'; } } + }, + { + resolveId(id) { + if (id.startsWith('bar')) { + return 'bar-resolution'; + } + } } ] } diff --git a/test/function/samples/context-resolve-skipself/existing.js b/test/function/samples/context-resolve-skipself/existing.js deleted file mode 100644 index 948626053..000000000 --- a/test/function/samples/context-resolve-skipself/existing.js +++ /dev/null @@ -1 +0,0 @@ -console.log('existing'); diff --git a/test/function/samples/context-resolve-skipself/main.js b/test/function/samples/context-resolve-skipself/main.js index a0be821e3..d490fbe14 100644 --- a/test/function/samples/context-resolve-skipself/main.js +++ b/test/function/samples/context-resolve-skipself/main.js @@ -2,8 +2,12 @@ import resolutions from 'resolutions'; assert.deepStrictEqual(resolutions, [ { - id: 'own-resolution', - text: 'all' + id: 'bar-resolution', + text: 'bar' + }, + { + id: 'foo-resolution', + text: 'foo' }, { id: 'own-resolution', diff --git a/test/function/samples/import-assertions/plugin-assertions-this-resolve/_config.js b/test/function/samples/import-assertions/plugin-assertions-this-resolve/_config.js index 982aa5b54..1ded1d1b6 100644 --- a/test/function/samples/import-assertions/plugin-assertions-this-resolve/_config.js +++ b/test/function/samples/import-assertions/plugin-assertions-this-resolve/_config.js @@ -9,7 +9,6 @@ module.exports = defineTest({ async resolveId() { assert.deepStrictEqual( await this.resolve('external', undefined, { - skipSelf: true, attributes: { a: 'c', b: 'd' } }), { @@ -28,7 +27,7 @@ module.exports = defineTest({ name: 'second', async resolveId(source, importer, { attributes }) { if (source === 'external') { - return this.resolve(source, importer, { attributes, skipSelf: true }); + return this.resolve(source, importer, { attributes }); } } }, diff --git a/test/function/samples/module-side-effects/writable/_config.js b/test/function/samples/module-side-effects/writable/_config.js index 77d0982d9..4bbc2bfba 100644 --- a/test/function/samples/module-side-effects/writable/_config.js +++ b/test/function/samples/module-side-effects/writable/_config.js @@ -18,9 +18,8 @@ module.exports = defineTest({ return { id: POLYFILL_ID, moduleSideEffects: true }; } if (options.isEntry) { - // Determine what the actual entry would have been. We need - // "skipSelf" to avoid an infinite loop. - const resolution = await this.resolve(source, importer, { skipSelf: true, ...options }); + // Determine what the actual entry would have been. + const resolution = await this.resolve(source, importer, options); // If it cannot be resolved or is external, just return it so that // Rollup can display an error if (!resolution || resolution.external) return resolution; diff --git a/test/function/samples/preload-cyclic-module/_config.js b/test/function/samples/preload-cyclic-module/_config.js index 9d666acce..c0e87e353 100644 --- a/test/function/samples/preload-cyclic-module/_config.js +++ b/test/function/samples/preload-cyclic-module/_config.js @@ -18,7 +18,7 @@ module.exports = defineTest({ if (!importer || importer.endsWith('?proxy')) { return null; } - const resolution = await this.resolve(source, importer, { skipSelf: true, ...options }); + const resolution = await this.resolve(source, importer, options); if (resolution && !resolution.external) { const moduleInfo = await this.load(resolution); if (moduleInfo.code.includes('/* use proxy */')) { diff --git a/test/function/samples/preload-module/_config.js b/test/function/samples/preload-module/_config.js index 80c169f58..262754e4e 100644 --- a/test/function/samples/preload-module/_config.js +++ b/test/function/samples/preload-module/_config.js @@ -25,7 +25,7 @@ module.exports = defineTest({ }, async resolveId(source, importer, options) { if (source.endsWith('main.js')) { - const resolvedId = await this.resolve(source, importer, { skipSelf: true, ...options }); + const resolvedId = await this.resolve(source, importer, options); const { ast, ...moduleInfo } = await this.load({ ...resolvedId, meta: { testPlugin: 'first' } diff --git a/test/function/samples/prevent-context-resolve-loop/_config.js b/test/function/samples/prevent-context-resolve-loop/_config.js index 50259501c..9fad63d38 100644 --- a/test/function/samples/prevent-context-resolve-loop/_config.js +++ b/test/function/samples/prevent-context-resolve-loop/_config.js @@ -15,7 +15,7 @@ module.exports = defineTest({ { name: 'first', async resolveId(source, importer) { - const { id } = await this.resolve(source, importer, { skipSelf: true }); + const { id } = await this.resolve(source, importer); if (id === ID_OTHER_1) { return ID_OTHER_4; } @@ -24,19 +24,13 @@ module.exports = defineTest({ { name: 'second', async resolveId(source, importer) { - const { id } = await this.resolve(source, importer, { skipSelf: true }); + const { id } = await this.resolve(source, importer); if (id === ID_OTHER_2) { // To make this more interesting // The first plugin should resolve everything to 4 - assert.strictEqual( - (await this.resolve('./other1', importer, { skipSelf: true })).id, - ID_OTHER_4 - ); + assert.strictEqual((await this.resolve('./other1', importer)).id, ID_OTHER_4); // The second file should however be resolved by core as this plugin is out of the loop - assert.strictEqual( - (await this.resolve(source, ID_OTHER_1, { skipSelf: true })).id, - ID_OTHER_2 - ); + assert.strictEqual((await this.resolve(source, ID_OTHER_1)).id, ID_OTHER_2); return ID_OTHER_4; } } diff --git a/test/function/samples/reuse-resolve-meta/_config.js b/test/function/samples/reuse-resolve-meta/_config.js index 18abd3c77..f402fae46 100644 --- a/test/function/samples/reuse-resolve-meta/_config.js +++ b/test/function/samples/reuse-resolve-meta/_config.js @@ -10,7 +10,7 @@ module.exports = defineTest({ plugins: [ { async resolveId(source, importer) { - const { id } = await this.resolve(source, importer, { skipSelf: true }); + const { id } = await this.resolve(source, importer); return { id, meta }; }, transform(code) { From 62cbff4a20030c5d787f3162ea29981e40525030 Mon Sep 17 00:00:00 2001 From: XiaoPi <530257315@qq.com> Date: Thu, 21 Sep 2023 12:49:11 +0800 Subject: [PATCH 04/44] [v4.0] Imporve the performance of generating ast and rollup ast nodes (#5144) * Set TsConfig useDefineForClassFields to false for reducing time consumption * Adapt annotations props for reducing memory consumption --- src/utils/convert-ast.ts | 154 +++++++++++++++++++++++---------------- tsconfig.json | 3 +- 2 files changed, 95 insertions(+), 62 deletions(-) diff --git a/src/utils/convert-ast.ts b/src/utils/convert-ast.ts index 608fb518f..a94308f65 100644 --- a/src/utils/convert-ast.ts +++ b/src/utils/convert-ast.ts @@ -55,18 +55,21 @@ const nodeConverters: ((position: number, buffer: Uint32Array, readString: ReadS const parameters = convertNodeList(buffer[position++], buffer, readString); const body = convertNode(buffer[position++], buffer, readString); const annotations = convertAnnotationList(position, buffer); - return { - type: 'ArrowFunctionExpression', - start, - end, - async, - body, - expression, - generator, - id: null, - params: parameters, - _rollupAnnotations: annotations - }; + return addAnnotationProperty( + { + type: 'ArrowFunctionExpression', + start, + end, + async, + body, + expression, + generator, + id: null, + params: parameters + }, + annotations, + ANNOTATION_KEY + ); }, // index:3; AssignmentExpression (position, buffer, readString): estree.AssignmentExpression & AstNode => { @@ -158,15 +161,18 @@ const nodeConverters: ((position: number, buffer: Uint32Array, readString: ReadS const callee = convertNode(buffer[position++], buffer, readString); const argumentsList = convertNodeList(buffer[position++], buffer, readString); const annotations = convertAnnotationList(position, buffer); - return { - type: 'CallExpression', - start, - end, - arguments: argumentsList, - callee, - optional, - ...(annotations.length > 0 ? { _rollupAnnotations: annotations } : {}) - }; + return addAnnotationProperty( + { + type: 'CallExpression', + start, + end, + arguments: argumentsList, + callee, + optional + }, + annotations, + ANNOTATION_KEY + ); }, // index:10; CatchClause (position, buffer, readString): estree.CatchClause & AstNode => { @@ -441,18 +447,21 @@ const nodeConverters: ((position: number, buffer: Uint32Array, readString: ReadS const parameters = convertNodeList(buffer[position++], buffer, readString); const body = convertNode(buffer[position++], buffer, readString); const annotations = convertAnnotationList(position, buffer); - return { - type: 'FunctionDeclaration', - start, - end, - async, - body, - expression: false, - generator, - id: idPosition ? convertNode(idPosition, buffer, readString) : null, - params: parameters, - _rollupAnnotations: annotations - }; + return addAnnotationProperty( + { + type: 'FunctionDeclaration', + start, + end, + async, + body, + expression: false, + generator, + id: idPosition ? convertNode(idPosition, buffer, readString) : null, + params: parameters + }, + annotations, + ANNOTATION_KEY + ); }, // index:29; FunctionExpression (position, buffer, readString): FunctionExpression & AstNode & { expression: false } => { @@ -464,18 +473,21 @@ const nodeConverters: ((position: number, buffer: Uint32Array, readString: ReadS const parameters = convertNodeList(buffer[position++], buffer, readString); const body = convertNode(buffer[position++], buffer, readString); const annotations = convertAnnotationList(position, buffer); - return { - type: 'FunctionExpression', - start, - end, - async, - body, - expression: false, - generator, - id: idPosition ? convertNode(idPosition, buffer, readString) : null, - params: parameters, - _rollupAnnotations: annotations - }; + return addAnnotationProperty( + { + type: 'FunctionExpression', + start, + end, + async, + body, + expression: false, + generator, + id: idPosition ? convertNode(idPosition, buffer, readString) : null, + params: parameters + }, + annotations, + ANNOTATION_KEY + ); }, // index:30; Identifier (position, buffer, readString): estree.Identifier & AstNode => { @@ -765,14 +777,17 @@ const nodeConverters: ((position: number, buffer: Uint32Array, readString: ReadS const callee = convertNode(buffer[position++], buffer, readString); const argumentsPosition = buffer[position++]; const annotations = convertAnnotationList(position, buffer); - return { - type: 'NewExpression', - start, - end, - arguments: argumentsPosition ? convertNodeList(argumentsPosition, buffer, readString) : [], - callee, - ...(annotations.length > 0 ? { _rollupAnnotations: annotations } : {}) - }; + return addAnnotationProperty( + { + type: 'NewExpression', + start, + end, + arguments: argumentsPosition ? convertNodeList(argumentsPosition, buffer, readString) : [], + callee + }, + annotations, + ANNOTATION_KEY + ); }, // index:50; ObjectExpression (position, buffer, readString): estree.ObjectExpression & AstNode => { @@ -816,14 +831,17 @@ const nodeConverters: ((position: number, buffer: Uint32Array, readString: ReadS const end = buffer[position++]; const annotations = convertAnnotationList(buffer[position++], buffer); const body = convertNodeList(position, buffer, readString); - return { - type: 'Program', - start, - end, - body, - sourceType: 'module', - ...(annotations.length > 0 ? { _rollupRemoved: annotations } : {}) - }; + return addAnnotationProperty( + { + type: 'Program', + start, + end, + body, + sourceType: 'module' + }, + annotations, + INVALID_ANNOTATION_KEY + ); }, // index:54; Property (position, buffer, readString): estree.Property & AstNode => { @@ -1171,6 +1189,20 @@ const convertAnnotation = (position: number, buffer: Uint32Array): RollupAnnotat return { end, start, type }; }; +const addAnnotationProperty = ( + node: T, + annotations: RollupAnnotation[], + key: typeof ANNOTATION_KEY | typeof INVALID_ANNOTATION_KEY +): T => { + if (annotations.length > 0) { + return { + ...node, + [key]: annotations + }; + } + return node; +}; + const convertString = (position: number, buffer: Uint32Array, readString: ReadString): string => { const length = buffer[position++]; const bytePosition = position << 2; diff --git a/tsconfig.json b/tsconfig.json index 0ae0e885e..c9b28c97f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,7 +10,8 @@ "resolveJsonModule": true, "skipLibCheck": true, "strict": true, - "target": "ES2022" + "target": "ES2022", + "useDefineForClassFields": false }, "include": ["typings/**/*.d.ts", "src", "cli", "browser", "rollup.config.ts", "native", "wasm.d.ts"], "exclude": ["dist", "node_modules", "test/typescript", "browser/dist"] From 55abe0fbf7116c9160a53da6a27cc9bce2eafd40 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Thu, 21 Sep 2023 06:51:44 +0200 Subject: [PATCH 05/44] [v4.0] Remove deprecated features (#5143) * Remove hasModuleSideEffects from module info * Remove this.moduleIds from plugin context * Remove output.preferConst * Remove output.dynamicImportFunction * Remove output.experimentalDeepDynamicChunkOptimization * Remove output.namespaceToStringTag * Remove inlineDynamicImports input option * Remove manualChunks and preserveModules input options as well as maxParallelFileReads --- docs/configuration-options/index.md | 79 ----- .../en/slugs-and-pages-by-legacy-slugs.json | 2 +- docs/plugin-development/index.md | 14 - src/Chunk.ts | 21 +- src/ExternalModule.ts | 20 +- src/Module.ts | 18 +- src/ast/nodes/ImportExpression.ts | 12 - src/ast/variables/NamespaceVariable.ts | 4 +- src/finalisers/amd.ts | 6 +- src/finalisers/cjs.ts | 6 +- src/finalisers/es.ts | 4 +- src/finalisers/iife.ts | 6 +- src/finalisers/shared/getInteropBlock.ts | 4 +- src/finalisers/system.ts | 12 +- src/finalisers/umd.ts | 6 +- src/rollup/types.d.ts | 38 --- src/utils/PluginContext.ts | 24 +- src/utils/interopHelpers.ts | 60 +--- src/utils/options/mergeOptions.ts | 8 - src/utils/options/normalizeInputOptions.ts | 88 +---- src/utils/options/normalizeOutputOptions.ts | 115 +------ src/utils/renderHelpers.ts | 3 +- src/utils/urls.ts | 6 - .../avoid-imports-preserve-modules/_config.js | 9 - .../_expected/amd/a.js | 7 - .../_expected/amd/b.js | 7 - .../_expected/amd/main.js | 5 - .../_expected/amd/one.js | 7 - .../_expected/cjs/a.js | 5 - .../_expected/cjs/b.js | 5 - .../_expected/cjs/main.js | 6 - .../_expected/cjs/one.js | 7 - .../_expected/es/a.js | 3 - .../_expected/es/b.js | 3 - .../_expected/es/main.js | 4 - .../_expected/es/one.js | 5 - .../_expected/system/a.js | 10 - .../_expected/system/b.js | 10 - .../_expected/system/main.js | 16 - .../_expected/system/one.js | 14 - .../avoid-imports-preserve-modules/a.js | 1 - .../avoid-imports-preserve-modules/b.js | 1 - .../avoid-imports-preserve-modules/c.js | 1 - .../avoid-imports-preserve-modules/index.js | 3 - .../avoid-imports-preserve-modules/main.js | 3 - .../avoid-imports-preserve-modules/one.js | 2 - .../circular-manual-chunks/_config.js | 9 - .../_expected/amd/generated-lib1.js | 8 - .../_expected/amd/generated-lib2.js | 8 - .../_expected/amd/main.js | 7 - .../_expected/cjs/generated-lib1.js | 8 - .../_expected/cjs/generated-lib2.js | 8 - .../_expected/cjs/main.js | 8 - .../_expected/es/generated-lib1.js | 6 - .../_expected/es/generated-lib2.js | 6 - .../_expected/es/main.js | 2 - .../_expected/system/generated-lib1.js | 15 - .../_expected/system/generated-lib2.js | 15 - .../_expected/system/main.js | 13 - .../deprecated/circular-manual-chunks/lib1.js | 3 - .../deprecated/circular-manual-chunks/lib2.js | 3 - .../deprecated/circular-manual-chunks/main.js | 1 - .../dynamic-import-comments/_config.js | 17 - .../_expected/amd/main.js | 24 -- .../_expected/cjs/main.js | 5 - .../_expected/es/main.js | 3 - .../_expected/system/main.js | 12 - .../dynamic-import-comments/main.js | 3 - .../dynamic-import-inlining-object/_config.js | 9 - .../_expected/amd/entry.js | 12 - .../_expected/cjs/entry.js | 10 - .../_expected/es/entry.js | 8 - .../_expected/system/entry.js | 15 - .../dynamic-import-inlining-object/foo.js | 1 - .../dynamic-import-inlining-object/main.js | 2 - .../deprecated/dynamic-import-name/_config.js | 17 - .../dynamic-import-name/_expected/amd/main.js | 22 -- .../dynamic-import-name/_expected/cjs/main.js | 3 - .../dynamic-import-name/_expected/es/main.js | 1 - .../_expected/system/main.js | 10 - .../deprecated/dynamic-import-name/main.js | 1 - .../emit-file-chunk-facade/_config.js | 22 -- .../_expected/amd/generated-build-starter.js | 11 - .../_expected/amd/generated-buildStart.js | 7 - .../_expected/amd/main.js | 5 - .../_expected/cjs/generated-build-starter.js | 9 - .../_expected/cjs/generated-buildStart.js | 7 - .../_expected/cjs/main.js | 5 - .../_expected/es/generated-build-starter.js | 6 - .../_expected/es/generated-buildStart.js | 1 - .../_expected/es/main.js | 3 - .../system/generated-build-starter.js | 13 - .../_expected/system/generated-buildStart.js | 13 - .../_expected/system/main.js | 15 - .../emit-file-chunk-facade/buildStart.js | 5 - .../deprecated/emit-file-chunk-facade/dep.js | 2 - .../deprecated/emit-file-chunk-facade/main.js | 3 - .../empty-module-no-treeshake/_config.js | 70 ---- .../amd/generated-emptyTransformed.js | 5 - .../_expected/amd/main1.js | 5 - .../_expected/amd/main2.js | 5 - .../cjs/generated-emptyTransformed.js | 2 - .../_expected/cjs/main1.js | 5 - .../_expected/cjs/main2.js | 5 - .../es/generated-emptyTransformed.js | 1 - .../_expected/es/main1.js | 3 - .../_expected/es/main2.js | 3 - .../system/generated-emptyTransformed.js | 10 - .../_expected/system/main1.js | 11 - .../_expected/system/main2.js | 11 - .../empty-module-no-treeshake/main1.js | 4 - .../empty-module-no-treeshake/main2.js | 4 - .../_config.js | 9 - .../_expected/amd/components/index.js | 8 - .../_expected/amd/components/sub/index.js | 11 - .../_expected/amd/main.js | 8 - .../_expected/cjs/components/index.js | 8 - .../_expected/cjs/components/sub/index.js | 9 - .../_expected/cjs/main.js | 9 - .../_expected/es/components/index.js | 6 - .../_expected/es/components/sub/index.js | 4 - .../_expected/es/main.js | 2 - .../_expected/system/components/index.js | 15 - .../_expected/system/components/sub/index.js | 11 - .../_expected/system/main.js | 15 - .../components/index.js | 4 - .../components/sub/index.js | 4 - .../main.js | 3 - .../manual-chunk-avoid-facade/_config.js | 11 - .../_expected/amd/main1.js | 5 - .../_expected/amd/main2.js | 9 - .../_expected/cjs/main1.js | 5 - .../_expected/cjs/main2.js | 7 - .../_expected/es/main1.js | 3 - .../_expected/es/main2.js | 5 - .../_expected/system/main1.js | 14 - .../_expected/system/main2.js | 12 - .../manual-chunk-avoid-facade/dep.js | 1 - .../manual-chunk-avoid-facade/main1.js | 3 - .../manual-chunk-avoid-facade/main2.js | 5 - .../_config.js | 14 - .../_expected/amd/main.js | 11 - .../_expected/amd/main2.js | 5 - .../_expected/cjs/main.js | 9 - .../_expected/cjs/main2.js | 4 - .../_expected/es/main.js | 7 - .../_expected/es/main2.js | 1 - .../_expected/system/main.js | 14 - .../_expected/system/main2.js | 11 - .../dep.js | 1 - .../main.js | 5 - .../main2.js | 1 - .../outer.js | 3 - .../_config.js | 14 - .../_expected/amd/main.js | 11 - .../_expected/cjs/main.js | 9 - .../_expected/es/main.js | 7 - .../_expected/system/main.js | 14 - .../manual-chunk-contains-entry-match/dep.js | 1 - .../manual-chunk-contains-entry-match/main.js | 5 - .../outer.js | 3 - .../manual-chunk-is-entry-conflict/_config.js | 14 - .../_expected/amd/main.js | 11 - .../_expected/amd/main2.js | 5 - .../_expected/cjs/main.js | 9 - .../_expected/cjs/main2.js | 4 - .../_expected/es/main.js | 7 - .../_expected/es/main2.js | 1 - .../_expected/system/main.js | 14 - .../_expected/system/main2.js | 11 - .../manual-chunk-is-entry-conflict/dep.js | 1 - .../manual-chunk-is-entry-conflict/main.js | 5 - .../manual-chunk-is-entry-conflict/main2.js | 1 - .../manual-chunk-is-entry-match/_config.js | 14 - .../_expected/amd/main.js | 11 - .../_expected/cjs/main.js | 9 - .../_expected/es/main.js | 7 - .../_expected/system/main.js | 14 - .../manual-chunk-is-entry-match/dep.js | 1 - .../manual-chunk-is-entry-match/main.js | 5 - .../manual-chunks-different-nested/_config.js | 13 - .../_expected/amd/generated-manual-inner.js | 5 - .../_expected/amd/generated-manual-middle.js | 5 - .../_expected/amd/generated-manual-outer.js | 5 - .../_expected/amd/main.js | 5 - .../_expected/cjs/generated-manual-inner.js | 3 - .../_expected/cjs/generated-manual-middle.js | 5 - .../_expected/cjs/generated-manual-outer.js | 5 - .../_expected/cjs/main.js | 7 - .../_expected/es/generated-manual-inner.js | 1 - .../_expected/es/generated-manual-middle.js | 3 - .../_expected/es/generated-manual-outer.js | 3 - .../_expected/es/main.js | 5 - .../system/generated-manual-inner.js | 10 - .../system/generated-manual-middle.js | 11 - .../system/generated-manual-outer.js | 11 - .../_expected/system/main.js | 11 - .../manual-chunks-different-nested/inner.js | 1 - .../manual-chunks-different-nested/main.js | 3 - .../manual-chunks-different-nested/middle.js | 3 - .../manual-chunks-different-nested/outer.js | 3 - .../manual-chunks-dynamic-facades/_config.js | 11 - .../_expected/amd/generated-dynamic.js | 34 -- .../_expected/amd/main.js | 7 - .../_expected/cjs/generated-dynamic.js | 32 -- .../_expected/cjs/main.js | 7 - .../_expected/es/generated-dynamic.js | 27 -- .../_expected/es/main.js | 5 - .../_expected/system/generated-dynamic.js | 37 -- .../_expected/system/main.js | 16 - .../manual-chunks-dynamic-facades/dep.js | 1 - .../manual-chunks-dynamic-facades/dynamic1.js | 4 - .../manual-chunks-dynamic-facades/dynamic2.js | 1 - .../manual-chunks-dynamic-facades/dynamic3.js | 1 - .../manual-chunks-dynamic-facades/main.js | 5 - .../_config.js | 11 - .../_expected/amd/generated-dynamic.js | 25 -- .../_expected/amd/main.js | 6 - .../_expected/cjs/generated-dynamic.js | 23 -- .../_expected/cjs/main.js | 4 - .../_expected/es/generated-dynamic.js | 20 -- .../_expected/es/main.js | 2 - .../_expected/system/generated-dynamic.js | 29 -- .../_expected/system/main.js | 11 - .../dynamic1.js | 3 - .../dynamic2.js | 4 - .../main.js | 2 - .../manual-chunks-dynamic/_config.js | 11 - .../_expected/amd/generated-dynamic.js | 7 - .../_expected/amd/main.js | 5 - .../_expected/cjs/generated-dynamic.js | 5 - .../_expected/cjs/main.js | 3 - .../_expected/es/generated-dynamic.js | 3 - .../_expected/es/main.js | 1 - .../_expected/system/generated-dynamic.js | 10 - .../_expected/system/main.js | 10 - .../manual-chunks-dynamic/dynamic.js | 1 - .../deprecated/manual-chunks-dynamic/main.js | 1 - .../manual-chunks-function/_config.js | 13 - .../_expected/amd/generated-chunk-b.js | 7 - .../_expected/amd/generated-chunk-c.js | 5 - .../_expected/amd/main-a.js | 9 - .../_expected/cjs/generated-chunk-b.js | 5 - .../_expected/cjs/generated-chunk-c.js | 5 - .../_expected/cjs/main-a.js | 10 - .../_expected/es/generated-chunk-b.js | 3 - .../_expected/es/generated-chunk-c.js | 3 - .../_expected/es/main-a.js | 8 - .../_expected/system/generated-chunk-b.js | 12 - .../_expected/system/generated-chunk-c.js | 11 - .../_expected/system/main-a.js | 15 - .../manual-chunks-function/dep-a.js | 4 - .../manual-chunks-function/dep-b.js | 3 - .../manual-chunks-function/dep-c.js | 3 - .../deprecated/manual-chunks-function/dep1.js | 1 - .../deprecated/manual-chunks-function/dep2.js | 1 - .../manual-chunks-function/main-a.js | 4 - .../manual-chunks-nested/_config.js | 11 - .../_expected/amd/generated-manual.js | 9 - .../_expected/amd/main.js | 5 - .../_expected/cjs/generated-manual.js | 7 - .../_expected/cjs/main.js | 5 - .../_expected/es/generated-manual.js | 5 - .../manual-chunks-nested/_expected/es/main.js | 3 - .../_expected/system/generated-manual.js | 14 - .../_expected/system/main.js | 11 - .../deprecated/manual-chunks-nested/inner.js | 1 - .../deprecated/manual-chunks-nested/main.js | 3 - .../deprecated/manual-chunks-nested/middle.js | 3 - .../deprecated/manual-chunks-nested/outer.js | 3 - .../deprecated/manual-chunks/_config.js | 12 - .../_expected/amd/generated-deps2and3.js | 20 -- .../_expected/amd/generated-lib1.js | 9 - .../manual-chunks/_expected/amd/main.js | 17 - .../_expected/cjs/generated-deps2and3.js | 20 -- .../_expected/cjs/generated-lib1.js | 7 - .../manual-chunks/_expected/cjs/main.js | 18 - .../_expected/es/generated-deps2and3.js | 17 - .../_expected/es/generated-lib1.js | 5 - .../manual-chunks/_expected/es/main.js | 16 - .../_expected/system/generated-deps2and3.js | 31 -- .../_expected/system/generated-lib1.js | 14 - .../manual-chunks/_expected/system/main.js | 25 -- .../samples/deprecated/manual-chunks/dep1.js | 3 - .../samples/deprecated/manual-chunks/dep2.js | 6 - .../samples/deprecated/manual-chunks/dep3.js | 8 - .../samples/deprecated/manual-chunks/lib1.js | 7 - .../samples/deprecated/manual-chunks/lib2.js | 3 - .../samples/deprecated/manual-chunks/main.js | 15 - .../_config.js | 10 - .../_expected/amd/dep1.js | 17 - .../_expected/amd/dep2.js | 14 - .../_expected/amd/main.js | 5 - .../_expected/cjs/dep1.js | 15 - .../_expected/cjs/dep2.js | 12 - .../_expected/cjs/main.js | 6 - .../_expected/es/dep1.js | 13 - .../_expected/es/dep2.js | 9 - .../_expected/es/main.js | 4 - .../_expected/system/dep1.js | 22 -- .../_expected/system/dep2.js | 18 - .../_expected/system/main.js | 17 - .../dep1.js | 9 - .../dep2.js | 7 - .../main.js | 4 - .../dynamic-import-default-mode/_config.js | 12 - .../_expected/amd/foo.js | 7 - .../_expected/amd/main.js | 7 - .../_expected/cjs/foo.js | 5 - .../_expected/cjs/main.js | 5 - .../_expected/es/foo.js | 3 - .../_expected/es/main.js | 1 - .../_expected/system/foo.js | 10 - .../_expected/system/main.js | 10 - .../dynamic-import-default-mode/foo.js | 1 - .../dynamic-import-default-mode/main.js | 1 - .../dynamic-import/_config.js | 10 - .../_expected/amd/generated-foo.js | 9 - .../dynamic-import/_expected/amd/main.js | 5 - .../_expected/cjs/generated-foo.js | 7 - .../dynamic-import/_expected/cjs/main.js | 3 - .../_expected/es/generated-foo.js | 3 - .../dynamic-import/_expected/es/main.js | 1 - .../_expected/system/generated-foo.js | 10 - .../dynamic-import/_expected/system/main.js | 10 - .../namespace-tostring/dynamic-import/foo.js | 1 - .../namespace-tostring/dynamic-import/main.js | 1 - .../_config.js | 9 - .../_expected/amd/default.js | 7 - .../_expected/amd/main.js | 12 - .../_expected/amd/named.js | 7 - .../_expected/cjs/default.js | 5 - .../_expected/cjs/main.js | 13 - .../_expected/cjs/named.js | 5 - .../_expected/es/default.js | 3 - .../_expected/es/main.js | 9 - .../_expected/es/named.js | 3 - .../_expected/system/default.js | 10 - .../_expected/system/main.js | 20 -- .../_expected/system/named.js | 10 - .../default.js | 1 - .../preserve-modules-auto-export-mode/main.js | 8 - .../named.js | 1 - .../preserve-modules-commonjs/_config.js | 13 - .../amd/_virtual/_commonjsHelpers.js | 9 - .../_expected/amd/_virtual/other.js | 7 - .../_expected/amd/commonjs.js | 14 - .../_expected/amd/main.js | 5 - .../_expected/amd/other.js | 7 - .../cjs/_virtual/_commonjsHelpers.js | 7 - .../_expected/cjs/_virtual/other.js | 5 - .../_expected/cjs/commonjs.js | 17 - .../_expected/cjs/main.js | 6 - .../_expected/cjs/other.js | 7 - .../_expected/es/_virtual/_commonjsHelpers.js | 5 - .../_expected/es/_virtual/other.js | 3 - .../_expected/es/commonjs.js | 15 - .../_expected/es/main.js | 4 - .../_expected/es/other.js | 5 - .../system/_virtual/_commonjsHelpers.js | 14 - .../_expected/system/_virtual/other.js | 10 - .../_expected/system/commonjs.js | 25 -- .../_expected/system/main.js | 16 - .../_expected/system/other.js | 15 - .../preserve-modules-commonjs/commonjs.js | 6 - .../preserve-modules-commonjs/main.js | 4 - .../preserve-modules-commonjs/other.js | 1 - .../_config.js | 9 - .../_expected/amd/dynamic-included.js | 7 - .../_expected/amd/main.js | 5 - .../_expected/cjs/dynamic-included.js | 5 - .../_expected/cjs/main.js | 3 - .../_expected/es/dynamic-included.js | 3 - .../_expected/es/main.js | 1 - .../_expected/system/dynamic-included.js | 10 - .../_expected/system/main.js | 10 - .../dynamic-included.js | 1 - .../dynamic-removed.js | 1 - .../preserve-modules-dynamic-imports/main.js | 6 - .../_config.js | 9 - .../_expected/amd/m1.js | 8 - .../_expected/amd/m2.js | 7 - .../_expected/amd/m3.js | 7 - .../_expected/amd/main.js | 5 - .../_expected/cjs/m1.js | 9 - .../_expected/cjs/m2.js | 5 - .../_expected/cjs/m3.js | 5 - .../_expected/cjs/main.js | 5 - .../_expected/es/m1.js | 2 - .../_expected/es/m2.js | 3 - .../_expected/es/m3.js | 3 - .../_expected/es/main.js | 3 - .../_expected/system/m1.js | 15 - .../_expected/system/m2.js | 10 - .../_expected/system/m3.js | 10 - .../_expected/system/main.js | 14 - .../preserve-modules-dynamic-namespace/m1.js | 5 - .../preserve-modules-dynamic-namespace/m2.js | 2 - .../preserve-modules-dynamic-namespace/m3.js | 2 - .../main.js | 3 - .../preserve-modules-empty/_config.js | 9 - .../_expected/amd/main.js | 5 - .../_expected/amd/two.js | 7 - .../_expected/cjs/main.js | 5 - .../_expected/cjs/two.js | 5 - .../_expected/es/main.js | 3 - .../_expected/es/two.js | 3 - .../_expected/system/main.js | 14 - .../_expected/system/two.js | 10 - .../deprecated/preserve-modules-empty/main.js | 3 - .../deprecated/preserve-modules-empty/one.js | 2 - .../preserve-modules-empty/three.js | 1 - .../deprecated/preserve-modules-empty/two.js | 1 - .../preserve-modules-export-alias/_config.js | 9 - .../_expected/amd/dep.js | 8 - .../_expected/amd/main1.js | 8 - .../_expected/amd/main2.js | 7 - .../_expected/cjs/dep.js | 6 - .../_expected/cjs/main1.js | 8 - .../_expected/cjs/main2.js | 7 - .../_expected/es/dep.js | 3 - .../_expected/es/main1.js | 1 - .../_expected/es/main2.js | 1 - .../_expected/system/dep.js | 10 - .../_expected/system/main1.js | 13 - .../_expected/system/main2.js | 13 - .../preserve-modules-export-alias/dep.js | 3 - .../preserve-modules-export-alias/main1.js | 1 - .../preserve-modules-export-alias/main2.js | 1 - .../_config.js | 12 - .../_expected/amd/foo-amd-0f9dc16c.js | 7 - .../_expected/amd/main-amd-f0570656.js | 10 - .../_expected/amd/nested/bar-amd-f038b10c.js | 7 - .../_expected/amd/nested/baz-amd-d3de4cc0.js | 7 - .../_expected/amd/no-ext-amd-9d2c6ef6.js | 7 - .../_expected/cjs/foo-cjs-0d5774b5.js | 5 - .../_expected/cjs/main-cjs-e39bf23f.js | 13 - .../_expected/cjs/nested/bar-cjs-abedc91d.js | 5 - .../_expected/cjs/nested/baz-cjs-4a9c02fc.js | 5 - .../_expected/cjs/no-ext-cjs-500f8f81.js | 5 - .../_expected/es/foo-es-3585f3eb.js | 3 - .../_expected/es/main-es-d43a43b5.js | 4 - .../_expected/es/nested/bar-es-bd5e2ae1.js | 3 - .../_expected/es/nested/baz-es-a913ab4d.js | 3 - .../_expected/es/no-ext-es-1f34b6e8.js | 3 - .../_expected/system/foo-system-0e2d8e48.js | 10 - .../_expected/system/main-system-5684b811.js | 19 -- .../system/nested/bar-system-a72f6c95.js | 10 - .../system/nested/baz-system-71d114fd.js | 10 - .../system/no-ext-system-0cf938a8.js | 10 - .../src/foo.ts | 1 - .../src/main.ts | 8 - .../src/nested/bar.ts | 1 - .../src/nested/baz.ts | 1 - .../src/no-ext | 1 - .../_config.js | 23 -- .../_expected/amd/_virtual/_One1.js | 7 - .../_expected/amd/_virtual/_One2.js | 7 - .../_expected/amd/_virtual/_one.js | 7 - .../_expected/amd/main.js | 5 - .../_expected/cjs/_virtual/_One1.js | 5 - .../_expected/cjs/_virtual/_One2.js | 5 - .../_expected/cjs/_virtual/_one.js | 5 - .../_expected/cjs/main.js | 7 - .../_expected/es/_virtual/_One1.js | 3 - .../_expected/es/_virtual/_One2.js | 3 - .../_expected/es/_virtual/_one.js | 3 - .../_expected/es/main.js | 5 - .../_expected/system/_virtual/_One1.js | 10 - .../_expected/system/_virtual/_One2.js | 10 - .../_expected/system/_virtual/_one.js | 10 - .../_expected/system/main.js | 18 - .../main.js | 5 - .../_config.js | 12 - .../_expected/amd/default.js | 9 - .../_expected/amd/main.js | 12 - .../_expected/amd/named.js | 7 - .../_expected/cjs/default.js | 7 - .../_expected/cjs/main.js | 13 - .../_expected/cjs/named.js | 5 - .../_expected/es/default.js | 3 - .../_expected/es/main.js | 9 - .../_expected/es/named.js | 3 - .../_expected/system/default.js | 10 - .../_expected/system/main.js | 20 -- .../_expected/system/named.js | 10 - .../default.js | 1 - .../main.js | 8 - .../named.js | 1 - .../_config.js | 9 - .../_expected/amd/main.js | 8 - .../_expected/amd/module-a/v1/index.js | 7 - .../_expected/amd/module-b/v1/index.js | 7 - .../_expected/cjs/main.js | 9 - .../_expected/cjs/module-a/v1/index.js | 5 - .../_expected/cjs/module-b/v1/index.js | 5 - .../_expected/es/main.js | 4 - .../_expected/es/module-a/v1/index.js | 3 - .../_expected/es/module-b/v1/index.js | 3 - .../_expected/system/main.js | 15 - .../_expected/system/module-a/v1/index.js | 10 - .../_expected/system/module-b/v1/index.js | 10 - .../main.js | 2 - .../module-a/index.js | 3 - .../module-a/v1/index.js | 1 - .../module-b/index.js | 3 - .../module-b/v1/index.js | 1 - .../preserve-modules-nested-export/_config.js | 9 - .../amd/inner/more_inner/something.js | 7 - .../_expected/amd/inner/some_effect.js | 5 - .../_expected/amd/main.js | 7 - .../cjs/inner/more_inner/something.js | 5 - .../_expected/cjs/inner/some_effect.js | 3 - .../_expected/cjs/main.js | 8 - .../es/inner/more_inner/something.js | 3 - .../_expected/es/inner/some_effect.js | 1 - .../_expected/es/main.js | 2 - .../system/inner/more_inner/something.js | 10 - .../_expected/system/inner/some_effect.js | 10 - .../_expected/system/main.js | 13 - .../inner/index.js | 2 - .../inner/more_inner/index.js | 1 - .../inner/more_inner/something.js | 1 - .../inner/some_effect.js | 1 - .../preserve-modules-nested-export/main.js | 1 - .../_config.js | 9 - .../_expected/amd/dep2.js | 7 - .../_expected/amd/main.js | 7 - .../_expected/cjs/dep2.js | 5 - .../_expected/cjs/main.js | 7 - .../_expected/es/dep2.js | 3 - .../_expected/es/main.js | 5 - .../_expected/system/dep2.js | 12 - .../_expected/system/main.js | 15 - .../dep1.js | 1 - .../dep2.js | 1 - .../main.js | 3 - .../preserve-modules-proxy-import/_config.js | 10 - .../_expected/amd/main.js | 6 - .../_expected/amd/proxy.js | 7 - .../_expected/cjs/main.js | 6 - .../_expected/cjs/proxy.js | 7 - .../_expected/es/main.js | 4 - .../_expected/es/proxy.js | 2 - .../_expected/system/main.js | 15 - .../_expected/system/proxy.js | 15 - .../preserve-modules-proxy-import/main.js | 5 - .../preserve-modules-proxy-import/proxy.js | 2 - .../_config.js | 9 - .../_expected/amd/dep.js | 9 - .../_expected/amd/lib/main.js | 11 - .../_expected/cjs/dep.js | 7 - .../_expected/cjs/lib/main.js | 11 - .../_expected/es/dep.js | 5 - .../_expected/es/lib/main.js | 9 - .../_expected/system/dep.js | 14 - .../_expected/system/lib/main.js | 18 - .../src/dep.js | 3 - .../src/lib/main.js | 7 - .../_config.js | 32 -- .../_expected/amd/answer.num.js | 7 - .../_expected/amd/lorem.str.js | 7 - .../_expected/amd/main.js | 9 - .../_expected/amd/no-ext.js | 7 - .../_expected/cjs/answer.num.js | 5 - .../_expected/cjs/lorem.str.js | 5 - .../_expected/cjs/main.js | 11 - .../_expected/cjs/no-ext.js | 5 - .../_expected/es/answer.num.js | 3 - .../_expected/es/lorem.str.js | 3 - .../_expected/es/main.js | 3 - .../_expected/es/no-ext.js | 3 - .../_expected/system/answer.num.js | 10 - .../_expected/system/lorem.str.js | 10 - .../_expected/system/main.js | 17 - .../_expected/system/no-ext.js | 10 - .../src/answer.num | 1 - .../src/lorem.str | 1 - .../src/main.js | 3 - .../src/no-ext | 1 - .../preserve-modules-single-entry/_config.js | 9 - .../_expected/amd/main.js | 5 - .../_expected/cjs/main.js | 3 - .../_expected/es/main.js | 1 - .../_expected/system/main.js | 10 - .../preserve-modules-single-entry/main.js | 1 - .../_config.js | 24 -- .../_expected/amd/_virtual/_virtualModule.js | 7 - .../_expected/amd/main.js | 5 - .../_expected/cjs/_virtual/_virtualModule.js | 5 - .../_expected/cjs/main.js | 5 - .../_expected/es/_virtual/_virtualModule.js | 3 - .../_expected/es/main.js | 3 - .../system/_virtual/_virtualModule.js | 10 - .../_expected/system/main.js | 14 - .../preserve-modules-virtual-modules/main.js | 1 - .../deprecated/preserve-modules/_config.js | 9 - .../_expected/amd/deps/dep1.js | 9 - .../_expected/amd/deps/dep2.js | 10 - .../_expected/amd/deps/dep3.js | 10 - .../_expected/amd/lib/lib1.js | 9 - .../_expected/amd/lib/lib2.js | 9 - .../preserve-modules/_expected/amd/main1.js | 12 - .../preserve-modules/_expected/amd/main2.js | 12 - .../_expected/cjs/deps/dep1.js | 7 - .../_expected/cjs/deps/dep2.js | 10 - .../_expected/cjs/deps/dep3.js | 10 - .../_expected/cjs/lib/lib1.js | 7 - .../_expected/cjs/lib/lib2.js | 7 - .../preserve-modules/_expected/cjs/main1.js | 13 - .../preserve-modules/_expected/cjs/main2.js | 13 - .../_expected/es/deps/dep1.js | 5 - .../_expected/es/deps/dep2.js | 8 - .../_expected/es/deps/dep3.js | 8 - .../preserve-modules/_expected/es/lib/lib1.js | 5 - .../preserve-modules/_expected/es/lib/lib2.js | 5 - .../preserve-modules/_expected/es/main1.js | 11 - .../preserve-modules/_expected/es/main2.js | 11 - .../_expected/system/deps/dep1.js | 14 - .../_expected/system/deps/dep2.js | 19 -- .../_expected/system/deps/dep3.js | 19 -- .../_expected/system/lib/lib1.js | 14 - .../_expected/system/lib/lib2.js | 14 - .../_expected/system/main1.js | 21 -- .../_expected/system/main2.js | 21 -- .../deprecated/preserve-modules/deps/dep1.js | 3 - .../deprecated/preserve-modules/deps/dep2.js | 6 - .../deprecated/preserve-modules/deps/dep3.js | 8 - .../deprecated/preserve-modules/lib/lib1.js | 7 - .../deprecated/preserve-modules/lib/lib2.js | 3 - .../deprecated/preserve-modules/main1.js | 9 - .../deprecated/preserve-modules/main2.js | 13 - .../rollup.config.js | 4 +- .../warn-unknown-options/rollup.config.js | 4 +- .../dynamic-import-inlining-array/_config.js | 9 - .../_expected.js | 8 - .../dynamic-import-inlining-array/foo.js | 1 - .../dynamic-import-inlining-array/main.js | 2 - .../dynamic-import-inlining/_config.js | 8 - .../dynamic-import-inlining/_expected.js | 8 - .../deprecated/dynamic-import-inlining/foo.js | 1 - .../dynamic-import-inlining/main.js | 2 - .../_config.js | 8 - .../_expected/amd.js | 5 - .../_expected/cjs.js | 3 - .../_expected/es.js | 1 - .../_expected/iife.js | 6 - .../_expected/system.js | 10 - .../_expected/umd.js | 8 - .../dynamic.js | 2 - .../inlined-treeshaken-dynamic-import/main.js | 2 - .../entry-default/_config.js | 12 - .../entry-default/_expected/amd.js | 7 - .../entry-default/_expected/cjs.js | 5 - .../entry-default/_expected/es.js | 3 - .../entry-default/_expected/iife.js | 8 - .../entry-default/_expected/system.js | 10 - .../entry-default/_expected/umd.js | 11 - .../namespace-tostring/entry-default/main.js | 1 - .../namespace-tostring/entry-named/_config.js | 12 - .../entry-named/_expected/amd.js | 9 - .../entry-named/_expected/cjs.js | 7 - .../entry-named/_expected/es.js | 3 - .../entry-named/_expected/iife.js | 12 - .../entry-named/_expected/system.js | 10 - .../entry-named/_expected/umd.js | 13 - .../namespace-tostring/entry-named/main.js | 1 - .../external-namespaces/_config.js | 34 -- .../external-namespaces/_expected/amd.js | 40 --- .../external-namespaces/_expected/cjs.js | 42 --- .../external-namespaces/_expected/es.js | 15 - .../external-namespaces/_expected/iife.js | 41 --- .../external-namespaces/_expected/system.js | 28 -- .../external-namespaces/_expected/umd.js | 44 --- .../external-namespaces/main.js | 15 - .../inlined-namespace/_config.js | 10 - .../inlined-namespace/_expected/amd.js | 14 - .../inlined-namespace/_expected/cjs.js | 12 - .../inlined-namespace/_expected/es.js | 10 - .../inlined-namespace/_expected/iife.js | 15 - .../inlined-namespace/_expected/system.js | 19 -- .../inlined-namespace/_expected/umd.js | 17 - .../inlined-namespace/foo.js | 1 - .../inlined-namespace/main.js | 5 - .../nested-inlined-dynamic-import/_config.js | 8 - .../_expected/amd.js | 18 - .../_expected/cjs.js | 16 - .../_expected/es.js | 14 - .../_expected/iife.js | 19 -- .../_expected/system.js | 23 -- .../_expected/umd.js | 21 -- .../nested-inlined-dynamic-import/foo.js | 1 - .../nested-inlined-dynamic-import/main.js | 7 - .../deprecated/prefer-const/_config.js | 13 - .../deprecated/prefer-const/_expected/amd.js | 19 -- .../deprecated/prefer-const/_expected/cjs.js | 19 -- .../deprecated/prefer-const/_expected/es.js | 17 - .../deprecated/prefer-const/_expected/iife.js | 20 -- .../prefer-const/_expected/system.js | 26 -- .../deprecated/prefer-const/_expected/umd.js | 23 -- .../samples/deprecated/prefer-const/main.js | 7 - .../deprecated/prefer-const/namespace.js | 2 - .../samples/deprecated/compact/_config.js | 32 -- .../samples/deprecated/compact/main.js | 12 - .../dynamic-import-duplicates/_config.js | 23 -- .../dynamic-import-duplicates/foo.js | 1 - .../dynamic-import-duplicates/main.js | 5 - .../dynamic-import-inlining/_config.js | 23 -- .../deprecated/dynamic-import-inlining/foo.js | 1 - .../dynamic-import-inlining/main.js | 5 - .../dynamic-import-name-warn/_config.js | 46 --- .../dynamic-import-name-warn/main.js | 1 - .../deprecated/dynamic-import-name/_config.js | 38 --- .../deprecated/dynamic-import-name/main.js | 1 - .../inline-dynamic-imports-bundle/_config.js | 28 -- .../inline-dynamic-imports-bundle/lib.js | 1 - .../inline-dynamic-imports-bundle/main.js | 1 - .../reexporter.js | 1 - .../inline-imports-with-manual/_config.js | 18 - .../inline-imports-with-manual/lib.js | 1 - .../inline-imports-with-manual/main.js | 1 - .../_config.js | 15 - .../inline-imports-with-multiple-array/lib.js | 1 - .../main.js | 1 - .../_config.js | 21 -- .../lib.js | 1 - .../main.js | 1 - .../manual-chunks-conflict/_config.js | 18 - .../deprecated/manual-chunks-conflict/dep.js | 1 - .../deprecated/manual-chunks-conflict/main.js | 1 - .../deprecated/manual-chunks-info/_config.js | 315 ------------------ .../deprecated/manual-chunks-info/dynamic.js | 2 - .../deprecated/manual-chunks-info/lib.js | 1 - .../deprecated/manual-chunks-info/main.js | 3 - .../manual-chunks-preserve-modules/_config.js | 18 - .../manual-chunks-preserve-modules/lib.js | 1 - .../manual-chunks-preserve-modules/main.js | 3 - .../max-parallel-file-reads/infinity/1.js | 1 - .../max-parallel-file-reads/infinity/2.js | 1 - .../max-parallel-file-reads/infinity/3.js | 1 - .../max-parallel-file-reads/infinity/4.js | 1 - .../max-parallel-file-reads/infinity/5.js | 1 - .../infinity/_config.js | 37 -- .../max-parallel-file-reads/infinity/main.js | 5 - .../max-parallel-file-reads/set/1.js | 1 - .../max-parallel-file-reads/set/2.js | 1 - .../max-parallel-file-reads/set/3.js | 1 - .../max-parallel-file-reads/set/4.js | 1 - .../max-parallel-file-reads/set/5.js | 1 - .../max-parallel-file-reads/set/_config.js | 37 -- .../max-parallel-file-reads/set/main.js | 5 - .../max-parallel-file-reads/with-plugin/1.js | 1 - .../max-parallel-file-reads/with-plugin/2.js | 1 - .../max-parallel-file-reads/with-plugin/3.js | 1 - .../max-parallel-file-reads/with-plugin/4.js | 1 - .../max-parallel-file-reads/with-plugin/5.js | 1 - .../with-plugin/_config.js | 44 --- .../with-plugin/main.js | 5 - .../name-conflict-symbol/_config.js | 23 -- .../deprecated/name-conflict-symbol/main.js | 1 - .../dynamic-import-default-mode/_config.js | 27 -- .../dynamic-import-default-mode/foo.js | 1 - .../dynamic-import-default-mode/main.js | 1 - .../dynamic-import/_config.js | 30 -- .../namespace-tostring/dynamic-import/foo.js | 1 - .../namespace-tostring/dynamic-import/main.js | 1 - .../entry-default/_config.js | 25 -- .../namespace-tostring/entry-default/main.js | 1 - .../namespace-tostring/entry-named/_config.js | 30 -- .../namespace-tostring/entry-named/main.js | 1 - .../external-namespaces/_config.js | 41 --- .../external-namespaces/main.js | 15 - .../inlined-namespace/_config.js | 17 - .../inlined-namespace/foo.js | 1 - .../inlined-namespace/main.js | 5 - .../interop-property-descriptor/_config.js | 28 -- .../interop-property-descriptor/dep.js | 2 - .../interop-property-descriptor/main.js | 25 -- .../property-descriptor/_config.js | 17 - .../property-descriptor/foo.js | 1 - .../property-descriptor/main.js | 22 -- .../_config.js | 21 -- .../nested-inlined-dynamic-import-1/foo.js | 1 - .../nested-inlined-dynamic-import-1/main.js | 4 - .../deprecated/plugin-module-ids/_config.js | 36 -- .../deprecated/plugin-module-ids/foo.js | 3 - .../deprecated/plugin-module-ids/main.js | 2 - .../inline-dynamic-imports/_config.js | 15 - .../inline-dynamic-imports/lib.js | 1 - .../inline-dynamic-imports/main.js | 1 - .../invalid-default-export-mode/_config.js | 17 - .../invalid-default-export-mode/lib.js | 1 - .../invalid-default-export-mode/main.js | 3 - .../_config.js | 15 - .../main.js | 1 - .../invalid-none-export-mode/_config.js | 17 - .../invalid-none-export-mode/lib.js | 1 - .../invalid-none-export-mode/main.js | 3 - .../preserveModules/manual-chunks/_config.js | 19 -- .../preserveModules/manual-chunks/lib.js | 1 - .../preserveModules/manual-chunks/main.js | 3 - .../preserveModules/mixed-exports/_config.js | 34 -- .../preserveModules/mixed-exports/lib1.js | 2 - .../preserveModules/mixed-exports/lib2.js | 1 - .../preserveModules/mixed-exports/lib3.js | 1 - .../preserveModules/mixed-exports/main.js | 11 - .../virtual-modules-conflict/_config.js | 41 --- .../_virtual/_virtualModule.js | 3 - .../virtual-modules-conflict/main.js | 4 - .../virtual-modules/_config.js | 41 --- .../virtual-modules/lib/lib.js | 1 - .../preserveModules/virtual-modules/main.js | 3 - .../samples/deprecated/reexport-ns/_config.js | 25 -- .../samples/deprecated/reexport-ns/main.js | 3 - .../samples/deprecated/reexport-ns/maths.js | 1 - .../samples/deprecated/reexport-ns/square.js | 2 - .../deprecated/resolve-id-external/_config.js | 89 ----- .../deprecated/resolve-id-external/main.js | 25 -- .../samples/deprecated/resolve-id/_config.js | 96 ------ .../samples/deprecated/resolve-id/main.js | 25 -- .../dynamicImportFunction/_config.js | 14 - .../dynamicImportFunction/main.js | 1 - .../_config.js | 14 - .../main.js | 1 - .../hasModuleSideEffects/_config.js | 27 -- .../deprecations/hasModuleSideEffects/main.js | 1 - .../inlineDynamicImports/_config.js | 12 - .../deprecations/inlineDynamicImports/main.js | 1 - .../deprecations/manualChunks/_config.js | 14 - .../samples/deprecations/manualChunks/main.js | 1 - .../maxParallelFileReads/_config.js | 12 - .../deprecations/maxParallelFileReads/main.js | 1 - .../namespaceToStringTag/_config.js | 14 - .../deprecations/namespaceToStringTag/main.js | 1 - .../deprecations/plugin-module-ids/_config.js | 23 -- .../deprecations/plugin-module-ids/foo.js | 3 - .../deprecations/plugin-module-ids/main.js | 1 - .../deprecations/prefer-const/_config.js | 14 - .../samples/deprecations/prefer-const/main.js | 1 - .../deprecations/preserveModules/_config.js | 12 - .../deprecations/preserveModules/main.js | 1 - test/function/samples/options-hook/_config.js | 1 - .../samples/output-options-hook/_config.js | 3 - test/misc/optionList.js | 6 +- 844 files changed, 80 insertions(+), 7869 deletions(-) delete mode 100644 test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_config.js delete mode 100644 test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/amd/a.js delete mode 100644 test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/amd/b.js delete mode 100644 test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/amd/one.js delete mode 100644 test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/cjs/a.js delete mode 100644 test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/cjs/b.js delete mode 100644 test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/cjs/one.js delete mode 100644 test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/es/a.js delete mode 100644 test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/es/b.js delete mode 100644 test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/es/one.js delete mode 100644 test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/system/a.js delete mode 100644 test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/system/b.js delete mode 100644 test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/system/one.js delete mode 100644 test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/a.js delete mode 100644 test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/b.js delete mode 100644 test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/c.js delete mode 100644 test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/index.js delete mode 100644 test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/main.js delete mode 100644 test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/one.js delete mode 100644 test/chunking-form/samples/deprecated/circular-manual-chunks/_config.js delete mode 100644 test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/amd/generated-lib1.js delete mode 100644 test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/amd/generated-lib2.js delete mode 100644 test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/cjs/generated-lib1.js delete mode 100644 test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/cjs/generated-lib2.js delete mode 100644 test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/es/generated-lib1.js delete mode 100644 test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/es/generated-lib2.js delete mode 100644 test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/system/generated-lib1.js delete mode 100644 test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/system/generated-lib2.js delete mode 100644 test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/circular-manual-chunks/lib1.js delete mode 100644 test/chunking-form/samples/deprecated/circular-manual-chunks/lib2.js delete mode 100644 test/chunking-form/samples/deprecated/circular-manual-chunks/main.js delete mode 100644 test/chunking-form/samples/deprecated/dynamic-import-comments/_config.js delete mode 100644 test/chunking-form/samples/deprecated/dynamic-import-comments/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/dynamic-import-comments/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/dynamic-import-comments/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/dynamic-import-comments/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/dynamic-import-comments/main.js delete mode 100644 test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_config.js delete mode 100644 test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_expected/amd/entry.js delete mode 100644 test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_expected/cjs/entry.js delete mode 100644 test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_expected/es/entry.js delete mode 100644 test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_expected/system/entry.js delete mode 100644 test/chunking-form/samples/deprecated/dynamic-import-inlining-object/foo.js delete mode 100644 test/chunking-form/samples/deprecated/dynamic-import-inlining-object/main.js delete mode 100644 test/chunking-form/samples/deprecated/dynamic-import-name/_config.js delete mode 100644 test/chunking-form/samples/deprecated/dynamic-import-name/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/dynamic-import-name/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/dynamic-import-name/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/dynamic-import-name/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/dynamic-import-name/main.js delete mode 100644 test/chunking-form/samples/deprecated/emit-file-chunk-facade/_config.js delete mode 100644 test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/amd/generated-build-starter.js delete mode 100644 test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/amd/generated-buildStart.js delete mode 100644 test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/cjs/generated-build-starter.js delete mode 100644 test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/cjs/generated-buildStart.js delete mode 100644 test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/es/generated-build-starter.js delete mode 100644 test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/es/generated-buildStart.js delete mode 100644 test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/system/generated-build-starter.js delete mode 100644 test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/system/generated-buildStart.js delete mode 100644 test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/emit-file-chunk-facade/buildStart.js delete mode 100644 test/chunking-form/samples/deprecated/emit-file-chunk-facade/dep.js delete mode 100644 test/chunking-form/samples/deprecated/emit-file-chunk-facade/main.js delete mode 100644 test/chunking-form/samples/deprecated/empty-module-no-treeshake/_config.js delete mode 100644 test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/amd/generated-emptyTransformed.js delete mode 100644 test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/amd/main1.js delete mode 100644 test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/amd/main2.js delete mode 100644 test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/cjs/generated-emptyTransformed.js delete mode 100644 test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/cjs/main1.js delete mode 100644 test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/cjs/main2.js delete mode 100644 test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/es/generated-emptyTransformed.js delete mode 100644 test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/es/main1.js delete mode 100644 test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/es/main2.js delete mode 100644 test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/system/generated-emptyTransformed.js delete mode 100644 test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/system/main1.js delete mode 100644 test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/system/main2.js delete mode 100644 test/chunking-form/samples/deprecated/empty-module-no-treeshake/main1.js delete mode 100644 test/chunking-form/samples/deprecated/empty-module-no-treeshake/main2.js delete mode 100644 test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_config.js delete mode 100644 test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/amd/components/index.js delete mode 100644 test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/amd/components/sub/index.js delete mode 100644 test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/cjs/components/index.js delete mode 100644 test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/cjs/components/sub/index.js delete mode 100644 test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/es/components/index.js delete mode 100644 test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/es/components/sub/index.js delete mode 100644 test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/system/components/index.js delete mode 100644 test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/system/components/sub/index.js delete mode 100644 test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/components/index.js delete mode 100644 test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/components/sub/index.js delete mode 100644 test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_config.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/amd/main1.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/amd/main2.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/cjs/main1.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/cjs/main2.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/es/main1.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/es/main2.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/system/main1.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/system/main2.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/dep.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/main1.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/main2.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_config.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/amd/main2.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/cjs/main2.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/es/main2.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/system/main2.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/dep.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/main2.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/outer.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_config.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/dep.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/outer.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_config.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/amd/main2.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/cjs/main2.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/es/main2.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/system/main2.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/dep.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/main2.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_config.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/dep.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-different-nested/_config.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amd/generated-manual-inner.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amd/generated-manual-middle.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amd/generated-manual-outer.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs/generated-manual-inner.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs/generated-manual-middle.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs/generated-manual-outer.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/es/generated-manual-inner.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/es/generated-manual-middle.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/es/generated-manual-outer.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/system/generated-manual-inner.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/system/generated-manual-middle.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/system/generated-manual-outer.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-different-nested/inner.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-different-nested/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-different-nested/middle.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-different-nested/outer.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_config.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/amd/generated-dynamic.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/cjs/generated-dynamic.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/es/generated-dynamic.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/system/generated-dynamic.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/dep.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/dynamic1.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/dynamic2.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/dynamic3.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_config.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/amd/generated-dynamic.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/cjs/generated-dynamic.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/es/generated-dynamic.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/system/generated-dynamic.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/dynamic1.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/dynamic2.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic/_config.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/amd/generated-dynamic.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/cjs/generated-dynamic.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/es/generated-dynamic.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/system/generated-dynamic.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic/dynamic.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-dynamic/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-function/_config.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-function/_expected/amd/generated-chunk-b.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-function/_expected/amd/generated-chunk-c.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-function/_expected/amd/main-a.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-function/_expected/cjs/generated-chunk-b.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-function/_expected/cjs/generated-chunk-c.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-function/_expected/cjs/main-a.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-function/_expected/es/generated-chunk-b.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-function/_expected/es/generated-chunk-c.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-function/_expected/es/main-a.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-function/_expected/system/generated-chunk-b.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-function/_expected/system/generated-chunk-c.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-function/_expected/system/main-a.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-function/dep-a.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-function/dep-b.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-function/dep-c.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-function/dep1.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-function/dep2.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-function/main-a.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-nested/_config.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/amd/generated-manual.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/cjs/generated-manual.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/es/generated-manual.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/system/generated-manual.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-nested/inner.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-nested/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-nested/middle.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks-nested/outer.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks/_config.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks/_expected/amd/generated-deps2and3.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks/_expected/amd/generated-lib1.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks/_expected/cjs/generated-deps2and3.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks/_expected/cjs/generated-lib1.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks/_expected/es/generated-deps2and3.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks/_expected/es/generated-lib1.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks/_expected/system/generated-deps2and3.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks/_expected/system/generated-lib1.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks/dep1.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks/dep2.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks/dep3.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks/lib1.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks/lib2.js delete mode 100644 test/chunking-form/samples/deprecated/manual-chunks/main.js delete mode 100644 test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_config.js delete mode 100644 test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/amd/dep1.js delete mode 100644 test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/amd/dep2.js delete mode 100644 test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/cjs/dep1.js delete mode 100644 test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/cjs/dep2.js delete mode 100644 test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/es/dep1.js delete mode 100644 test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/es/dep2.js delete mode 100644 test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/system/dep1.js delete mode 100644 test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/system/dep2.js delete mode 100644 test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/dep1.js delete mode 100644 test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/dep2.js delete mode 100644 test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/main.js delete mode 100644 test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_config.js delete mode 100644 test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/amd/foo.js delete mode 100644 test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/cjs/foo.js delete mode 100644 test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/es/foo.js delete mode 100644 test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/system/foo.js delete mode 100644 test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/foo.js delete mode 100644 test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/main.js delete mode 100644 test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_config.js delete mode 100644 test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/amd/generated-foo.js delete mode 100644 test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/cjs/generated-foo.js delete mode 100644 test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/es/generated-foo.js delete mode 100644 test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/system/generated-foo.js delete mode 100644 test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/foo.js delete mode 100644 test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_config.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/amd/default.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/amd/named.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/cjs/default.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/cjs/named.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/es/default.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/es/named.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/system/default.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/system/named.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/default.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/named.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-commonjs/_config.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/_virtual/_commonjsHelpers.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/_virtual/other.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/commonjs.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/other.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/_virtual/_commonjsHelpers.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/_virtual/other.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/commonjs.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/other.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/_virtual/_commonjsHelpers.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/_virtual/other.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/commonjs.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/other.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/_virtual/_commonjsHelpers.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/_virtual/other.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/commonjs.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/other.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-commonjs/commonjs.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-commonjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-commonjs/other.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_config.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/amd/dynamic-included.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/cjs/dynamic-included.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/es/dynamic-included.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/system/dynamic-included.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/dynamic-included.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/dynamic-removed.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_config.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/amd/m1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/amd/m2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/amd/m3.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/cjs/m1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/cjs/m2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/cjs/m3.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/es/m1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/es/m2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/es/m3.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/system/m1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/system/m2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/system/m3.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/m1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/m2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/m3.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-empty/_config.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/amd/two.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/cjs/two.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/es/two.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/system/two.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-empty/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-empty/one.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-empty/three.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-empty/two.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-export-alias/_config.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/amd/dep.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/amd/main1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/amd/main2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/cjs/dep.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/cjs/main1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/cjs/main2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/es/dep.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/es/main1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/es/main2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/system/dep.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/system/main1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/system/main2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-export-alias/dep.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-export-alias/main1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-export-alias/main2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_config.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/foo-amd-0f9dc16c.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/main-amd-f0570656.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/nested/bar-amd-f038b10c.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/nested/baz-amd-d3de4cc0.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/no-ext-amd-9d2c6ef6.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/foo-cjs-0d5774b5.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/main-cjs-e39bf23f.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/nested/bar-cjs-abedc91d.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/nested/baz-cjs-4a9c02fc.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/no-ext-cjs-500f8f81.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/foo-es-3585f3eb.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/main-es-d43a43b5.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/nested/bar-es-bd5e2ae1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/nested/baz-es-a913ab4d.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/no-ext-es-1f34b6e8.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/system/foo-system-0e2d8e48.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/system/main-system-5684b811.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/system/nested/bar-system-a72f6c95.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/system/nested/baz-system-71d114fd.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/system/no-ext-system-0cf938a8.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/foo.ts delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/main.ts delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/nested/bar.ts delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/nested/baz.ts delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/no-ext delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_config.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/amd/_virtual/_One1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/amd/_virtual/_One2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/amd/_virtual/_one.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/cjs/_virtual/_One1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/cjs/_virtual/_One2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/cjs/_virtual/_one.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es/_virtual/_One1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es/_virtual/_One2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es/_virtual/_one.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/system/_virtual/_One1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/system/_virtual/_One2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/system/_virtual/_one.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_config.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/amd/default.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/amd/named.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/cjs/default.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/cjs/named.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/es/default.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/es/named.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/system/default.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/system/named.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/default.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/named.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_config.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/amd/module-a/v1/index.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/amd/module-b/v1/index.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjs/module-a/v1/index.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjs/module-b/v1/index.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/es/module-a/v1/index.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/es/module-b/v1/index.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/system/module-a/v1/index.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/system/module-b/v1/index.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-a/index.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-a/v1/index.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-b/index.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-b/v1/index.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-export/_config.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/amd/inner/more_inner/something.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/amd/inner/some_effect.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/cjs/inner/more_inner/something.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/cjs/inner/some_effect.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/es/inner/more_inner/something.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/es/inner/some_effect.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/system/inner/more_inner/something.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/system/inner/some_effect.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/index.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/more_inner/index.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/more_inner/something.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/some_effect.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-nested-export/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_config.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/amd/dep2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/cjs/dep2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/es/dep2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/system/dep2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/dep1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/dep2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_config.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/amd/proxy.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/cjs/proxy.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/es/proxy.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/system/proxy.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-proxy-import/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-proxy-import/proxy.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_config.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/amd/dep.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/amd/lib/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/cjs/dep.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/cjs/lib/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/es/dep.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/es/lib/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/system/dep.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/system/lib/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/src/dep.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/src/lib/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_config.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/amd/answer.num.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/amd/lorem.str.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/amd/no-ext.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/cjs/answer.num.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/cjs/lorem.str.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/cjs/no-ext.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/es/answer.num.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/es/lorem.str.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/es/no-ext.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/system/answer.num.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/system/lorem.str.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/system/no-ext.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/src/answer.num delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/src/lorem.str delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/src/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/src/no-ext delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-single-entry/_config.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-single-entry/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_config.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/amd/_virtual/_virtualModule.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/amd/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/cjs/_virtual/_virtualModule.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/cjs/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/es/_virtual/_virtualModule.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/es/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/system/_virtual/_virtualModule.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/system/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/main.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_config.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/deps/dep1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/deps/dep2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/deps/dep3.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/lib/lib1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/lib/lib2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/main1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/main2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/deps/dep1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/deps/dep2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/deps/dep3.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/lib/lib1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/lib/lib2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/main1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/main2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/es/deps/dep1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/es/deps/dep2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/es/deps/dep3.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/es/lib/lib1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/es/lib/lib2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/es/main1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/es/main2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/system/deps/dep1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/system/deps/dep2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/system/deps/dep3.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/system/lib/lib1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/system/lib/lib2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/system/main1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/_expected/system/main2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/deps/dep1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/deps/dep2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/deps/dep3.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/lib/lib1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/lib/lib2.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/main1.js delete mode 100644 test/chunking-form/samples/deprecated/preserve-modules/main2.js delete mode 100644 test/form/samples/deprecated/dynamic-import-inlining-array/_config.js delete mode 100644 test/form/samples/deprecated/dynamic-import-inlining-array/_expected.js delete mode 100644 test/form/samples/deprecated/dynamic-import-inlining-array/foo.js delete mode 100644 test/form/samples/deprecated/dynamic-import-inlining-array/main.js delete mode 100644 test/form/samples/deprecated/dynamic-import-inlining/_config.js delete mode 100644 test/form/samples/deprecated/dynamic-import-inlining/_expected.js delete mode 100644 test/form/samples/deprecated/dynamic-import-inlining/foo.js delete mode 100644 test/form/samples/deprecated/dynamic-import-inlining/main.js delete mode 100644 test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_config.js delete mode 100644 test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/amd.js delete mode 100644 test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/cjs.js delete mode 100644 test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/es.js delete mode 100644 test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/iife.js delete mode 100644 test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/system.js delete mode 100644 test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/umd.js delete mode 100644 test/form/samples/deprecated/inlined-treeshaken-dynamic-import/dynamic.js delete mode 100644 test/form/samples/deprecated/inlined-treeshaken-dynamic-import/main.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/entry-default/_config.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/entry-default/_expected/amd.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/entry-default/_expected/cjs.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/entry-default/_expected/es.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/entry-default/_expected/iife.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/entry-default/_expected/system.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/entry-default/_expected/umd.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/entry-default/main.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/entry-named/_config.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/entry-named/_expected/amd.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/entry-named/_expected/cjs.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/entry-named/_expected/es.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/entry-named/_expected/iife.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/entry-named/_expected/system.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/entry-named/_expected/umd.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/entry-named/main.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/external-namespaces/_config.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/amd.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/cjs.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/es.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/iife.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/system.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/umd.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/external-namespaces/main.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/inlined-namespace/_config.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/amd.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/cjs.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/es.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/iife.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/system.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/umd.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/inlined-namespace/foo.js delete mode 100644 test/form/samples/deprecated/namespace-tostring/inlined-namespace/main.js delete mode 100644 test/form/samples/deprecated/nested-inlined-dynamic-import/_config.js delete mode 100644 test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/amd.js delete mode 100644 test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/cjs.js delete mode 100644 test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/es.js delete mode 100644 test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/iife.js delete mode 100644 test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/system.js delete mode 100644 test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/umd.js delete mode 100644 test/form/samples/deprecated/nested-inlined-dynamic-import/foo.js delete mode 100644 test/form/samples/deprecated/nested-inlined-dynamic-import/main.js delete mode 100644 test/form/samples/deprecated/prefer-const/_config.js delete mode 100644 test/form/samples/deprecated/prefer-const/_expected/amd.js delete mode 100644 test/form/samples/deprecated/prefer-const/_expected/cjs.js delete mode 100644 test/form/samples/deprecated/prefer-const/_expected/es.js delete mode 100644 test/form/samples/deprecated/prefer-const/_expected/iife.js delete mode 100644 test/form/samples/deprecated/prefer-const/_expected/system.js delete mode 100644 test/form/samples/deprecated/prefer-const/_expected/umd.js delete mode 100644 test/form/samples/deprecated/prefer-const/main.js delete mode 100644 test/form/samples/deprecated/prefer-const/namespace.js delete mode 100644 test/function/samples/deprecated/compact/_config.js delete mode 100644 test/function/samples/deprecated/compact/main.js delete mode 100644 test/function/samples/deprecated/dynamic-import-duplicates/_config.js delete mode 100644 test/function/samples/deprecated/dynamic-import-duplicates/foo.js delete mode 100644 test/function/samples/deprecated/dynamic-import-duplicates/main.js delete mode 100644 test/function/samples/deprecated/dynamic-import-inlining/_config.js delete mode 100644 test/function/samples/deprecated/dynamic-import-inlining/foo.js delete mode 100644 test/function/samples/deprecated/dynamic-import-inlining/main.js delete mode 100644 test/function/samples/deprecated/dynamic-import-name-warn/_config.js delete mode 100644 test/function/samples/deprecated/dynamic-import-name-warn/main.js delete mode 100644 test/function/samples/deprecated/dynamic-import-name/_config.js delete mode 100644 test/function/samples/deprecated/dynamic-import-name/main.js delete mode 100644 test/function/samples/deprecated/inline-dynamic-imports-bundle/_config.js delete mode 100644 test/function/samples/deprecated/inline-dynamic-imports-bundle/lib.js delete mode 100644 test/function/samples/deprecated/inline-dynamic-imports-bundle/main.js delete mode 100644 test/function/samples/deprecated/inline-dynamic-imports-bundle/reexporter.js delete mode 100644 test/function/samples/deprecated/inline-imports-with-manual/_config.js delete mode 100644 test/function/samples/deprecated/inline-imports-with-manual/lib.js delete mode 100644 test/function/samples/deprecated/inline-imports-with-manual/main.js delete mode 100644 test/function/samples/deprecated/inline-imports-with-multiple-array/_config.js delete mode 100644 test/function/samples/deprecated/inline-imports-with-multiple-array/lib.js delete mode 100644 test/function/samples/deprecated/inline-imports-with-multiple-array/main.js delete mode 100644 test/function/samples/deprecated/inline-imports-with-multiple-object/_config.js delete mode 100644 test/function/samples/deprecated/inline-imports-with-multiple-object/lib.js delete mode 100644 test/function/samples/deprecated/inline-imports-with-multiple-object/main.js delete mode 100644 test/function/samples/deprecated/manual-chunks-conflict/_config.js delete mode 100644 test/function/samples/deprecated/manual-chunks-conflict/dep.js delete mode 100644 test/function/samples/deprecated/manual-chunks-conflict/main.js delete mode 100644 test/function/samples/deprecated/manual-chunks-info/_config.js delete mode 100644 test/function/samples/deprecated/manual-chunks-info/dynamic.js delete mode 100644 test/function/samples/deprecated/manual-chunks-info/lib.js delete mode 100644 test/function/samples/deprecated/manual-chunks-info/main.js delete mode 100644 test/function/samples/deprecated/manual-chunks-preserve-modules/_config.js delete mode 100644 test/function/samples/deprecated/manual-chunks-preserve-modules/lib.js delete mode 100644 test/function/samples/deprecated/manual-chunks-preserve-modules/main.js delete mode 100644 test/function/samples/deprecated/max-parallel-file-reads/infinity/1.js delete mode 100644 test/function/samples/deprecated/max-parallel-file-reads/infinity/2.js delete mode 100644 test/function/samples/deprecated/max-parallel-file-reads/infinity/3.js delete mode 100644 test/function/samples/deprecated/max-parallel-file-reads/infinity/4.js delete mode 100644 test/function/samples/deprecated/max-parallel-file-reads/infinity/5.js delete mode 100644 test/function/samples/deprecated/max-parallel-file-reads/infinity/_config.js delete mode 100644 test/function/samples/deprecated/max-parallel-file-reads/infinity/main.js delete mode 100644 test/function/samples/deprecated/max-parallel-file-reads/set/1.js delete mode 100644 test/function/samples/deprecated/max-parallel-file-reads/set/2.js delete mode 100644 test/function/samples/deprecated/max-parallel-file-reads/set/3.js delete mode 100644 test/function/samples/deprecated/max-parallel-file-reads/set/4.js delete mode 100644 test/function/samples/deprecated/max-parallel-file-reads/set/5.js delete mode 100644 test/function/samples/deprecated/max-parallel-file-reads/set/_config.js delete mode 100644 test/function/samples/deprecated/max-parallel-file-reads/set/main.js delete mode 100644 test/function/samples/deprecated/max-parallel-file-reads/with-plugin/1.js delete mode 100644 test/function/samples/deprecated/max-parallel-file-reads/with-plugin/2.js delete mode 100644 test/function/samples/deprecated/max-parallel-file-reads/with-plugin/3.js delete mode 100644 test/function/samples/deprecated/max-parallel-file-reads/with-plugin/4.js delete mode 100644 test/function/samples/deprecated/max-parallel-file-reads/with-plugin/5.js delete mode 100644 test/function/samples/deprecated/max-parallel-file-reads/with-plugin/_config.js delete mode 100644 test/function/samples/deprecated/max-parallel-file-reads/with-plugin/main.js delete mode 100644 test/function/samples/deprecated/name-conflict-symbol/_config.js delete mode 100644 test/function/samples/deprecated/name-conflict-symbol/main.js delete mode 100644 test/function/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_config.js delete mode 100644 test/function/samples/deprecated/namespace-tostring/dynamic-import-default-mode/foo.js delete mode 100644 test/function/samples/deprecated/namespace-tostring/dynamic-import-default-mode/main.js delete mode 100644 test/function/samples/deprecated/namespace-tostring/dynamic-import/_config.js delete mode 100644 test/function/samples/deprecated/namespace-tostring/dynamic-import/foo.js delete mode 100644 test/function/samples/deprecated/namespace-tostring/dynamic-import/main.js delete mode 100644 test/function/samples/deprecated/namespace-tostring/entry-default/_config.js delete mode 100644 test/function/samples/deprecated/namespace-tostring/entry-default/main.js delete mode 100644 test/function/samples/deprecated/namespace-tostring/entry-named/_config.js delete mode 100644 test/function/samples/deprecated/namespace-tostring/entry-named/main.js delete mode 100644 test/function/samples/deprecated/namespace-tostring/external-namespaces/_config.js delete mode 100644 test/function/samples/deprecated/namespace-tostring/external-namespaces/main.js delete mode 100644 test/function/samples/deprecated/namespace-tostring/inlined-namespace/_config.js delete mode 100644 test/function/samples/deprecated/namespace-tostring/inlined-namespace/foo.js delete mode 100644 test/function/samples/deprecated/namespace-tostring/inlined-namespace/main.js delete mode 100644 test/function/samples/deprecated/namespace-tostring/interop-property-descriptor/_config.js delete mode 100644 test/function/samples/deprecated/namespace-tostring/interop-property-descriptor/dep.js delete mode 100644 test/function/samples/deprecated/namespace-tostring/interop-property-descriptor/main.js delete mode 100644 test/function/samples/deprecated/namespace-tostring/property-descriptor/_config.js delete mode 100644 test/function/samples/deprecated/namespace-tostring/property-descriptor/foo.js delete mode 100644 test/function/samples/deprecated/namespace-tostring/property-descriptor/main.js delete mode 100644 test/function/samples/deprecated/nested-inlined-dynamic-import-1/_config.js delete mode 100644 test/function/samples/deprecated/nested-inlined-dynamic-import-1/foo.js delete mode 100644 test/function/samples/deprecated/nested-inlined-dynamic-import-1/main.js delete mode 100644 test/function/samples/deprecated/plugin-module-ids/_config.js delete mode 100644 test/function/samples/deprecated/plugin-module-ids/foo.js delete mode 100644 test/function/samples/deprecated/plugin-module-ids/main.js delete mode 100644 test/function/samples/deprecated/preserveModules/inline-dynamic-imports/_config.js delete mode 100644 test/function/samples/deprecated/preserveModules/inline-dynamic-imports/lib.js delete mode 100644 test/function/samples/deprecated/preserveModules/inline-dynamic-imports/main.js delete mode 100644 test/function/samples/deprecated/preserveModules/invalid-default-export-mode/_config.js delete mode 100644 test/function/samples/deprecated/preserveModules/invalid-default-export-mode/lib.js delete mode 100644 test/function/samples/deprecated/preserveModules/invalid-default-export-mode/main.js delete mode 100644 test/function/samples/deprecated/preserveModules/invalid-no-preserve-entry-signatures/_config.js delete mode 100644 test/function/samples/deprecated/preserveModules/invalid-no-preserve-entry-signatures/main.js delete mode 100644 test/function/samples/deprecated/preserveModules/invalid-none-export-mode/_config.js delete mode 100644 test/function/samples/deprecated/preserveModules/invalid-none-export-mode/lib.js delete mode 100644 test/function/samples/deprecated/preserveModules/invalid-none-export-mode/main.js delete mode 100644 test/function/samples/deprecated/preserveModules/manual-chunks/_config.js delete mode 100644 test/function/samples/deprecated/preserveModules/manual-chunks/lib.js delete mode 100644 test/function/samples/deprecated/preserveModules/manual-chunks/main.js delete mode 100644 test/function/samples/deprecated/preserveModules/mixed-exports/_config.js delete mode 100644 test/function/samples/deprecated/preserveModules/mixed-exports/lib1.js delete mode 100644 test/function/samples/deprecated/preserveModules/mixed-exports/lib2.js delete mode 100644 test/function/samples/deprecated/preserveModules/mixed-exports/lib3.js delete mode 100644 test/function/samples/deprecated/preserveModules/mixed-exports/main.js delete mode 100644 test/function/samples/deprecated/preserveModules/virtual-modules-conflict/_config.js delete mode 100644 test/function/samples/deprecated/preserveModules/virtual-modules-conflict/_virtual/_virtualModule.js delete mode 100644 test/function/samples/deprecated/preserveModules/virtual-modules-conflict/main.js delete mode 100644 test/function/samples/deprecated/preserveModules/virtual-modules/_config.js delete mode 100644 test/function/samples/deprecated/preserveModules/virtual-modules/lib/lib.js delete mode 100644 test/function/samples/deprecated/preserveModules/virtual-modules/main.js delete mode 100644 test/function/samples/deprecated/reexport-ns/_config.js delete mode 100644 test/function/samples/deprecated/reexport-ns/main.js delete mode 100644 test/function/samples/deprecated/reexport-ns/maths.js delete mode 100644 test/function/samples/deprecated/reexport-ns/square.js delete mode 100644 test/function/samples/deprecated/resolve-id-external/_config.js delete mode 100644 test/function/samples/deprecated/resolve-id-external/main.js delete mode 100644 test/function/samples/deprecated/resolve-id/_config.js delete mode 100644 test/function/samples/deprecated/resolve-id/main.js delete mode 100644 test/function/samples/deprecations/dynamicImportFunction/_config.js delete mode 100644 test/function/samples/deprecations/dynamicImportFunction/main.js delete mode 100644 test/function/samples/deprecations/experimentalDeepDynamicChunkOptimization/_config.js delete mode 100644 test/function/samples/deprecations/experimentalDeepDynamicChunkOptimization/main.js delete mode 100644 test/function/samples/deprecations/hasModuleSideEffects/_config.js delete mode 100644 test/function/samples/deprecations/hasModuleSideEffects/main.js delete mode 100644 test/function/samples/deprecations/inlineDynamicImports/_config.js delete mode 100644 test/function/samples/deprecations/inlineDynamicImports/main.js delete mode 100644 test/function/samples/deprecations/manualChunks/_config.js delete mode 100644 test/function/samples/deprecations/manualChunks/main.js delete mode 100644 test/function/samples/deprecations/maxParallelFileReads/_config.js delete mode 100644 test/function/samples/deprecations/maxParallelFileReads/main.js delete mode 100644 test/function/samples/deprecations/namespaceToStringTag/_config.js delete mode 100644 test/function/samples/deprecations/namespaceToStringTag/main.js delete mode 100644 test/function/samples/deprecations/plugin-module-ids/_config.js delete mode 100644 test/function/samples/deprecations/plugin-module-ids/foo.js delete mode 100644 test/function/samples/deprecations/plugin-module-ids/main.js delete mode 100644 test/function/samples/deprecations/prefer-const/_config.js delete mode 100644 test/function/samples/deprecations/prefer-const/main.js delete mode 100644 test/function/samples/deprecations/preserveModules/_config.js delete mode 100644 test/function/samples/deprecations/preserveModules/main.js diff --git a/docs/configuration-options/index.md b/docs/configuration-options/index.md index 543e81b0f..d41549fd5 100755 --- a/docs/configuration-options/index.md +++ b/docs/configuration-options/index.md @@ -2556,50 +2556,6 @@ Whether to skip the `bundle.write()` step when a rebuild is triggered. ☢️ These options have been deprecated and may be removed in a future Rollup version. -### inlineDynamicImports - -_Use the [`output.inlineDynamicImports`](#output-inlinedynamicimports) output option instead, which has the same signature._ - -### manualChunks - -_Use the [`output.manualChunks`](#output-manualchunks) output option instead, which has the same signature._ - -### maxParallelFileReads - -_Use the [`maxParallelFileOps`](#maxparallelfileops) option instead._ - -| | | -| -------: | :-------------------------------- | -| Type: | `number` | -| CLI: | `--maxParallelFileReads ` | -| Default: | 20 | - -Limits the number of files rollup will open in parallel when reading modules. Without a limit or with a high enough value, builds can fail with an "EMFILE: too many open files". This depends on how many open file handles the os allows. - -### output.dynamicImportFunction - -_Use the [`renderDynamicImport`](../plugin-development/index.md#renderdynamicimport) plugin hook instead._ - -| | | -| -------: | :------------------------------- | -| Type: | `string` | -| CLI: | `--dynamicImportFunction ` | -| Default: | `import` | - -This will rename the dynamic import function to the chosen name when outputting ES bundles. This is useful for generating code that uses a dynamic import polyfill such as [this one](https://github.com/uupaa/dynamic-import-polyfill). - -### output.experimentalDeepDynamicChunkOptimization - -_This option is no longer needed._ - -| | | -| --: | :-- | -| Type: | `boolean` | -| CLI: | `--experimentalDeepDynamicChunkOptimization`/`--no-experimentalDeepDynamicChunkOptimization` | -| Default: | `false` | - -This option was used to prevent performance issues with the full chunk optimization algorithm. As the algorithm is much faster now, this option is now ignored by Rollup and should no longer be used. - ### output.externalImportAssertions _Use the [`output.externalImportAttributes`](#output-externalimportattributes) option instead._ @@ -2611,38 +2567,3 @@ _Use the [`output.externalImportAttributes`](#output-externalimportattributes) o | Default: | `true` | Whether to add import assertions to external imports in the output if the output format is `es`. By default, assertions are taken from the input files, but plugins can add or remove assertions later. E.g. `import "foo" assert {type: "json"}` will cause the same import to appear in the output unless the option is set to `false`. Note that all imports of a module need to have consistent assertions, otherwise a warning is emitted. - -### output.preferConst - -_Use the [`output.generatedCode.constBindings`](#output-generatedcode-constbindings) option instead._ - -| | | -| -------: | :--------------------------------- | -| Type: | `boolean` | -| CLI: | `--preferConst`/`--no-preferConst` | -| Default: | `false` | - -Generate `const` declarations for exports rather than `var` declarations. - -### output.namespaceToStringTag - -_Use [`output.generatedCode.symbols`](#output-generatedcode-symbols) instead._ - -| | | -| -------: | :--------------------------------------------------- | -| Type: | `boolean` | -| CLI: | `--namespaceToStringTag`/`--no-namespaceToStringTag` | -| Default: | `false` | - -Whether to add spec compliant `.toString()` tags to namespace objects. If this option is set, - -```javascript -import * as namespace from './file.js'; -console.log(String(namespace)); -``` - -will always log `[object Module]`; - -### preserveModules - -_Use the [`output.preserveModules`](#output-preservemodules) output option instead, which has the same signature._ diff --git a/docs/guide/en/slugs-and-pages-by-legacy-slugs.json b/docs/guide/en/slugs-and-pages-by-legacy-slugs.json index 07eacc06d..26b37e793 100644 --- a/docs/guide/en/slugs-and-pages-by-legacy-slugs.json +++ b/docs/guide/en/slugs-and-pages-by-legacy-slugs.json @@ -1 +1 @@ -{"--bundleconfigascjs":["command-line-interface","bundleconfigascjs"],"--configplugin-plugin":["command-line-interface","configplugin-plugin"],"--environment-values":["command-line-interface","environment-values"],"--failafterwarnings":["command-line-interface","failafterwarnings"],"--no-stdin":["command-line-interface","no-stdin"],"--silent":["command-line-interface","silent"],"--stdinext":["command-line-interface","stdin-ext"],"--waitforbundleinput":["command-line-interface","waitforbundleinput"],"--watchonstart-cmd---watchonbundlestart-cmd---watchonbundleend-cmd---watchonend-cmd---watchonerror-cmd":["command-line-interface","watch-onstart-cmd-watch-onbundlestart-cmd-watch-onbundleend-cmd-watch-onend-cmd-watch-onerror-cmd"],"-h--help":["command-line-interface","h-help"],"-p-plugin---plugin-plugin":["command-line-interface","p-plugin-plugin-plugin"],"-v--version":["command-line-interface","v-version"],"-w--watch":["command-line-interface","w-watch"],"a-simple-example":["plugin-development","a-simple-example"],"advanced-functionality":["configuration-options","advanced-functionality"],"augmentchunkhash":["plugin-development","augmentchunkhash"],"avoiding-eval":["troubleshooting","avoiding-eval"],"babel":["tools","babel"],"banner":["plugin-development","banner"],"big-list-of-options":["configuration-options",""],"build-hooks":["plugin-development","build-hooks"],"buildend":["plugin-development","buildend"],"buildstart":["plugin-development","buildstart"],"cache":["configuration-options","cache"],"caveats-when-using-native-node-es-modules":["command-line-interface","caveats-when-using-native-node-es-modules"],"changed-defaults":["migration","changed-defaults"],"changes-to-the-plugin-api":["migration","changes-to-the-plugin-api"],"closebundle":["plugin-development","closebundle"],"closewatcher":["plugin-development","closewatcher"],"code-splitting":["tutorial","code-splitting"],"command-line-flags":["command-line-interface","command-line-flags"],"command-line-reference":["command-line-interface",""],"compatibility":["introduction","compatibility"],"config-intellisense":["command-line-interface","config-intellisense"],"configuration-files":["command-line-interface","configuration-files"],"context":["configuration-options","context"],"conventions":["plugin-development","conventions"],"core-functionality":["configuration-options","core-functionality"],"creating-your-first-bundle":["tutorial","creating-your-first-bundle"],"custom-module-meta-data":["plugin-development","custom-module-meta-data"],"custom-resolver-options":["plugin-development","custom-resolver-options"],"danger-zone":["configuration-options","danger-zone"],"default-export":["es-module-syntax","default-export"],"default-import":["es-module-syntax","default-import"],"deno":["tools","deno"],"deprecated-context-functions":["plugin-development","deprecated-context-functions"],"deprecated-options":["configuration-options","deprecated-options"],"differences-to-the-javascript-api":["command-line-interface","differences-to-the-javascript-api"],"direct-plugin-communication":["plugin-development","direct-plugin-communication"],"dynamic-import":["es-module-syntax","dynamic-import"],"dynamic-import-in-commonjs-output":["migration","dynamic-import-in-commonjs-output"],"empty-import":["es-module-syntax","empty-import"],"error-emfile-too-many-open-files":["troubleshooting","error-emfile-too-many-open-files"],"error-javascript-heap-out-of-memory":["troubleshooting","error-javascript-heap-out-of-memory"],"error-name-is-not-exported-by-module":["troubleshooting","error-name-is-not-exported-by-module"],"error-node-tried-to-load-your-configuration-file-as-commonjs-even-though-it-is-likely-an-es-module":["troubleshooting","error-node-tried-to-load-your-configuration-file-as-commonjs-even-though-it-is-likely-an-es-module"],"error-this-is-undefined":["troubleshooting","error-this-is-undefined"],"es-module-syntax":["es-module-syntax",""],"eval2--eval":["troubleshooting","eval2-eval"],"example-transformer":["plugin-development","example-transformer"],"experimental-options":["configuration-options","experimental-options"],"experimentalcacheexpiry":["configuration-options","experimentalcacheexpiry"],"exporting":["es-module-syntax","exporting"],"external":["configuration-options","external"],"faqs":["faqs",""],"file-urls":["plugin-development","file-urls"],"footer":["plugin-development","footer"],"generatebundle":["plugin-development","generatebundle"],"getting-the-current-directory":["command-line-interface","getting-the-current-directory"],"gulp":["tools","gulp"],"how-bindings-work":["es-module-syntax","how-bindings-work"],"how-do-i-add-polyfills-to-a-rollup-bundle":["faqs","how-do-i-add-polyfills-to-a-rollup-bundle"],"how-do-i-run-rollup-itself-in-a-browser":["faqs","how-do-i-run-rollup-itself-in-a-browser"],"how-do-i-use-rollup-in-nodejs-with-commonjs-modules":["faqs","how-do-i-use-rollup-in-node-js-with-commonjs-modules"],"importing":["es-module-syntax","importing"],"importing-commonjs":["introduction","importing-commonjs"],"importing-packagejson":["command-line-interface","importing-package-json"],"inlinedynamicimports":["configuration-options","inlinedynamicimports"],"input":["configuration-options","input"],"inputoptions-object":["javascript-api","inputoptions-object"],"installation":["introduction","installation"],"installing-rollup-locally":["tutorial","installing-rollup-locally"],"inter-plugin-communication":["plugin-development","inter-plugin-communication"],"intro":["plugin-development","intro"],"introduction":["introduction",""],"is-rollup-meant-for-building-libraries-or-applications":["faqs","is-rollup-meant-for-building-libraries-or-applications"],"javascript-api":["javascript-api",""],"load":["plugin-development","load"],"loading-a-configuration-from-a-node-package":["command-line-interface","loading-a-configuration-from-a-node-package"],"makeabsoluteexternalsrelative":["configuration-options","makeabsoluteexternalsrelative"],"manualchunks":["configuration-options","manualchunks"],"maxparallelfileops":["configuration-options","maxparallelfileops"],"maxparallelfilereads":["configuration-options","maxparallelfilereads"],"migration":["migration",""],"modulecontext":["configuration-options","modulecontext"],"moduleparsed":["plugin-development","moduleparsed"],"more-changed-options":["migration","more-changed-options"],"name":["plugin-development","name"],"named-exports":["es-module-syntax","named-exports"],"named-imports":["es-module-syntax","named-imports"],"namespace-imports":["es-module-syntax","namespace-imports"],"new-function":["troubleshooting","new-function"],"onwarn":["configuration-options","onwarn"],"options":["plugin-development","options"],"output-generation-hooks":["plugin-development","output-generation-hooks"],"outputamd":["configuration-options","output-amd"],"outputassetfilenames":["configuration-options","output-assetfilenames"],"outputbanneroutputfooter":["configuration-options","output-banner-output-footer"],"outputchunkfilenames":["configuration-options","output-chunkfilenames"],"outputcompact":["configuration-options","output-compact"],"outputdir":["configuration-options","output-dir"],"outputdynamicimportfunction":["configuration-options","output-dynamicimportfunction"],"outputdynamicimportincjs":["configuration-options","output-dynamicimportincjs"],"outputentryfilenames":["configuration-options","output-entryfilenames"],"outputesmodule":["configuration-options","output-esmodule"],"outputexports":["configuration-options","output-exports"],"outputextend":["configuration-options","output-extend"],"outputexternalimportassertions":["configuration-options","output-externalimportassertions"],"outputexternallivebindings":["configuration-options","output-externallivebindings"],"outputfile":["configuration-options","output-file"],"outputformat":["configuration-options","output-format"],"outputfreeze":["configuration-options","output-freeze"],"outputgeneratedcode":["configuration-options","output-generatedcode"],"outputglobals":["configuration-options","output-globals"],"outputhoisttransitiveimports":["configuration-options","output-hoisttransitiveimports"],"outputindent":["configuration-options","output-indent"],"outputinlinedynamicimports":["configuration-options","output-inlinedynamicimports"],"outputinterop":["configuration-options","output-interop"],"outputintrooutputoutro":["configuration-options","output-intro-output-outro"],"outputmanualchunks":["configuration-options","output-manualchunks"],"outputminifyinternalexports":["configuration-options","output-minifyinternalexports"],"outputname":["configuration-options","output-name"],"outputnamespacetostringtag":["configuration-options","output-namespacetostringtag"],"outputnoconflict":["configuration-options","output-noconflict"],"outputoptions":["plugin-development","outputoptions"],"outputoptions-object":["javascript-api","outputoptions-object"],"outputpaths":["configuration-options","output-paths"],"outputplugins":["configuration-options","output-plugins"],"outputpreferconst":["configuration-options","output-preferconst"],"outputpreservemodules":["configuration-options","output-preservemodules"],"outputpreservemodulesroot":["configuration-options","output-preservemodulesroot"],"outputsanitizefilename":["configuration-options","output-sanitizefilename"],"outputsourcemap":["configuration-options","output-sourcemap"],"outputsourcemapbaseurl":["configuration-options","output-sourcemapbaseurl"],"outputsourcemapexcludesources":["configuration-options","output-sourcemapexcludesources"],"outputsourcemapfile":["configuration-options","output-sourcemapfile"],"outputsourcemappathtransform":["configuration-options","output-sourcemappathtransform"],"outputstrict":["configuration-options","output-strict"],"outputsystemnullsetters":["configuration-options","output-systemnullsetters"],"outputvalidate":["configuration-options","output-validate"],"outro":["plugin-development","outro"],"overview":["introduction","overview"],"peer-dependencies":["tools","peer-dependencies"],"perf":["configuration-options","perf"],"plugin-context":["plugin-development","plugin-context"],"plugin-development":["plugin-development",""],"plugins":["configuration-options","plugins"],"plugins-overview":["plugin-development","plugins-overview"],"prerequisites":["migration","prerequisites"],"preserveentrysignatures":["configuration-options","preserveentrysignatures"],"preservemodules":["configuration-options","preservemodules"],"preservesymlinks":["configuration-options","preservesymlinks"],"programmatically-loading-a-config-file":["javascript-api","programmatically-loading-a-config-file"],"properties":["plugin-development","properties"],"publishing-es-modules":["introduction","publishing-es-modules"],"quick-start":["introduction","quick-start"],"reading-a-file-from-stdin":["command-line-interface","reading-a-file-from-stdin"],"renderchunk":["plugin-development","renderchunk"],"renderdynamicimport":["plugin-development","renderdynamicimport"],"rendererror":["plugin-development","rendererror"],"renderstart":["plugin-development","renderstart"],"resolvedynamicimport":["plugin-development","resolvedynamicimport"],"resolvefileurl":["plugin-development","resolvefileurl"],"resolveid":["plugin-development","resolveid"],"resolveimportmeta":["plugin-development","resolveimportmeta"],"rollupplugin-commonjs":["tools","rollup-plugin-commonjs"],"rollupplugin-node-resolve":["tools","rollup-plugin-node-resolve"],"rolluprollup":["javascript-api","rollup-rollup"],"rollupwatch":["javascript-api","rollup-watch"],"shimmissingexports":["configuration-options","shimmissingexports"],"shouldtransformcachedmodule":["plugin-development","shouldtransformcachedmodule"],"source-code-transformations":["plugin-development","source-code-transformations"],"strictdeprecations":["configuration-options","strictdeprecations"],"synthetic-named-exports":["plugin-development","synthetic-named-exports"],"the-why":["introduction","the-why"],"thisaddwatchfile":["plugin-development","this-addwatchfile"],"thisemitfile":["plugin-development","this-emitfile"],"thiserror":["plugin-development","this-error"],"thisgetcombinedsourcemap":["plugin-development","this-getcombinedsourcemap"],"thisgetfilename":["plugin-development","this-getfilename"],"thisgetmoduleids":["plugin-development","this-getmoduleids"],"thisgetmoduleinfo":["plugin-development","this-getmoduleinfo"],"thisgetwatchfiles":["plugin-development","this-getwatchfiles"],"thisload":["plugin-development","this-load"],"thismeta":["plugin-development","this-meta"],"thisparse":["plugin-development","this-parse"],"thisresolve":["plugin-development","this-resolve"],"thissetassetsource":["plugin-development","this-setassetsource"],"thiswarn":["plugin-development","this-warn"],"tools":["tools",""],"transform":["plugin-development","transform"],"transformers":["plugin-development","transformers"],"tree-shaking":["introduction","tree-shaking"],"tree-shaking-doesnt-seem-to-be-working":["troubleshooting","tree-shaking-doesn-t-seem-to-be-working"],"treeshake":["configuration-options","treeshake"],"troubleshooting":["troubleshooting",""],"tutorial":["tutorial",""],"using-config-files":["tutorial","using-config-files"],"using-configuration-files":["migration","using-configuration-files"],"using-output-plugins":["tutorial","using-output-plugins"],"using-plugins":["tutorial","using-plugins"],"warning-sourcemap-is-likely-to-be-incorrect":["troubleshooting","warning-sourcemap-is-likely-to-be-incorrect"],"warning-treating-module-as-external-dependency":["troubleshooting","warning-treating-module-as-external-dependency"],"watch-options":["configuration-options","watch"],"watchbuilddelay":["configuration-options","watch-builddelay"],"watchchange":["plugin-development","watchchange"],"watchchokidar":["configuration-options","watch-chokidar"],"watchclearscreen":["configuration-options","watch-clearscreen"],"watchexclude":["configuration-options","watch-exclude"],"watchinclude":["configuration-options","watch-include"],"watchoptions":["javascript-api","watchoptions"],"watchskipwrite":["configuration-options","watch-skipwrite"],"what-is-tree-shaking":["faqs","what-is-tree-shaking"],"who-made-the-rollup-logo-its-lovely":["faqs","who-made-the-rollup-logo-it-s-lovely"],"why-are-es-modules-better-than-commonjs-modules":["faqs","why-are-es-modules-better-than-commonjs-modules"],"why-do-additional-imports-turn-up-in-my-entry-chunks-when-code-splitting":["faqs","why-do-additional-imports-turn-up-in-my-entry-chunks-when-code-splitting"],"why-isnt-node-resolve-a-built-in-feature":["faqs","why-isn-t-node-resolve-a-built-in-feature"],"with-npm-packages":["tools","with-npm-packages"],"writebundle":["plugin-development","writebundle"]} \ No newline at end of file +{"--bundleconfigascjs":["command-line-interface","bundleconfigascjs"],"--configplugin-plugin":["command-line-interface","configplugin-plugin"],"--environment-values":["command-line-interface","environment-values"],"--failafterwarnings":["command-line-interface","failafterwarnings"],"--no-stdin":["command-line-interface","no-stdin"],"--silent":["command-line-interface","silent"],"--stdinext":["command-line-interface","stdin-ext"],"--waitforbundleinput":["command-line-interface","waitforbundleinput"],"--watchonstart-cmd---watchonbundlestart-cmd---watchonbundleend-cmd---watchonend-cmd---watchonerror-cmd":["command-line-interface","watch-onstart-cmd-watch-onbundlestart-cmd-watch-onbundleend-cmd-watch-onend-cmd-watch-onerror-cmd"],"-h--help":["command-line-interface","h-help"],"-p-plugin---plugin-plugin":["command-line-interface","p-plugin-plugin-plugin"],"-v--version":["command-line-interface","v-version"],"-w--watch":["command-line-interface","w-watch"],"a-simple-example":["plugin-development","a-simple-example"],"advanced-functionality":["configuration-options","advanced-functionality"],"augmentchunkhash":["plugin-development","augmentchunkhash"],"avoiding-eval":["troubleshooting","avoiding-eval"],"babel":["tools","babel"],"banner":["plugin-development","banner"],"big-list-of-options":["configuration-options",""],"build-hooks":["plugin-development","build-hooks"],"buildend":["plugin-development","buildend"],"buildstart":["plugin-development","buildstart"],"cache":["configuration-options","cache"],"caveats-when-using-native-node-es-modules":["command-line-interface","caveats-when-using-native-node-es-modules"],"changed-defaults":["migration","changed-defaults"],"changes-to-the-plugin-api":["migration","changes-to-the-plugin-api"],"closebundle":["plugin-development","closebundle"],"closewatcher":["plugin-development","closewatcher"],"code-splitting":["tutorial","code-splitting"],"command-line-flags":["command-line-interface","command-line-flags"],"command-line-reference":["command-line-interface",""],"compatibility":["introduction","compatibility"],"config-intellisense":["command-line-interface","config-intellisense"],"configuration-files":["command-line-interface","configuration-files"],"context":["configuration-options","context"],"conventions":["plugin-development","conventions"],"core-functionality":["configuration-options","core-functionality"],"creating-your-first-bundle":["tutorial","creating-your-first-bundle"],"custom-module-meta-data":["plugin-development","custom-module-meta-data"],"custom-resolver-options":["plugin-development","custom-resolver-options"],"danger-zone":["configuration-options","danger-zone"],"default-export":["es-module-syntax","default-export"],"default-import":["es-module-syntax","default-import"],"deno":["tools","deno"],"deprecated-options":["configuration-options","deprecated-options"],"differences-to-the-javascript-api":["command-line-interface","differences-to-the-javascript-api"],"direct-plugin-communication":["plugin-development","direct-plugin-communication"],"dynamic-import":["es-module-syntax","dynamic-import"],"dynamic-import-in-commonjs-output":["migration","dynamic-import-in-commonjs-output"],"empty-import":["es-module-syntax","empty-import"],"error-emfile-too-many-open-files":["troubleshooting","error-emfile-too-many-open-files"],"error-javascript-heap-out-of-memory":["troubleshooting","error-javascript-heap-out-of-memory"],"error-name-is-not-exported-by-module":["troubleshooting","error-name-is-not-exported-by-module"],"error-node-tried-to-load-your-configuration-file-as-commonjs-even-though-it-is-likely-an-es-module":["troubleshooting","error-node-tried-to-load-your-configuration-file-as-commonjs-even-though-it-is-likely-an-es-module"],"error-this-is-undefined":["troubleshooting","error-this-is-undefined"],"es-module-syntax":["es-module-syntax",""],"eval2--eval":["troubleshooting","eval2-eval"],"example-transformer":["plugin-development","example-transformer"],"experimental-options":["configuration-options","experimental-options"],"experimentalcacheexpiry":["configuration-options","experimentalcacheexpiry"],"exporting":["es-module-syntax","exporting"],"external":["configuration-options","external"],"faqs":["faqs",""],"file-urls":["plugin-development","file-urls"],"footer":["plugin-development","footer"],"generatebundle":["plugin-development","generatebundle"],"getting-the-current-directory":["command-line-interface","getting-the-current-directory"],"gulp":["tools","gulp"],"how-bindings-work":["es-module-syntax","how-bindings-work"],"how-do-i-add-polyfills-to-a-rollup-bundle":["faqs","how-do-i-add-polyfills-to-a-rollup-bundle"],"how-do-i-run-rollup-itself-in-a-browser":["faqs","how-do-i-run-rollup-itself-in-a-browser"],"how-do-i-use-rollup-in-nodejs-with-commonjs-modules":["faqs","how-do-i-use-rollup-in-node-js-with-commonjs-modules"],"importing":["es-module-syntax","importing"],"importing-commonjs":["introduction","importing-commonjs"],"importing-packagejson":["command-line-interface","importing-package-json"],"input":["configuration-options","input"],"inputoptions-object":["javascript-api","inputoptions-object"],"installation":["introduction","installation"],"installing-rollup-locally":["tutorial","installing-rollup-locally"],"inter-plugin-communication":["plugin-development","inter-plugin-communication"],"intro":["plugin-development","intro"],"introduction":["introduction",""],"is-rollup-meant-for-building-libraries-or-applications":["faqs","is-rollup-meant-for-building-libraries-or-applications"],"javascript-api":["javascript-api",""],"load":["plugin-development","load"],"loading-a-configuration-from-a-node-package":["command-line-interface","loading-a-configuration-from-a-node-package"],"makeabsoluteexternalsrelative":["configuration-options","makeabsoluteexternalsrelative"],"maxparallelfileops":["configuration-options","maxparallelfileops"],"migration":["migration",""],"modulecontext":["configuration-options","modulecontext"],"moduleparsed":["plugin-development","moduleparsed"],"more-changed-options":["migration","more-changed-options"],"name":["plugin-development","name"],"named-exports":["es-module-syntax","named-exports"],"named-imports":["es-module-syntax","named-imports"],"namespace-imports":["es-module-syntax","namespace-imports"],"new-function":["troubleshooting","new-function"],"onwarn":["configuration-options","onwarn"],"options":["plugin-development","options"],"output-generation-hooks":["plugin-development","output-generation-hooks"],"outputamd":["configuration-options","output-amd"],"outputassetfilenames":["configuration-options","output-assetfilenames"],"outputbanneroutputfooter":["configuration-options","output-banner-output-footer"],"outputchunkfilenames":["configuration-options","output-chunkfilenames"],"outputcompact":["configuration-options","output-compact"],"outputdir":["configuration-options","output-dir"],"outputdynamicimportincjs":["configuration-options","output-dynamicimportincjs"],"outputentryfilenames":["configuration-options","output-entryfilenames"],"outputesmodule":["configuration-options","output-esmodule"],"outputexports":["configuration-options","output-exports"],"outputextend":["configuration-options","output-extend"],"outputexternalimportassertions":["configuration-options","output-externalimportassertions"],"outputexternallivebindings":["configuration-options","output-externallivebindings"],"outputfile":["configuration-options","output-file"],"outputformat":["configuration-options","output-format"],"outputfreeze":["configuration-options","output-freeze"],"outputgeneratedcode":["configuration-options","output-generatedcode"],"outputglobals":["configuration-options","output-globals"],"outputhoisttransitiveimports":["configuration-options","output-hoisttransitiveimports"],"outputindent":["configuration-options","output-indent"],"outputinlinedynamicimports":["configuration-options","output-inlinedynamicimports"],"outputinterop":["configuration-options","output-interop"],"outputintrooutputoutro":["configuration-options","output-intro-output-outro"],"outputmanualchunks":["configuration-options","output-manualchunks"],"outputminifyinternalexports":["configuration-options","output-minifyinternalexports"],"outputname":["configuration-options","output-name"],"outputnoconflict":["configuration-options","output-noconflict"],"outputoptions":["plugin-development","outputoptions"],"outputoptions-object":["javascript-api","outputoptions-object"],"outputpaths":["configuration-options","output-paths"],"outputplugins":["configuration-options","output-plugins"],"outputpreservemodules":["configuration-options","output-preservemodules"],"outputpreservemodulesroot":["configuration-options","output-preservemodulesroot"],"outputsanitizefilename":["configuration-options","output-sanitizefilename"],"outputsourcemap":["configuration-options","output-sourcemap"],"outputsourcemapbaseurl":["configuration-options","output-sourcemapbaseurl"],"outputsourcemapexcludesources":["configuration-options","output-sourcemapexcludesources"],"outputsourcemapfile":["configuration-options","output-sourcemapfile"],"outputsourcemappathtransform":["configuration-options","output-sourcemappathtransform"],"outputstrict":["configuration-options","output-strict"],"outputsystemnullsetters":["configuration-options","output-systemnullsetters"],"outputvalidate":["configuration-options","output-validate"],"outro":["plugin-development","outro"],"overview":["introduction","overview"],"peer-dependencies":["tools","peer-dependencies"],"perf":["configuration-options","perf"],"plugin-context":["plugin-development","plugin-context"],"plugin-development":["plugin-development",""],"plugins":["configuration-options","plugins"],"plugins-overview":["plugin-development","plugins-overview"],"prerequisites":["migration","prerequisites"],"preserveentrysignatures":["configuration-options","preserveentrysignatures"],"preservesymlinks":["configuration-options","preservesymlinks"],"programmatically-loading-a-config-file":["javascript-api","programmatically-loading-a-config-file"],"properties":["plugin-development","properties"],"publishing-es-modules":["introduction","publishing-es-modules"],"quick-start":["introduction","quick-start"],"reading-a-file-from-stdin":["command-line-interface","reading-a-file-from-stdin"],"renderchunk":["plugin-development","renderchunk"],"renderdynamicimport":["plugin-development","renderdynamicimport"],"rendererror":["plugin-development","rendererror"],"renderstart":["plugin-development","renderstart"],"resolvedynamicimport":["plugin-development","resolvedynamicimport"],"resolvefileurl":["plugin-development","resolvefileurl"],"resolveid":["plugin-development","resolveid"],"resolveimportmeta":["plugin-development","resolveimportmeta"],"rollupplugin-commonjs":["tools","rollup-plugin-commonjs"],"rollupplugin-node-resolve":["tools","rollup-plugin-node-resolve"],"rolluprollup":["javascript-api","rollup-rollup"],"rollupwatch":["javascript-api","rollup-watch"],"shimmissingexports":["configuration-options","shimmissingexports"],"shouldtransformcachedmodule":["plugin-development","shouldtransformcachedmodule"],"source-code-transformations":["plugin-development","source-code-transformations"],"strictdeprecations":["configuration-options","strictdeprecations"],"synthetic-named-exports":["plugin-development","synthetic-named-exports"],"the-why":["introduction","the-why"],"thisaddwatchfile":["plugin-development","this-addwatchfile"],"thisemitfile":["plugin-development","this-emitfile"],"thiserror":["plugin-development","this-error"],"thisgetcombinedsourcemap":["plugin-development","this-getcombinedsourcemap"],"thisgetfilename":["plugin-development","this-getfilename"],"thisgetmoduleids":["plugin-development","this-getmoduleids"],"thisgetmoduleinfo":["plugin-development","this-getmoduleinfo"],"thisgetwatchfiles":["plugin-development","this-getwatchfiles"],"thisload":["plugin-development","this-load"],"thismeta":["plugin-development","this-meta"],"thisparse":["plugin-development","this-parse"],"thisresolve":["plugin-development","this-resolve"],"thissetassetsource":["plugin-development","this-setassetsource"],"thiswarn":["plugin-development","this-warn"],"tools":["tools",""],"transform":["plugin-development","transform"],"transformers":["plugin-development","transformers"],"tree-shaking":["introduction","tree-shaking"],"tree-shaking-doesnt-seem-to-be-working":["troubleshooting","tree-shaking-doesn-t-seem-to-be-working"],"treeshake":["configuration-options","treeshake"],"troubleshooting":["troubleshooting",""],"tutorial":["tutorial",""],"using-config-files":["tutorial","using-config-files"],"using-configuration-files":["migration","using-configuration-files"],"using-output-plugins":["tutorial","using-output-plugins"],"using-plugins":["tutorial","using-plugins"],"warning-sourcemap-is-likely-to-be-incorrect":["troubleshooting","warning-sourcemap-is-likely-to-be-incorrect"],"warning-treating-module-as-external-dependency":["troubleshooting","warning-treating-module-as-external-dependency"],"watch-options":["configuration-options","watch"],"watchbuilddelay":["configuration-options","watch-builddelay"],"watchchange":["plugin-development","watchchange"],"watchchokidar":["configuration-options","watch-chokidar"],"watchclearscreen":["configuration-options","watch-clearscreen"],"watchexclude":["configuration-options","watch-exclude"],"watchinclude":["configuration-options","watch-include"],"watchoptions":["javascript-api","watchoptions"],"watchskipwrite":["configuration-options","watch-skipwrite"],"what-is-tree-shaking":["faqs","what-is-tree-shaking"],"who-made-the-rollup-logo-its-lovely":["faqs","who-made-the-rollup-logo-it-s-lovely"],"why-are-es-modules-better-than-commonjs-modules":["faqs","why-are-es-modules-better-than-commonjs-modules"],"why-do-additional-imports-turn-up-in-my-entry-chunks-when-code-splitting":["faqs","why-do-additional-imports-turn-up-in-my-entry-chunks-when-code-splitting"],"why-isnt-node-resolve-a-built-in-feature":["faqs","why-isn-t-node-resolve-a-built-in-feature"],"with-npm-packages":["tools","with-npm-packages"],"writebundle":["plugin-development","writebundle"]} \ No newline at end of file diff --git a/docs/plugin-development/index.md b/docs/plugin-development/index.md index 175bdb34c..ad4cc6554 100644 --- a/docs/plugin-development/index.md +++ b/docs/plugin-development/index.md @@ -1747,20 +1747,6 @@ When used in the `transform` hook, the `id` of the current module will also be a If the [`logLevel`](../configuration-options/index.md#loglevel) option is set to `"silent"`, this method will do nothing. -## Deprecated Context Functions - -☢️ These context utility functions have been deprecated and may be removed in a future Rollup version. - -- `this.moduleIds: IterableIterator` - _**Use [`this.getModuleIds`](#this-getmoduleids)**_ - An `Iterator` that gives access to all module ids in the current graph. It can be iterated via - - ```js - for (const moduleId of this.moduleIds) { - /* ... */ - } - ``` - - or converted into an Array via `Array.from(this.moduleIds)`. - ## File URLs To reference a file URL reference from within JS code, use the `import.meta.ROLLUP_FILE_URL_referenceId` replacement. This will generate code that depends on the output format and generates a URL that points to the emitted file in the target environment. Note that all formats except CommonJS and UMD assume that they run in a browser environment where `URL` and `document` are available. diff --git a/src/Chunk.ts b/src/Chunk.ts index dd9327397..93b36968d 100644 --- a/src/Chunk.ts +++ b/src/Chunk.ts @@ -1189,7 +1189,12 @@ export default class Chunk { renderedModules, snippets } = this; - const { compact, dynamicImportFunction, format, freeze, namespaceToStringTag } = outputOptions; + const { + compact, + format, + freeze, + generatedCode: { symbols } + } = outputOptions; const { _, cnst, n } = snippets; this.setDynamicImportResolutions(fileName); this.setImportMetaResolutions(fileName); @@ -1204,14 +1209,13 @@ export default class Chunk { const renderOptions: RenderOptions = { accessedDocumentCurrentScript: false, - dynamicImportFunction, exportNamesByVariable, format, freeze, indent, - namespaceToStringTag, pluginDriver, snippets, + symbols, useOriginalName: null }; @@ -1319,8 +1323,13 @@ export default class Chunk { } private setIdentifierRenderResolutions() { - const { format, interop, namespaceToStringTag, preserveModules, externalLiveBindings } = - this.outputOptions; + const { + format, + generatedCode: { symbols }, + interop, + preserveModules, + externalLiveBindings + } = this.outputOptions; const syntheticExports = new Set(); for (const exportName of this.getExportNames()) { const exportVariable = this.exportsByName.get(exportName)!; @@ -1347,7 +1356,7 @@ export default class Chunk { if (this.needsExportsShim) { usedNames.add(MISSING_EXPORT_SHIM_VARIABLE); } - if (namespaceToStringTag) { + if (symbols) { usedNames.add('Symbol'); } switch (format) { diff --git a/src/ExternalModule.ts b/src/ExternalModule.ts index 33b1a7c1f..8be02eee9 100644 --- a/src/ExternalModule.ts +++ b/src/ExternalModule.ts @@ -3,8 +3,7 @@ import type { CustomPluginOptions, ModuleInfo, NormalizedInputOptions } from './ import { EMPTY_ARRAY } from './utils/blank'; import { makeLegal } from './utils/identifierHelpers'; import { LOGLEVEL_WARN } from './utils/logging'; -import { logUnusedExternalImports, warnDeprecation } from './utils/logs'; -import { URL_THIS_GETMODULEINFO } from './utils/urls'; +import { logUnusedExternalImports } from './utils/logs'; export default class ExternalModule { readonly dynamicImporters: string[] = []; @@ -31,7 +30,7 @@ export default class ExternalModule { this.suggestedVariableName = makeLegal(id.split(/[/\\]/).pop()!); const { importers, dynamicImporters } = this; - const info: ModuleInfo = (this.info = { + this.info = { ast: null, attributes, code: null, @@ -43,15 +42,6 @@ export default class ExternalModule { exportedBindings: null, exports: null, hasDefaultExport: null, - get hasModuleSideEffects() { - warnDeprecation( - 'Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', - URL_THIS_GETMODULEINFO, - true, - options - ); - return info.moduleSideEffects; - }, id, implicitlyLoadedAfterOneOf: EMPTY_ARRAY, implicitlyLoadedBefore: EMPTY_ARRAY, @@ -66,11 +56,7 @@ export default class ExternalModule { meta, moduleSideEffects, syntheticNamedExports: false - }); - // Hide the deprecated key so that it only warns when accessed explicitly - Object.defineProperty(this.info, 'hasModuleSideEffects', { - enumerable: false - }); + }; } getVariableForExportName(name: string): [variable: ExternalVariable] { diff --git a/src/Module.ts b/src/Module.ts index 224345c29..df3ac8b15 100644 --- a/src/Module.ts +++ b/src/Module.ts @@ -66,8 +66,7 @@ import { logNamespaceConflict, logParseError, logShimmedExport, - logSyntheticNamedExportsNeedNamespaceExport, - warnDeprecation + logSyntheticNamedExportsNeedNamespaceExport } from './utils/logs'; import { doAttributesDiffer, @@ -78,7 +77,6 @@ import type { PureFunctions } from './utils/pureFunctions'; import type { RenderOptions } from './utils/renderHelpers'; import { timeEnd, timeStart } from './utils/timers'; import { markModuleAndImpureDependenciesAsExecuted } from './utils/traverseStaticDependencies'; -import { URL_THIS_GETMODULEINFO } from './utils/urls'; import { MISSING_EXPORT_SHIM_VARIABLE } from './utils/variableNames'; interface ImportDescription { @@ -331,15 +329,6 @@ export default class Module { } return module.exports.has('default') || reexportDescriptions.has('default'); }, - get hasModuleSideEffects() { - warnDeprecation( - 'Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', - URL_THIS_GETMODULEINFO, - true, - options - ); - return this.moduleSideEffects; - }, id, get implicitlyLoadedAfterOneOf() { // eslint-disable-next-line unicorn/prefer-spread @@ -380,11 +369,6 @@ export default class Module { moduleSideEffects, syntheticNamedExports }; - // Hide the deprecated key so that it only warns when accessed explicitly - // eslint-disable-next-line unicorn/consistent-destructuring - Object.defineProperty(this.info, 'hasModuleSideEffects', { - enumerable: false - }); } basename(): string { diff --git a/src/ast/nodes/ImportExpression.ts b/src/ast/nodes/ImportExpression.ts index 386ca5042..783092e02 100644 --- a/src/ast/nodes/ImportExpression.ts +++ b/src/ast/nodes/ImportExpression.ts @@ -266,7 +266,6 @@ export default class ImportExpression extends NodeBase { exportMode: 'none' | 'named' | 'default' | 'external', { compact, - dynamicImportFunction, dynamicImportInCjs, format, generatedCode: { arrowFunctions }, @@ -362,17 +361,6 @@ export default class ImportExpression extends NodeBase { } }; } - case 'es': { - if (dynamicImportFunction) { - return { - helper: null, - mechanism: { - left: `${dynamicImportFunction}(`, - right: ')' - } - }; - } - } } return { helper: null, mechanism: null }; } diff --git a/src/ast/variables/NamespaceVariable.ts b/src/ast/variables/NamespaceVariable.ts index 3ba0e5a20..94509b94a 100644 --- a/src/ast/variables/NamespaceVariable.ts +++ b/src/ast/variables/NamespaceVariable.ts @@ -129,7 +129,7 @@ export default class NamespaceVariable extends Variable { format, freeze, indent: t, - namespaceToStringTag, + symbols, snippets: { _, cnst, getObject, getPropertyAccess, n, s } } = options; const memberVariables = this.getMemberVariables(); @@ -157,7 +157,7 @@ export default class NamespaceVariable extends Variable { )}])`; } else { // The helper to merge namespaces will also take care of freezing and toStringTag - if (namespaceToStringTag) { + if (symbols) { output = `/*#__PURE__*/Object.defineProperty(${output},${_}Symbol.toStringTag,${_}${getToStringTagValue( getObject )})`; diff --git a/src/finalisers/amd.ts b/src/finalisers/amd.ts index 4ea6c6650..a81b942bc 100644 --- a/src/finalisers/amd.ts +++ b/src/finalisers/amd.ts @@ -30,8 +30,8 @@ export default function amd( esModule, externalLiveBindings, freeze, + generatedCode: { symbols }, interop, - namespaceToStringTag, strict }: NormalizedOutputOptions ): void { @@ -69,7 +69,7 @@ export default function amd( interop, externalLiveBindings, freeze, - namespaceToStringTag, + symbols, accessedGlobals, t, snippets @@ -88,7 +88,7 @@ export default function amd( let namespaceMarkers = getNamespaceMarkers( namedExportsMode && hasExports, isEntryFacade && (esModule === true || (esModule === 'if-default-prop' && hasDefaultExport)), - isModuleFacade && namespaceToStringTag, + isModuleFacade && symbols, snippets ); if (namespaceMarkers) { diff --git a/src/finalisers/cjs.ts b/src/finalisers/cjs.ts index 28fc9382e..c52e8e5ae 100644 --- a/src/finalisers/cjs.ts +++ b/src/finalisers/cjs.ts @@ -28,7 +28,7 @@ export default function cjs( externalLiveBindings, freeze, interop, - namespaceToStringTag, + generatedCode: { symbols }, strict }: NormalizedOutputOptions ): void { @@ -38,7 +38,7 @@ export default function cjs( let namespaceMarkers = getNamespaceMarkers( namedExportsMode && hasExports, isEntryFacade && (esModule === true || (esModule === 'if-default-prop' && hasDefaultExport)), - isModuleFacade && namespaceToStringTag, + isModuleFacade && symbols, snippets ); if (namespaceMarkers) { @@ -50,7 +50,7 @@ export default function cjs( interop, externalLiveBindings, freeze, - namespaceToStringTag, + symbols, accessedGlobals, t, snippets diff --git a/src/finalisers/es.ts b/src/finalisers/es.ts index 372109e4c..565cc08a3 100644 --- a/src/finalisers/es.ts +++ b/src/finalisers/es.ts @@ -8,7 +8,7 @@ import type { FinaliserOptions } from './index'; export default function es( magicString: MagicStringBundle, { accessedGlobals, indent: t, intro, outro, dependencies, exports, snippets }: FinaliserOptions, - { externalLiveBindings, freeze, namespaceToStringTag }: NormalizedOutputOptions + { externalLiveBindings, freeze, generatedCode: { symbols } }: NormalizedOutputOptions ): void { const { n } = snippets; @@ -21,7 +21,7 @@ export default function es( snippets, externalLiveBindings, freeze, - namespaceToStringTag + symbols ); if (intro) magicString.prepend(intro); diff --git a/src/finalisers/iife.ts b/src/finalisers/iife.ts index 752bd28aa..c8962785e 100644 --- a/src/finalisers/iife.ts +++ b/src/finalisers/iife.ts @@ -39,7 +39,7 @@ export default function iife( globals, interop, name, - namespaceToStringTag, + generatedCode: { symbols }, strict }: NormalizedOutputOptions ): void { @@ -82,7 +82,7 @@ export default function iife( interop, externalLiveBindings, freeze, - namespaceToStringTag, + symbols, accessedGlobals, t, snippets @@ -121,7 +121,7 @@ export default function iife( let namespaceMarkers = getNamespaceMarkers( namedExportsMode && hasExports, esModule === true || (esModule === 'if-default-prop' && hasDefaultExport), - namespaceToStringTag, + symbols, snippets ); if (namespaceMarkers) { diff --git a/src/finalisers/shared/getInteropBlock.ts b/src/finalisers/shared/getInteropBlock.ts index 2c7bbeff6..374f89746 100644 --- a/src/finalisers/shared/getInteropBlock.ts +++ b/src/finalisers/shared/getInteropBlock.ts @@ -13,7 +13,7 @@ export default function getInteropBlock( interop: GetInterop, externalLiveBindings: boolean, freeze: boolean, - namespaceToStringTag: boolean, + symbols: boolean, accessedGlobals: Set, indent: string, snippets: GenerateCodeSnippets @@ -93,6 +93,6 @@ export default function getInteropBlock( snippets, externalLiveBindings, freeze, - namespaceToStringTag + symbols )}${interopStatements.length > 0 ? `${interopStatements.join(n)}${n}${n}` : ''}`; } diff --git a/src/finalisers/system.ts b/src/finalisers/system.ts index 49f07bd4d..090a44360 100644 --- a/src/finalisers/system.ts +++ b/src/finalisers/system.ts @@ -23,7 +23,7 @@ export default function system( externalLiveBindings, freeze, name, - namespaceToStringTag, + generatedCode: { symbols }, strict, systemNullSetters }: NormalizedOutputOptions @@ -79,15 +79,7 @@ export default function system( magicString .prepend( intro + - getHelpersBlock( - null, - accessedGlobals, - t, - snippets, - externalLiveBindings, - freeze, - namespaceToStringTag - ) + + getHelpersBlock(null, accessedGlobals, t, snippets, externalLiveBindings, freeze, symbols) + getHoistedExportsBlock(exports, t, snippets) ) .append( diff --git a/src/finalisers/umd.ts b/src/finalisers/umd.ts index 912a6c6e4..e4cecbffc 100644 --- a/src/finalisers/umd.ts +++ b/src/finalisers/umd.ts @@ -58,7 +58,7 @@ export default function umd( freeze, interop, name, - namespaceToStringTag, + generatedCode: { symbols }, globals, noConflict, strict @@ -188,7 +188,7 @@ export default function umd( interop, externalLiveBindings, freeze, - namespaceToStringTag, + symbols, accessedGlobals, t, snippets @@ -207,7 +207,7 @@ export default function umd( let namespaceMarkers = getNamespaceMarkers( namedExportsMode && hasExports, esModule === true || (esModule === 'if-default-prop' && hasDefaultExport), - namespaceToStringTag, + symbols, snippets ); if (namespaceMarkers) { diff --git a/src/rollup/types.d.ts b/src/rollup/types.d.ts index 1a446a9d2..aeeb213da 100644 --- a/src/rollup/types.d.ts +++ b/src/rollup/types.d.ts @@ -181,8 +181,6 @@ interface ModuleInfo extends ModuleOptions { exportedBindings: Record | null; exports: string[] | null; hasDefaultExport: boolean | null; - /** @deprecated Use `moduleSideEffects` instead */ - hasModuleSideEffects: boolean | 'no-treeshake'; id: string; implicitlyLoadedAfterOneOf: readonly string[]; implicitlyLoadedBefore: readonly string[]; @@ -219,8 +217,6 @@ export interface PluginContext extends MinimalPluginContext { load: ( options: { id: string; resolveDependencies?: boolean } & Partial> ) => Promise; - /** @deprecated Use `this.getModuleIds` instead */ - moduleIds: IterableIterator; parse: (input: string) => AstNode; resolve: ( source: string, @@ -287,8 +283,6 @@ export type IsExternal = ( isResolved: boolean ) => boolean; -export type IsPureModule = (id: string) => boolean | NullValue; - export type HasModuleSideEffects = (id: string, external: boolean) => boolean; export type LoadResult = SourceDescription | string | NullValue; @@ -571,24 +565,16 @@ export interface InputOptions { experimentalCacheExpiry?: number; experimentalLogSideEffects?: boolean; external?: ExternalOption; - /** @deprecated Use the "inlineDynamicImports" output option instead. */ - inlineDynamicImports?: boolean; input?: InputOption; logLevel?: LogLevelOption; makeAbsoluteExternalsRelative?: boolean | 'ifRelativeSource'; - /** @deprecated Use the "manualChunks" output option instead. */ - manualChunks?: ManualChunksOption; maxParallelFileOps?: number; - /** @deprecated Use the "maxParallelFileOps" option instead. */ - maxParallelFileReads?: number; moduleContext?: ((id: string) => string | NullValue) | { [id: string]: string }; onLog?: LogHandlerWithDefault; onwarn?: WarningHandlerWithDefault; perf?: boolean; plugins?: InputPluginOption; preserveEntrySignatures?: PreserveEntrySignaturesOption; - /** @deprecated Use the "preserveModules" output option instead. */ - preserveModules?: boolean; preserveSymlinks?: boolean; shimMissingExports?: boolean; strictDeprecations?: boolean; @@ -606,24 +592,16 @@ export interface NormalizedInputOptions { experimentalCacheExpiry: number; experimentalLogSideEffects: boolean; external: IsExternal; - /** @deprecated Use the "inlineDynamicImports" output option instead. */ - inlineDynamicImports: boolean | undefined; input: string[] | { [entryAlias: string]: string }; logLevel: LogLevelOption; makeAbsoluteExternalsRelative: boolean | 'ifRelativeSource'; - /** @deprecated Use the "manualChunks" output option instead. */ - manualChunks: ManualChunksOption | undefined; maxParallelFileOps: number; - /** @deprecated Use the "maxParallelFileOps" option instead. */ - maxParallelFileReads: number; moduleContext: (id: string) => string; onLog: LogHandler; onwarn: (warning: RollupLog) => void; perf: boolean; plugins: Plugin[]; preserveEntrySignatures: PreserveEntrySignaturesOption; - /** @deprecated Use the "preserveModules" output option instead. */ - preserveModules: boolean | undefined; preserveSymlinks: boolean; shimMissingExports: boolean; strictDeprecations: boolean; @@ -699,13 +677,9 @@ export interface OutputOptions { compact?: boolean; // only required for bundle.write dir?: string; - /** @deprecated Use the "renderDynamicImport" plugin hook instead. */ - dynamicImportFunction?: string; dynamicImportInCjs?: boolean; entryFileNames?: string | ((chunkInfo: PreRenderedChunk) => string); esModule?: boolean | 'if-default-prop'; - /** @deprecated This option is no longer needed and ignored. */ - experimentalDeepDynamicChunkOptimization?: boolean; experimentalMinChunkSize?: number; exports?: 'default' | 'named' | 'none' | 'auto'; extend?: boolean; @@ -728,14 +702,10 @@ export interface OutputOptions { manualChunks?: ManualChunksOption; minifyInternalExports?: boolean; name?: string; - /** @deprecated Use "generatedCode.symbols" instead. */ - namespaceToStringTag?: boolean; noConflict?: boolean; outro?: string | AddonFunction; paths?: OptionsPaths; plugins?: OutputPluginOption; - /** @deprecated Use "generatedCode.constBindings" instead. */ - preferConst?: boolean; preserveModules?: boolean; preserveModulesRoot?: string; sanitizeFileName?: boolean | ((fileName: string) => string); @@ -758,13 +728,9 @@ export interface NormalizedOutputOptions { chunkFileNames: string | ((chunkInfo: PreRenderedChunk) => string); compact: boolean; dir: string | undefined; - /** @deprecated Use the "renderDynamicImport" plugin hook instead. */ - dynamicImportFunction: string | undefined; dynamicImportInCjs: boolean; entryFileNames: string | ((chunkInfo: PreRenderedChunk) => string); esModule: boolean | 'if-default-prop'; - /** @deprecated This option is no longer needed and ignored. */ - experimentalDeepDynamicChunkOptimization: boolean; experimentalMinChunkSize: number; exports: 'default' | 'named' | 'none' | 'auto'; extend: boolean; @@ -786,14 +752,10 @@ export interface NormalizedOutputOptions { manualChunks: ManualChunksOption; minifyInternalExports: boolean; name: string | undefined; - /** @deprecated Use "generatedCode.symbols" instead. */ - namespaceToStringTag: boolean; noConflict: boolean; outro: AddonFunction; paths: OptionsPaths; plugins: OutputPlugin[]; - /** @deprecated Use "generatedCode.constBindings" instead. */ - preferConst: boolean; preserveModules: boolean; preserveModulesRoot: string | undefined; sanitizeFileName: (fileName: string) => string; diff --git a/src/utils/PluginContext.ts b/src/utils/PluginContext.ts index 7fff45919..88c62dbf6 100644 --- a/src/utils/PluginContext.ts +++ b/src/utils/PluginContext.ts @@ -13,15 +13,9 @@ import { BLANK, EMPTY_OBJECT } from './blank'; import { BuildPhase } from './buildPhase'; import { getLogHandler } from './logHandler'; import { LOGLEVEL_DEBUG, LOGLEVEL_INFO, LOGLEVEL_WARN } from './logging'; -import { - error, - logInvalidRollupPhaseForAddWatchFile, - logPluginError, - warnDeprecation -} from './logs'; +import { error, logInvalidRollupPhaseForAddWatchFile, logPluginError } from './logs'; import { normalizeLog } from './options/options'; import { ANONYMOUS_OUTPUT_PLUGIN_PREFIX, ANONYMOUS_PLUGIN_PREFIX } from './pluginUtils'; -import { URL_THIS_GETMODULEIDS } from './urls'; export function getPluginContext( plugin: Plugin, @@ -82,22 +76,6 @@ export function getPluginContext( rollupVersion, watchMode: graph.watchMode }, - get moduleIds() { - function* wrappedModuleIds() { - // We are wrapping this in a generator to only show the message once we are actually iterating - warnDeprecation( - `Accessing "this.moduleIds" on the plugin context by plugin ${plugin.name} is deprecated. The "this.getModuleIds" plugin context function should be used instead.`, - URL_THIS_GETMODULEIDS, - true, - options, - plugin.name - ); - yield* moduleIds; - } - - const moduleIds = graph.modulesById.keys(); - return wrappedModuleIds(); - }, parse: graph.contextParse.bind(graph), resolve(source, importer, { attributes, custom, isEntry, skipSelf } = BLANK) { skipSelf ??= true; diff --git a/src/utils/interopHelpers.ts b/src/utils/interopHelpers.ts index 5d28acd92..94f399a0c 100644 --- a/src/utils/interopHelpers.ts +++ b/src/utils/interopHelpers.ts @@ -45,7 +45,7 @@ export const getHelpersBlock = ( snippets: GenerateCodeSnippets, liveBindings: boolean, freeze: boolean, - namespaceToStringTag: boolean + symbols: boolean ): string => { const usedHelpers = new Set(additionalHelpers); for (const variable of HELPER_NAMES) { @@ -55,14 +55,7 @@ export const getHelpersBlock = ( } return HELPER_NAMES.map(variable => usedHelpers.has(variable) - ? HELPER_GENERATORS[variable]( - indent, - snippets, - liveBindings, - freeze, - namespaceToStringTag, - usedHelpers - ) + ? HELPER_GENERATORS[variable](indent, snippets, liveBindings, freeze, symbols, usedHelpers) : '' ).join(''); }; @@ -73,7 +66,7 @@ const HELPER_GENERATORS: { snippets: GenerateCodeSnippets, liveBindings: boolean, freeze: boolean, - namespaceToStringTag: boolean, + symbols: boolean, usedHelpers: ReadonlySet ) => string; } = { @@ -108,14 +101,7 @@ const HELPER_GENERATORS: { }${right}${n}${n}` ); }, - [INTEROP_NAMESPACE_COMPAT_VARIABLE]( - t, - snippets, - liveBindings, - freeze, - namespaceToStringTag, - usedHelpers - ) { + [INTEROP_NAMESPACE_COMPAT_VARIABLE](t, snippets, liveBindings, freeze, symbols, usedHelpers) { const { _, getDirectReturnFunction, n } = snippets; if (usedHelpers.has(INTEROP_NAMESPACE_DEFAULT_VARIABLE)) { const [left, right] = getDirectReturnFunction(['e'], { @@ -130,7 +116,7 @@ const HELPER_GENERATORS: { return ( `function ${INTEROP_NAMESPACE_COMPAT_VARIABLE}(e)${_}{${n}` + `${t}if${_}(${getIsCompatNamespace(snippets)})${_}return e;${n}` + - createNamespaceObject(t, t, snippets, liveBindings, freeze, namespaceToStringTag) + + createNamespaceObject(t, t, snippets, liveBindings, freeze, symbols) + `}${n}${n}` ); }, @@ -139,7 +125,7 @@ const HELPER_GENERATORS: { snippets, _liveBindings: boolean, freeze: boolean, - namespaceToStringTag: boolean + symbols: boolean ) { const { getDirectReturnFunction, getObject, n } = snippets; const [left, right] = getDirectReturnFunction(['e'], { @@ -150,7 +136,7 @@ const HELPER_GENERATORS: { return `${left}${getFrozen( freeze, getWithToStringTag( - namespaceToStringTag, + symbols, getObject( [ ['__proto__', 'null'], @@ -162,22 +148,15 @@ const HELPER_GENERATORS: { ) )}${right}${n}${n}`; }, - [INTEROP_NAMESPACE_DEFAULT_VARIABLE](t, snippets, liveBindings, freeze, namespaceToStringTag) { + [INTEROP_NAMESPACE_DEFAULT_VARIABLE](t, snippets, liveBindings, freeze, symbols) { const { _, n } = snippets; return ( `function ${INTEROP_NAMESPACE_DEFAULT_VARIABLE}(e)${_}{${n}` + - createNamespaceObject(t, t, snippets, liveBindings, freeze, namespaceToStringTag) + + createNamespaceObject(t, t, snippets, liveBindings, freeze, symbols) + `}${n}${n}` ); }, - [INTEROP_NAMESPACE_VARIABLE]( - t, - snippets, - liveBindings, - freeze, - namespaceToStringTag, - usedHelpers - ) { + [INTEROP_NAMESPACE_VARIABLE](t, snippets, liveBindings, freeze, symbols, usedHelpers) { const { _, getDirectReturnFunction, n } = snippets; if (usedHelpers.has(INTEROP_NAMESPACE_DEFAULT_VARIABLE)) { const [left, right] = getDirectReturnFunction(['e'], { @@ -190,11 +169,11 @@ const HELPER_GENERATORS: { return ( `function ${INTEROP_NAMESPACE_VARIABLE}(e)${_}{${n}` + `${t}if${_}(e${_}&&${_}e.__esModule)${_}return e;${n}` + - createNamespaceObject(t, t, snippets, liveBindings, freeze, namespaceToStringTag) + + createNamespaceObject(t, t, snippets, liveBindings, freeze, symbols) + `}${n}${n}` ); }, - [MERGE_NAMESPACES_VARIABLE](t, snippets, liveBindings, freeze, namespaceToStringTag) { + [MERGE_NAMESPACES_VARIABLE](t, snippets, liveBindings, freeze, symbols) { const { _, cnst, n } = snippets; const useForEach = cnst === 'var' && liveBindings; return ( @@ -213,10 +192,7 @@ const HELPER_GENERATORS: { t, snippets )}${n}` + - `${t}return ${getFrozen( - freeze, - getWithToStringTag(namespaceToStringTag, 'n', snippets) - )};${n}` + + `${t}return ${getFrozen(freeze, getWithToStringTag(symbols, 'n', snippets))};${n}` + `}${n}${n}` ); } @@ -237,7 +213,7 @@ const createNamespaceObject = ( snippets: GenerateCodeSnippets, liveBindings: boolean, freeze: boolean, - namespaceToStringTag: boolean + symbols: boolean ) => { const { _, cnst, getObject, getPropertyAccess, n, s } = snippets; const copyProperty = @@ -250,9 +226,7 @@ const createNamespaceObject = ( `${index}${t}}`; return ( `${index}${cnst} n${_}=${_}Object.create(null${ - namespaceToStringTag - ? `,${_}{${_}[Symbol.toStringTag]:${_}${getToStringTagValue(getObject)}${_}}` - : '' + symbols ? `,${_}{${_}[Symbol.toStringTag]:${_}${getToStringTagValue(getObject)}${_}}` : '' });${n}` + `${index}if${_}(e)${_}{${n}` + `${index}${t}${loopOverKeys(copyProperty, !liveBindings, snippets)}${n}` + @@ -364,11 +338,11 @@ const getFrozen = (freeze: boolean, fragment: string) => freeze ? `Object.freeze(${fragment})` : fragment; const getWithToStringTag = ( - namespaceToStringTag: boolean, + symbols: boolean, fragment: string, { _, getObject }: GenerateCodeSnippets ) => - namespaceToStringTag + symbols ? `Object.defineProperty(${fragment},${_}Symbol.toStringTag,${_}${getToStringTagValue( getObject )})` diff --git a/src/utils/options/mergeOptions.ts b/src/utils/options/mergeOptions.ts index 9080ddb26..a77e3ad93 100644 --- a/src/utils/options/mergeOptions.ts +++ b/src/utils/options/mergeOptions.ts @@ -132,20 +132,16 @@ function mergeInputOptions( experimentalCacheExpiry: getOption('experimentalCacheExpiry'), experimentalLogSideEffects: getOption('experimentalLogSideEffects'), external: getExternal(config, overrides), - inlineDynamicImports: getOption('inlineDynamicImports'), input: getOption('input') || [], logLevel: getOption('logLevel'), makeAbsoluteExternalsRelative: getOption('makeAbsoluteExternalsRelative'), - manualChunks: getOption('manualChunks'), maxParallelFileOps: getOption('maxParallelFileOps'), - maxParallelFileReads: getOption('maxParallelFileReads'), moduleContext: getOption('moduleContext'), onLog, onwarn: undefined, perf: getOption('perf'), plugins, preserveEntrySignatures: getOption('preserveEntrySignatures'), - preserveModules: getOption('preserveModules'), preserveSymlinks: getOption('preserveSymlinks'), shimMissingExports: getOption('shimMissingExports'), strictDeprecations: getOption('strictDeprecations'), @@ -230,11 +226,9 @@ async function mergeOutputOptions( chunkFileNames: getOption('chunkFileNames'), compact: getOption('compact'), dir: getOption('dir'), - dynamicImportFunction: getOption('dynamicImportFunction'), dynamicImportInCjs: getOption('dynamicImportInCjs'), entryFileNames: getOption('entryFileNames'), esModule: getOption('esModule'), - experimentalDeepDynamicChunkOptimization: getOption('experimentalDeepDynamicChunkOptimization'), experimentalMinChunkSize: getOption('experimentalMinChunkSize'), exports: getOption('exports'), extend: getOption('extend'), @@ -265,12 +259,10 @@ async function mergeOutputOptions( manualChunks: getOption('manualChunks'), minifyInternalExports: getOption('minifyInternalExports'), name: getOption('name'), - namespaceToStringTag: getOption('namespaceToStringTag'), noConflict: getOption('noConflict'), outro: getOption('outro'), paths: getOption('paths'), plugins: await normalizePluginOption(config.plugins), - preferConst: getOption('preferConst'), preserveModules: getOption('preserveModules'), preserveModulesRoot: getOption('preserveModulesRoot'), sanitizeFileName: getOption('sanitizeFileName'), diff --git a/src/utils/options/normalizeInputOptions.ts b/src/utils/options/normalizeInputOptions.ts index ed938e5ee..18b9b59fa 100644 --- a/src/utils/options/normalizeInputOptions.ts +++ b/src/utils/options/normalizeInputOptions.ts @@ -1,7 +1,6 @@ import type { HasModuleSideEffects, InputOptions, - LogHandler, ModuleSideEffectsOption, NormalizedInputOptions, RollupBuild @@ -10,16 +9,9 @@ import { EMPTY_ARRAY } from '../blank'; import { ensureArray } from '../ensureArray'; import { getLogger } from '../logger'; import { LOGLEVEL_INFO, LOGLEVEL_WARN } from '../logging'; -import { error, logInvalidOption, warnDeprecationWithOptions } from '../logs'; +import { error, logInvalidOption } from '../logs'; import { resolve } from '../path'; -import { - URL_MAXPARALLELFILEOPS, - URL_OUTPUT_INLINEDYNAMICIMPORTS, - URL_OUTPUT_MANUALCHUNKS, - URL_OUTPUT_PRESERVEMODULES, - URL_TREESHAKE, - URL_TREESHAKE_MODULESIDEEFFECTS -} from '../urls'; +import { URL_TREESHAKE, URL_TREESHAKE_MODULESIDEEFFECTS } from '../urls'; import { getOnLog, getOptionWithPreset, @@ -50,27 +42,23 @@ export async function normalizeInputOptions( const logLevel = config.logLevel || LOGLEVEL_INFO; const onLog = getLogger(plugins, getOnLog(config, logLevel), watchMode, logLevel); const strictDeprecations = config.strictDeprecations || false; - const maxParallelFileOps = getMaxParallelFileOps(config, onLog, strictDeprecations); + const maxParallelFileOps = getMaxParallelFileOps(config); const options: NormalizedInputOptions & InputOptions = { cache: getCache(config), context, experimentalCacheExpiry: config.experimentalCacheExpiry ?? 10, experimentalLogSideEffects: config.experimentalLogSideEffects || false, external: getIdMatcher(config.external), - inlineDynamicImports: getInlineDynamicImports(config, onLog, strictDeprecations), input: getInput(config), logLevel, makeAbsoluteExternalsRelative: config.makeAbsoluteExternalsRelative ?? 'ifRelativeSource', - manualChunks: getManualChunks(config, onLog, strictDeprecations), maxParallelFileOps, - maxParallelFileReads: maxParallelFileOps, moduleContext: getModuleContext(config, context), onLog, onwarn: warning => onLog(LOGLEVEL_WARN, warning), perf: config.perf || false, plugins, preserveEntrySignatures: config.preserveEntrySignatures ?? 'exports-only', - preserveModules: getPreserveModules(config, onLog, strictDeprecations), preserveSymlinks: config.preserveSymlinks || false, shimMissingExports: config.shimMissingExports || false, strictDeprecations, @@ -122,63 +110,15 @@ const getIdMatcher = >( return () => false; }; -const getInlineDynamicImports = ( - config: InputOptions, - log: LogHandler, - strictDeprecations: boolean -): NormalizedInputOptions['inlineDynamicImports'] => { - const configInlineDynamicImports = config.inlineDynamicImports; - if (configInlineDynamicImports) { - warnDeprecationWithOptions( - 'The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', - URL_OUTPUT_INLINEDYNAMICIMPORTS, - true, - log, - strictDeprecations - ); - } - return configInlineDynamicImports; -}; - const getInput = (config: InputOptions): NormalizedInputOptions['input'] => { const configInput = config.input; return configInput == null ? [] : typeof configInput === 'string' ? [configInput] : configInput; }; -const getManualChunks = ( - config: InputOptions, - log: LogHandler, - strictDeprecations: boolean -): NormalizedInputOptions['manualChunks'] => { - const configManualChunks = config.manualChunks; - if (configManualChunks) { - warnDeprecationWithOptions( - 'The "manualChunks" option is deprecated. Use the "output.manualChunks" option instead.', - URL_OUTPUT_MANUALCHUNKS, - true, - log, - strictDeprecations - ); - } - return configManualChunks; -}; - const getMaxParallelFileOps = ( - config: InputOptions, - log: LogHandler, - strictDeprecations: boolean + config: InputOptions ): NormalizedInputOptions['maxParallelFileOps'] => { - const maxParallelFileReads = config.maxParallelFileReads; - if (typeof maxParallelFileReads === 'number') { - warnDeprecationWithOptions( - 'The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.', - URL_MAXPARALLELFILEOPS, - true, - log, - strictDeprecations - ); - } - const maxParallelFileOps = config.maxParallelFileOps ?? maxParallelFileReads; + const maxParallelFileOps = config.maxParallelFileOps; if (typeof maxParallelFileOps === 'number') { if (maxParallelFileOps <= 0) return Infinity; return maxParallelFileOps; @@ -206,24 +146,6 @@ const getModuleContext = ( return () => context; }; -const getPreserveModules = ( - config: InputOptions, - log: LogHandler, - strictDeprecations: boolean -): NormalizedInputOptions['preserveModules'] => { - const configPreserveModules = config.preserveModules; - if (configPreserveModules) { - warnDeprecationWithOptions( - 'The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.', - URL_OUTPUT_PRESERVEMODULES, - true, - log, - strictDeprecations - ); - } - return configPreserveModules; -}; - const getTreeshake = (config: InputOptions): NormalizedInputOptions['treeshake'] => { const configTreeshake = config.treeshake; if (configTreeshake === false) { diff --git a/src/utils/options/normalizeOutputOptions.ts b/src/utils/options/normalizeOutputOptions.ts index 231f50986..4ba7cd521 100644 --- a/src/utils/options/normalizeOutputOptions.ts +++ b/src/utils/options/normalizeOutputOptions.ts @@ -6,7 +6,6 @@ import type { OutputOptions, SourcemapPathTransformOption } from '../../rollup/types'; -import { LOGLEVEL_WARN } from '../logging'; import { error, logInvalidExportOptionValue, logInvalidOption, warnDeprecation } from '../logs'; import { resolve } from '../path'; import { sanitizeFileName as defaultSanitizeFileName } from '../sanitizeFileName'; @@ -15,19 +14,14 @@ import { URL_OUTPUT_AMD_BASEPATH, URL_OUTPUT_AMD_ID, URL_OUTPUT_DIR, - URL_OUTPUT_DYNAMICIMPORTFUNCTION, - URL_OUTPUT_EXPERIMENTALDEEPCHUNKOPTIMIZATION, URL_OUTPUT_EXTERNALIMPORTATTRIBUTES, URL_OUTPUT_FORMAT, URL_OUTPUT_GENERATEDCODE, - URL_OUTPUT_GENERATEDCODE_CONSTBINDINGS, - URL_OUTPUT_GENERATEDCODE_SYMBOLS, URL_OUTPUT_INLINEDYNAMICIMPORTS, URL_OUTPUT_INTEROP, URL_OUTPUT_MANUALCHUNKS, URL_OUTPUT_SOURCEMAPBASEURL, - URL_PRESERVEENTRYSIGNATURES, - URL_RENDERDYNAMICIMPORT + URL_PRESERVEENTRYSIGNATURES } from '../urls'; import { generatedCodePresets, @@ -50,8 +44,7 @@ export async function normalizeOutputOptions( const inlineDynamicImports = getInlineDynamicImports(config, inputOptions); const preserveModules = getPreserveModules(config, inlineDynamicImports, inputOptions); const file = getFile(config, preserveModules, inputOptions); - const preferConst = getPreferConst(config, inputOptions); - const generatedCode = getGeneratedCode(config, preferConst); + const generatedCode = getGeneratedCode(config); const externalImportAttributes = getExternalImportAttributes(config, inputOptions); const outputOptions: NormalizedOutputOptions & OutputOptions = { @@ -61,14 +54,9 @@ export async function normalizeOutputOptions( chunkFileNames: config.chunkFileNames ?? '[name]-[hash].js', compact, dir: getDir(config, file), - dynamicImportFunction: getDynamicImportFunction(config, inputOptions, format), dynamicImportInCjs: config.dynamicImportInCjs ?? true, entryFileNames: getEntryFileNames(config, unsetOptions), esModule: config.esModule ?? 'if-default-prop', - experimentalDeepDynamicChunkOptimization: getExperimentalDeepDynamicChunkOptimization( - config, - inputOptions - ), experimentalMinChunkSize: config.experimentalMinChunkSize ?? 1, exports: getExports(config, unsetOptions), extend: config.extend || false, @@ -86,15 +74,13 @@ export async function normalizeOutputOptions( inlineDynamicImports, interop: getInterop(config), intro: getAddon(config, 'intro'), - manualChunks: getManualChunks(config, inlineDynamicImports, preserveModules, inputOptions), + manualChunks: getManualChunks(config, inlineDynamicImports, preserveModules), minifyInternalExports: getMinifyInternalExports(config, format, compact), name: config.name, - namespaceToStringTag: getNamespaceToStringTag(config, generatedCode, inputOptions), noConflict: config.noConflict || false, outro: getAddon(config, 'outro'), paths: config.paths || {}, plugins: await normalizePluginOption(config.plugins), - preferConst, preserveModules, preserveModulesRoot: getPreserveModulesRoot(config), sanitizeFileName: @@ -193,8 +179,7 @@ const getInlineDynamicImports = ( config: OutputOptions, inputOptions: NormalizedInputOptions ): NormalizedOutputOptions['inlineDynamicImports'] => { - const inlineDynamicImports = - (config.inlineDynamicImports ?? inputOptions.inlineDynamicImports) || false; + const inlineDynamicImports = config.inlineDynamicImports || false; const { input } = inputOptions; if (inlineDynamicImports && (Array.isArray(input) ? input : Object.keys(input)).length > 1) { return error( @@ -213,7 +198,7 @@ const getPreserveModules = ( inlineDynamicImports: boolean, inputOptions: NormalizedInputOptions ): NormalizedOutputOptions['preserveModules'] => { - const preserveModules = (config.preserveModules ?? inputOptions.preserveModules) || false; + const preserveModules = config.preserveModules || false; if (preserveModules) { if (inlineDynamicImports) { return error( @@ -237,22 +222,6 @@ const getPreserveModules = ( return preserveModules; }; -const getPreferConst = ( - config: OutputOptions, - inputOptions: NormalizedInputOptions -): NormalizedOutputOptions['preferConst'] => { - const configPreferConst = config.preferConst; - if (configPreferConst != null) { - warnDeprecation( - `The "output.preferConst" option is deprecated. Use the "output.generatedCode.constBindings" option instead.`, - URL_OUTPUT_GENERATEDCODE_CONSTBINDINGS, - true, - inputOptions - ); - } - return !!configPreferConst; -}; - const getPreserveModulesRoot = ( config: OutputOptions ): NormalizedOutputOptions['preserveModulesRoot'] => { @@ -341,33 +310,6 @@ const getDir = ( return dir; }; -const getDynamicImportFunction = ( - config: OutputOptions, - inputOptions: NormalizedInputOptions, - format: InternalModuleFormat -): NormalizedOutputOptions['dynamicImportFunction'] => { - const configDynamicImportFunction = config.dynamicImportFunction; - if (configDynamicImportFunction) { - warnDeprecation( - `The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.`, - URL_RENDERDYNAMICIMPORT, - true, - inputOptions - ); - if (format !== 'es') { - inputOptions.onLog( - LOGLEVEL_WARN, - logInvalidOption( - 'output.dynamicImportFunction', - URL_OUTPUT_DYNAMICIMPORTFUNCTION, - 'this option is ignored for formats other than "es"' - ) - ); - } - } - return configDynamicImportFunction; -}; - const getEntryFileNames = ( config: OutputOptions, unsetOptions: Set @@ -379,23 +321,6 @@ const getEntryFileNames = ( return configEntryFileNames ?? '[name].js'; }; -function getExperimentalDeepDynamicChunkOptimization( - config: OutputOptions, - inputOptions: NormalizedInputOptions -) { - const configExperimentalDeepDynamicChunkOptimization = - config.experimentalDeepDynamicChunkOptimization; - if (configExperimentalDeepDynamicChunkOptimization != null) { - warnDeprecation( - `The "output.experimentalDeepDynamicChunkOptimization" option is deprecated as Rollup always runs the full chunking algorithm now. The option should be removed.`, - URL_OUTPUT_EXPERIMENTALDEEPCHUNKOPTIMIZATION, - true, - inputOptions - ); - } - return configExperimentalDeepDynamicChunkOptimization || false; -} - function getExports( config: OutputOptions, unsetOptions: Set @@ -424,10 +349,7 @@ const getExternalImportAttributes = ( return config.externalImportAttributes ?? config.externalImportAssertions ?? true; }; -const getGeneratedCode = ( - config: OutputOptions, - preferConst: boolean -): NormalizedOutputOptions['generatedCode'] => { +const getGeneratedCode = (config: OutputOptions): NormalizedOutputOptions['generatedCode'] => { const configWithPreset = getOptionWithPreset( config.generatedCode, generatedCodePresets, @@ -437,7 +359,7 @@ const getGeneratedCode = ( ); return { arrowFunctions: configWithPreset.arrowFunctions === true, - constBindings: configWithPreset.constBindings === true || preferConst, + constBindings: configWithPreset.constBindings === true, objectShorthand: configWithPreset.objectShorthand === true, reservedNamesAsProps: configWithPreset.reservedNamesAsProps !== false, symbols: configWithPreset.symbols === true @@ -495,10 +417,9 @@ const validateInterop = (interop: InteropType): InteropType => { const getManualChunks = ( config: OutputOptions, inlineDynamicImports: boolean, - preserveModules: boolean, - inputOptions: NormalizedInputOptions + preserveModules: boolean ): NormalizedOutputOptions['manualChunks'] => { - const configManualChunks = config.manualChunks || inputOptions.manualChunks; + const configManualChunks = config.manualChunks; if (configManualChunks) { if (inlineDynamicImports) { return error( @@ -529,24 +450,6 @@ const getMinifyInternalExports = ( ): NormalizedOutputOptions['minifyInternalExports'] => config.minifyInternalExports ?? (compact || format === 'es' || format === 'system'); -const getNamespaceToStringTag = ( - config: OutputOptions, - generatedCode: NormalizedOutputOptions['generatedCode'], - inputOptions: NormalizedInputOptions -): NormalizedOutputOptions['namespaceToStringTag'] => { - const configNamespaceToStringTag = config.namespaceToStringTag; - if (configNamespaceToStringTag != null) { - warnDeprecation( - `The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.`, - URL_OUTPUT_GENERATEDCODE_SYMBOLS, - true, - inputOptions - ); - return configNamespaceToStringTag; - } - return generatedCode.symbols || false; -}; - const getSourcemapFileNames = ( config: OutputOptions, unsetOptions: Set diff --git a/src/utils/renderHelpers.ts b/src/utils/renderHelpers.ts index b9a6510c2..fad7311be 100644 --- a/src/utils/renderHelpers.ts +++ b/src/utils/renderHelpers.ts @@ -8,14 +8,13 @@ import { treeshakeNode } from './treeshakeNode'; export interface RenderOptions { accessedDocumentCurrentScript: boolean; - dynamicImportFunction: string | undefined; exportNamesByVariable: Map; format: InternalModuleFormat; freeze: boolean; indent: string; - namespaceToStringTag: boolean; pluginDriver: PluginDriver; snippets: GenerateCodeSnippets; + symbols: boolean; useOriginalName: ((variable: Variable) => boolean) | null; } diff --git a/src/utils/urls.ts b/src/utils/urls.ts index fbfffa918..8546606ee 100644 --- a/src/utils/urls.ts +++ b/src/utils/urls.ts @@ -12,18 +12,12 @@ export const URL_MAXPARALLELFILEOPS = 'configuration-options/#maxparallelfileops export const URL_OUTPUT_AMD_ID = 'configuration-options/#output-amd-id'; export const URL_OUTPUT_AMD_BASEPATH = 'configuration-options/#output-amd-basepath'; export const URL_OUTPUT_DIR = 'configuration-options/#output-dir'; -export const URL_OUTPUT_DYNAMICIMPORTFUNCTION = - 'configuration-options/#output-dynamicimportfunction'; export const URL_OUTPUT_EXPORTS = 'configuration-options/#output-exports'; export const URL_OUTPUT_EXTEND = 'configuration-options/#output-extend'; export const URL_OUTPUT_EXTERNALIMPORTATTRIBUTES = 'configuration-options/#output-externalimportattributes'; export const URL_OUTPUT_FORMAT = 'configuration-options/#output-format'; export const URL_OUTPUT_GENERATEDCODE = 'configuration-options/#output-generatedcode'; -export const URL_OUTPUT_EXPERIMENTALDEEPCHUNKOPTIMIZATION = - 'configuration-options/#output-experimentaldeepdynamicchunkoptimization'; -export const URL_OUTPUT_GENERATEDCODE_CONSTBINDINGS = - 'configuration-options/#output-generatedcode-constbindings'; export const URL_OUTPUT_GENERATEDCODE_SYMBOLS = 'configuration-options/#output-generatedcode-symbols'; export const URL_OUTPUT_GLOBALS = 'configuration-options/#output-globals'; diff --git a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_config.js b/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_config.js deleted file mode 100644 index b368e78bc..000000000 --- a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_config.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = defineTest({ - description: - 'avoids empty imports if they do not have side-effects when preserving modules (#3359)', - options: { - strictDeprecations: false, - preserveModules: true - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/amd/a.js b/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/amd/a.js deleted file mode 100644 index 3cffb947e..000000000 --- a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/amd/a.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - const a = 1; - - exports.a = a; - -})); diff --git a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/amd/b.js b/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/amd/b.js deleted file mode 100644 index b24bc116c..000000000 --- a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/amd/b.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - const b = 2; - - exports.b = b; - -})); diff --git a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/amd/main.js b/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/amd/main.js deleted file mode 100644 index 4e0843caa..000000000 --- a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/amd/main.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./a', './one'], (function (a, one) { 'use strict'; - - console.log(a.a + one.d); - -})); diff --git a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/amd/one.js b/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/amd/one.js deleted file mode 100644 index 2c0c07355..000000000 --- a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/amd/one.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['exports', './b'], (function (exports, b) { 'use strict'; - - const d = b.b + 4; - - exports.d = d; - -})); diff --git a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/cjs/a.js b/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/cjs/a.js deleted file mode 100644 index 418c69d25..000000000 --- a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/cjs/a.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -const a = 1; - -exports.a = a; diff --git a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/cjs/b.js b/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/cjs/b.js deleted file mode 100644 index f3fc6f224..000000000 --- a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/cjs/b.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -const b = 2; - -exports.b = b; diff --git a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/cjs/main.js deleted file mode 100644 index c691c0d47..000000000 --- a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/cjs/main.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -var a = require('./a.js'); -var one = require('./one.js'); - -console.log(a.a + one.d); diff --git a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/cjs/one.js b/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/cjs/one.js deleted file mode 100644 index 98e3a99e3..000000000 --- a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/cjs/one.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -var b = require('./b.js'); - -const d = b.b + 4; - -exports.d = d; diff --git a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/es/a.js b/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/es/a.js deleted file mode 100644 index 089815c5b..000000000 --- a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/es/a.js +++ /dev/null @@ -1,3 +0,0 @@ -const a = 1; - -export { a }; diff --git a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/es/b.js b/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/es/b.js deleted file mode 100644 index 27b49edda..000000000 --- a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/es/b.js +++ /dev/null @@ -1,3 +0,0 @@ -const b = 2; - -export { b }; diff --git a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/es/main.js b/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/es/main.js deleted file mode 100644 index 0b42cf037..000000000 --- a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/es/main.js +++ /dev/null @@ -1,4 +0,0 @@ -import { a } from './a.js'; -import { d } from './one.js'; - -console.log(a + d); diff --git a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/es/one.js b/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/es/one.js deleted file mode 100644 index d9291f1bf..000000000 --- a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/es/one.js +++ /dev/null @@ -1,5 +0,0 @@ -import { b } from './b.js'; - -const d = b + 4; - -export { d }; diff --git a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/system/a.js b/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/system/a.js deleted file mode 100644 index 8fb33a525..000000000 --- a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/system/a.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - const a = exports('a', 1); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/system/b.js b/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/system/b.js deleted file mode 100644 index 3cb12a8bc..000000000 --- a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/system/b.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - const b = exports('b', 2); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/system/main.js b/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/system/main.js deleted file mode 100644 index fc9155ecd..000000000 --- a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/system/main.js +++ /dev/null @@ -1,16 +0,0 @@ -System.register(['./a.js', './one.js'], (function () { - 'use strict'; - var a, d; - return { - setters: [function (module) { - a = module.a; - }, function (module) { - d = module.d; - }], - execute: (function () { - - console.log(a + d); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/system/one.js b/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/system/one.js deleted file mode 100644 index 4819936a2..000000000 --- a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/system/one.js +++ /dev/null @@ -1,14 +0,0 @@ -System.register(['./b.js'], (function (exports) { - 'use strict'; - var b; - return { - setters: [function (module) { - b = module.b; - }], - execute: (function () { - - const d = exports('d', b + 4); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/a.js b/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/a.js deleted file mode 100644 index cc798ff50..000000000 --- a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/a.js +++ /dev/null @@ -1 +0,0 @@ -export const a = 1; diff --git a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/b.js b/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/b.js deleted file mode 100644 index 202103085..000000000 --- a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/b.js +++ /dev/null @@ -1 +0,0 @@ -export const b = 2; diff --git a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/c.js b/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/c.js deleted file mode 100644 index 5f0cabef8..000000000 --- a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/c.js +++ /dev/null @@ -1 +0,0 @@ -export const c = 3; diff --git a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/index.js b/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/index.js deleted file mode 100644 index c2357812d..000000000 --- a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export { a } from './a'; -export { b } from './b'; -export { c } from './c'; diff --git a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/main.js b/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/main.js deleted file mode 100644 index 6279273d1..000000000 --- a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import { a } from './index'; -import { d } from './one'; -console.log(a + d); diff --git a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/one.js b/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/one.js deleted file mode 100644 index 8a9f8689a..000000000 --- a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/one.js +++ /dev/null @@ -1,2 +0,0 @@ -import { b } from './index'; -export const d = b + 4; diff --git a/test/chunking-form/samples/deprecated/circular-manual-chunks/_config.js b/test/chunking-form/samples/deprecated/circular-manual-chunks/_config.js deleted file mode 100644 index 12a9913eb..000000000 --- a/test/chunking-form/samples/deprecated/circular-manual-chunks/_config.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = defineTest({ - description: 'handles manual chunks with circular dependencies', - expectedWarnings: ['CIRCULAR_DEPENDENCY', 'DEPRECATED_FEATURE'], - options: { - strictDeprecations: false, - input: 'main', - manualChunks: { lib1: ['lib1'], lib2: ['lib2'] } - } -}); diff --git a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/amd/generated-lib1.js b/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/amd/generated-lib1.js deleted file mode 100644 index d53e713d2..000000000 --- a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/amd/generated-lib1.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['exports', './generated-lib2'], (function (exports, lib2) { 'use strict'; - - const lib1 = 'lib1'; - console.log(`${lib1} imports ${lib2.lib2}`); - - exports.lib1 = lib1; - -})); diff --git a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/amd/generated-lib2.js b/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/amd/generated-lib2.js deleted file mode 100644 index 4910275ea..000000000 --- a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/amd/generated-lib2.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['exports', './generated-lib1'], (function (exports, lib1) { 'use strict'; - - const lib2 = 'lib2'; - console.log(`${lib2} imports ${lib1.lib1}`); - - exports.lib2 = lib2; - -})); diff --git a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/amd/main.js b/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/amd/main.js deleted file mode 100644 index 0fbe5aa7e..000000000 --- a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/amd/main.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['exports', './generated-lib1', './generated-lib2'], (function (exports, lib1, lib2) { 'use strict'; - - - - exports.lib1 = lib1.lib1; - -})); diff --git a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/cjs/generated-lib1.js b/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/cjs/generated-lib1.js deleted file mode 100644 index 7c6e9861e..000000000 --- a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/cjs/generated-lib1.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var lib2 = require('./generated-lib2.js'); - -const lib1 = 'lib1'; -console.log(`${lib1} imports ${lib2.lib2}`); - -exports.lib1 = lib1; diff --git a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/cjs/generated-lib2.js b/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/cjs/generated-lib2.js deleted file mode 100644 index b1af239df..000000000 --- a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/cjs/generated-lib2.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var lib1 = require('./generated-lib1.js'); - -const lib2 = 'lib2'; -console.log(`${lib2} imports ${lib1.lib1}`); - -exports.lib2 = lib2; diff --git a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/cjs/main.js deleted file mode 100644 index 0a949dc0f..000000000 --- a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/cjs/main.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var lib1 = require('./generated-lib1.js'); -require('./generated-lib2.js'); - - - -exports.lib1 = lib1.lib1; diff --git a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/es/generated-lib1.js b/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/es/generated-lib1.js deleted file mode 100644 index f01a233c7..000000000 --- a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/es/generated-lib1.js +++ /dev/null @@ -1,6 +0,0 @@ -import { l as lib2 } from './generated-lib2.js'; - -const lib1 = 'lib1'; -console.log(`${lib1} imports ${lib2}`); - -export { lib1 as l }; diff --git a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/es/generated-lib2.js b/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/es/generated-lib2.js deleted file mode 100644 index d822262ae..000000000 --- a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/es/generated-lib2.js +++ /dev/null @@ -1,6 +0,0 @@ -import { l as lib1 } from './generated-lib1.js'; - -const lib2 = 'lib2'; -console.log(`${lib2} imports ${lib1}`); - -export { lib2 as l }; diff --git a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/es/main.js b/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/es/main.js deleted file mode 100644 index 93f53841e..000000000 --- a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/es/main.js +++ /dev/null @@ -1,2 +0,0 @@ -export { l as lib1 } from './generated-lib1.js'; -import './generated-lib2.js'; diff --git a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/system/generated-lib1.js b/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/system/generated-lib1.js deleted file mode 100644 index e68a14939..000000000 --- a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/system/generated-lib1.js +++ /dev/null @@ -1,15 +0,0 @@ -System.register(['./generated-lib2.js'], (function (exports) { - 'use strict'; - var lib2; - return { - setters: [function (module) { - lib2 = module.l; - }], - execute: (function () { - - const lib1 = exports('l', 'lib1'); - console.log(`${lib1} imports ${lib2}`); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/system/generated-lib2.js b/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/system/generated-lib2.js deleted file mode 100644 index 2fc94b38e..000000000 --- a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/system/generated-lib2.js +++ /dev/null @@ -1,15 +0,0 @@ -System.register(['./generated-lib1.js'], (function (exports) { - 'use strict'; - var lib1; - return { - setters: [function (module) { - lib1 = module.l; - }], - execute: (function () { - - const lib2 = exports('l', 'lib2'); - console.log(`${lib2} imports ${lib1}`); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/system/main.js b/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/system/main.js deleted file mode 100644 index 055d3eb7c..000000000 --- a/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/system/main.js +++ /dev/null @@ -1,13 +0,0 @@ -System.register(['./generated-lib1.js', './generated-lib2.js'], (function (exports) { - 'use strict'; - return { - setters: [function (module) { - exports('lib1', module.l); - }, null], - execute: (function () { - - - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/circular-manual-chunks/lib1.js b/test/chunking-form/samples/deprecated/circular-manual-chunks/lib1.js deleted file mode 100644 index f0e3728c7..000000000 --- a/test/chunking-form/samples/deprecated/circular-manual-chunks/lib1.js +++ /dev/null @@ -1,3 +0,0 @@ -import { lib2 } from './lib2.js'; -export const lib1 = 'lib1'; -console.log(`${lib1} imports ${lib2}`); diff --git a/test/chunking-form/samples/deprecated/circular-manual-chunks/lib2.js b/test/chunking-form/samples/deprecated/circular-manual-chunks/lib2.js deleted file mode 100644 index cb0f5333f..000000000 --- a/test/chunking-form/samples/deprecated/circular-manual-chunks/lib2.js +++ /dev/null @@ -1,3 +0,0 @@ -import { lib1 } from './lib1'; -export const lib2 = 'lib2'; -console.log(`${lib2} imports ${lib1}`); diff --git a/test/chunking-form/samples/deprecated/circular-manual-chunks/main.js b/test/chunking-form/samples/deprecated/circular-manual-chunks/main.js deleted file mode 100644 index 73c902d4b..000000000 --- a/test/chunking-form/samples/deprecated/circular-manual-chunks/main.js +++ /dev/null @@ -1 +0,0 @@ -export { lib1 } from './lib1.js'; diff --git a/test/chunking-form/samples/deprecated/dynamic-import-comments/_config.js b/test/chunking-form/samples/deprecated/dynamic-import-comments/_config.js deleted file mode 100644 index 746c72502..000000000 --- a/test/chunking-form/samples/deprecated/dynamic-import-comments/_config.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = defineTest({ - description: 'should not remove inline comments inside dynamic import', - options: { - strictDeprecations: false, - input: 'main.js', - onwarn() {}, - plugins: { - resolveDynamicImport() { - return false; - } - }, - output: { - dynamicImportFunction: 'foobar' - } - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/dynamic-import-comments/_expected/amd/main.js b/test/chunking-form/samples/deprecated/dynamic-import-comments/_expected/amd/main.js deleted file mode 100644 index 62b0ebc08..000000000 --- a/test/chunking-form/samples/deprecated/dynamic-import-comments/_expected/amd/main.js +++ /dev/null @@ -1,24 +0,0 @@ -define(['require'], (function (require) { 'use strict'; - - function _interopNamespaceDefault(e) { - var n = Object.create(null); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { return e[k]; } - }); - } - }); - } - n.default = e; - return Object.freeze(n); - } - - new Promise(function (resolve, reject) { require([ - /* webpackChunkName: "chunk-name" */ - './foo'/*suffix*/], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); - -})); diff --git a/test/chunking-form/samples/deprecated/dynamic-import-comments/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/dynamic-import-comments/_expected/cjs/main.js deleted file mode 100644 index 3ec906a7e..000000000 --- a/test/chunking-form/samples/deprecated/dynamic-import-comments/_expected/cjs/main.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -import /* () should not break */ ( -/* webpackChunkName: "chunk-name" */ -'./foo.js'/*suffix*/); diff --git a/test/chunking-form/samples/deprecated/dynamic-import-comments/_expected/es/main.js b/test/chunking-form/samples/deprecated/dynamic-import-comments/_expected/es/main.js deleted file mode 100644 index 8f2386314..000000000 --- a/test/chunking-form/samples/deprecated/dynamic-import-comments/_expected/es/main.js +++ /dev/null @@ -1,3 +0,0 @@ -foobar( -/* webpackChunkName: "chunk-name" */ -'./foo.js'/*suffix*/); diff --git a/test/chunking-form/samples/deprecated/dynamic-import-comments/_expected/system/main.js b/test/chunking-form/samples/deprecated/dynamic-import-comments/_expected/system/main.js deleted file mode 100644 index d95610125..000000000 --- a/test/chunking-form/samples/deprecated/dynamic-import-comments/_expected/system/main.js +++ /dev/null @@ -1,12 +0,0 @@ -System.register([], (function (exports, module) { - 'use strict'; - return { - execute: (function () { - - module.import( - /* webpackChunkName: "chunk-name" */ - './foo.js'/*suffix*/); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/dynamic-import-comments/main.js b/test/chunking-form/samples/deprecated/dynamic-import-comments/main.js deleted file mode 100644 index 9519c0a65..000000000 --- a/test/chunking-form/samples/deprecated/dynamic-import-comments/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import /* () should not break */ ( -/* webpackChunkName: "chunk-name" */ -'./foo.js'/*suffix*/); diff --git a/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_config.js b/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_config.js deleted file mode 100644 index 96d7c5a11..000000000 --- a/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_config.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = defineTest({ - description: 'supports an object with a single entry when inlining dynamic imports', - options: { - strictDeprecations: false, - inlineDynamicImports: true, - input: { entry: 'main' } - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_expected/amd/entry.js b/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_expected/amd/entry.js deleted file mode 100644 index fef3de875..000000000 --- a/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_expected/amd/entry.js +++ /dev/null @@ -1,12 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - const bar = 2; - Promise.resolve().then(function () { return foo; }); - - var foo = /*#__PURE__*/Object.freeze({ - __proto__: null - }); - - exports.bar = bar; - -})); diff --git a/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_expected/cjs/entry.js b/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_expected/cjs/entry.js deleted file mode 100644 index 218beb76d..000000000 --- a/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_expected/cjs/entry.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -const bar = 2; -Promise.resolve().then(function () { return foo; }); - -var foo = /*#__PURE__*/Object.freeze({ - __proto__: null -}); - -exports.bar = bar; diff --git a/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_expected/es/entry.js b/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_expected/es/entry.js deleted file mode 100644 index 5a35de939..000000000 --- a/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_expected/es/entry.js +++ /dev/null @@ -1,8 +0,0 @@ -const bar = 2; -Promise.resolve().then(function () { return foo; }); - -var foo = /*#__PURE__*/Object.freeze({ - __proto__: null -}); - -export { bar }; diff --git a/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_expected/system/entry.js b/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_expected/system/entry.js deleted file mode 100644 index 2f4d23eac..000000000 --- a/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_expected/system/entry.js +++ /dev/null @@ -1,15 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - const bar = exports('bar', 2); - Promise.resolve().then(function () { return foo; }); - - var foo = /*#__PURE__*/Object.freeze({ - __proto__: null - }); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/foo.js b/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/foo.js deleted file mode 100644 index 6a8018af4..000000000 --- a/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/foo.js +++ /dev/null @@ -1 +0,0 @@ -export const foo = 1; \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/main.js b/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/main.js deleted file mode 100644 index ee3e6a770..000000000 --- a/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/main.js +++ /dev/null @@ -1,2 +0,0 @@ -export const bar = 2; -import('./foo.js'); diff --git a/test/chunking-form/samples/deprecated/dynamic-import-name/_config.js b/test/chunking-form/samples/deprecated/dynamic-import-name/_config.js deleted file mode 100644 index a9f1c4e01..000000000 --- a/test/chunking-form/samples/deprecated/dynamic-import-name/_config.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = defineTest({ - description: 'allows specifying a custom importer function', - options: { - strictDeprecations: false, - input: 'main.js', - onwarn() {}, - plugins: { - resolveDynamicImport() { - return false; - } - }, - output: { - dynamicImportFunction: 'foobar' - } - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/dynamic-import-name/_expected/amd/main.js b/test/chunking-form/samples/deprecated/dynamic-import-name/_expected/amd/main.js deleted file mode 100644 index 28f0faf67..000000000 --- a/test/chunking-form/samples/deprecated/dynamic-import-name/_expected/amd/main.js +++ /dev/null @@ -1,22 +0,0 @@ -define(['require'], (function (require) { 'use strict'; - - function _interopNamespaceDefault(e) { - var n = Object.create(null); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { return e[k]; } - }); - } - }); - } - n.default = e; - return Object.freeze(n); - } - - new Promise(function (resolve, reject) { require(['./foo'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }).then(result => console.log(result)); - -})); diff --git a/test/chunking-form/samples/deprecated/dynamic-import-name/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/dynamic-import-name/_expected/cjs/main.js deleted file mode 100644 index b23ce4920..000000000 --- a/test/chunking-form/samples/deprecated/dynamic-import-name/_expected/cjs/main.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -import('./foo.js').then(result => console.log(result)); diff --git a/test/chunking-form/samples/deprecated/dynamic-import-name/_expected/es/main.js b/test/chunking-form/samples/deprecated/dynamic-import-name/_expected/es/main.js deleted file mode 100644 index 31d9a65e1..000000000 --- a/test/chunking-form/samples/deprecated/dynamic-import-name/_expected/es/main.js +++ /dev/null @@ -1 +0,0 @@ -foobar('./foo.js').then(result => console.log(result)); diff --git a/test/chunking-form/samples/deprecated/dynamic-import-name/_expected/system/main.js b/test/chunking-form/samples/deprecated/dynamic-import-name/_expected/system/main.js deleted file mode 100644 index dffa4e046..000000000 --- a/test/chunking-form/samples/deprecated/dynamic-import-name/_expected/system/main.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports, module) { - 'use strict'; - return { - execute: (function () { - - module.import('./foo.js').then(result => console.log(result)); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/dynamic-import-name/main.js b/test/chunking-form/samples/deprecated/dynamic-import-name/main.js deleted file mode 100644 index 56ab47293..000000000 --- a/test/chunking-form/samples/deprecated/dynamic-import-name/main.js +++ /dev/null @@ -1 +0,0 @@ -import('./foo.js').then(result => console.log(result)); diff --git a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_config.js b/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_config.js deleted file mode 100644 index dad2efee3..000000000 --- a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_config.js +++ /dev/null @@ -1,22 +0,0 @@ -const assert = require('node:assert'); -let referenceId; - -module.exports = defineTest({ - description: 'retrieves the correct name of an emitted chunk in case a facade is created', - options: { - strictDeprecations: false, - input: 'main', - manualChunks: { - 'build-starter': ['buildStart'] - }, - plugins: { - buildStart() { - referenceId = this.emitFile({ type: 'chunk', id: 'buildStart' }); - }, - renderChunk() { - assert.strictEqual(this.getFileName(referenceId), 'generated-buildStart.js'); - } - } - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/amd/generated-build-starter.js b/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/amd/generated-build-starter.js deleted file mode 100644 index 8efead70d..000000000 --- a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/amd/generated-build-starter.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - const value = 42; - const otherValue = 43; - - console.log('startBuild', value); - - exports.otherValue = otherValue; - exports.value = value; - -})); diff --git a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/amd/generated-buildStart.js b/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/amd/generated-buildStart.js deleted file mode 100644 index ffe42cfb3..000000000 --- a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/amd/generated-buildStart.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['exports', './generated-build-starter'], (function (exports, buildStarter) { 'use strict'; - - - - exports.buildStartValue = buildStarter.value; - -})); diff --git a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/amd/main.js b/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/amd/main.js deleted file mode 100644 index 830d21848..000000000 --- a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/amd/main.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./generated-build-starter'], (function (buildStarter) { 'use strict'; - - console.log('main', buildStarter.value, buildStarter.otherValue); - -})); diff --git a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/cjs/generated-build-starter.js b/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/cjs/generated-build-starter.js deleted file mode 100644 index fecf7a3cd..000000000 --- a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/cjs/generated-build-starter.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -const value = 42; -const otherValue = 43; - -console.log('startBuild', value); - -exports.otherValue = otherValue; -exports.value = value; diff --git a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/cjs/generated-buildStart.js b/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/cjs/generated-buildStart.js deleted file mode 100644 index 7f8a521cd..000000000 --- a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/cjs/generated-buildStart.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -var buildStarter = require('./generated-build-starter.js'); - - - -exports.buildStartValue = buildStarter.value; diff --git a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/cjs/main.js deleted file mode 100644 index 666c39684..000000000 --- a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/cjs/main.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var buildStarter = require('./generated-build-starter.js'); - -console.log('main', buildStarter.value, buildStarter.otherValue); diff --git a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/es/generated-build-starter.js b/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/es/generated-build-starter.js deleted file mode 100644 index 43deafdd0..000000000 --- a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/es/generated-build-starter.js +++ /dev/null @@ -1,6 +0,0 @@ -const value = 42; -const otherValue = 43; - -console.log('startBuild', value); - -export { otherValue as o, value as v }; diff --git a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/es/generated-buildStart.js b/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/es/generated-buildStart.js deleted file mode 100644 index ffb305eac..000000000 --- a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/es/generated-buildStart.js +++ /dev/null @@ -1 +0,0 @@ -export { v as buildStartValue } from './generated-build-starter.js'; diff --git a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/es/main.js b/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/es/main.js deleted file mode 100644 index 28caef942..000000000 --- a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/es/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import { v as value, o as otherValue } from './generated-build-starter.js'; - -console.log('main', value, otherValue); diff --git a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/system/generated-build-starter.js b/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/system/generated-build-starter.js deleted file mode 100644 index 745c94783..000000000 --- a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/system/generated-build-starter.js +++ /dev/null @@ -1,13 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - const value = exports('v', 42); - const otherValue = exports('o', 43); - - console.log('startBuild', value); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/system/generated-buildStart.js b/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/system/generated-buildStart.js deleted file mode 100644 index c21eed54d..000000000 --- a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/system/generated-buildStart.js +++ /dev/null @@ -1,13 +0,0 @@ -System.register(['./generated-build-starter.js'], (function (exports) { - 'use strict'; - return { - setters: [function (module) { - exports('buildStartValue', module.v); - }], - execute: (function () { - - - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/system/main.js b/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/system/main.js deleted file mode 100644 index 55b718e43..000000000 --- a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/system/main.js +++ /dev/null @@ -1,15 +0,0 @@ -System.register(['./generated-build-starter.js'], (function () { - 'use strict'; - var value, otherValue; - return { - setters: [function (module) { - value = module.v; - otherValue = module.o; - }], - execute: (function () { - - console.log('main', value, otherValue); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/buildStart.js b/test/chunking-form/samples/deprecated/emit-file-chunk-facade/buildStart.js deleted file mode 100644 index 49baee496..000000000 --- a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/buildStart.js +++ /dev/null @@ -1,5 +0,0 @@ -import {value} from './dep.js'; - -console.log('startBuild', value); - -export { value as buildStartValue }; diff --git a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/dep.js b/test/chunking-form/samples/deprecated/emit-file-chunk-facade/dep.js deleted file mode 100644 index a2db63411..000000000 --- a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/dep.js +++ /dev/null @@ -1,2 +0,0 @@ -export const value = 42; -export const otherValue = 43; diff --git a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/main.js b/test/chunking-form/samples/deprecated/emit-file-chunk-facade/main.js deleted file mode 100644 index df41d5637..000000000 --- a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import { value, otherValue } from './dep'; - -console.log('main', value, otherValue); diff --git a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_config.js b/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_config.js deleted file mode 100644 index bd12a97ad..000000000 --- a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_config.js +++ /dev/null @@ -1,70 +0,0 @@ -const assert = require('node:assert'); -const path = require('node:path'); -// @ts-expect-error not included in types -const { getObject } = require('../../../../utils'); - -module.exports = defineTest({ - description: 'associates empty modules with chunks if tree-shaking is disabled for them', - options: { - strictDeprecations: false, - input: ['main1.js', 'main2.js'], - plugins: { - resolveId(id) { - if (id.startsWith('empty')) { - if (id === 'emptyResolved') { - return { - id, - moduleSideEffects: 'no-treeshake' - }; - } - return id; - } - }, - load(id) { - if (id.startsWith('empty')) { - if (id === 'emptyLoaded') { - return { code: '', moduleSideEffects: 'no-treeshake' }; - } - return ''; - } - }, - transform(code, id) { - if (id === 'emptyTransformed') { - return { code: '', moduleSideEffects: 'no-treeshake' }; - } - }, - generateBundle(options, bundle) { - assert.deepStrictEqual( - getObject( - [...this.getModuleIds()].map(id => [ - id.startsWith('empty') ? id : path.relative(__dirname, id), - this.getModuleInfo(id).hasModuleSideEffects - ]) - ), - { - empty: true, - emptyLoaded: 'no-treeshake', - emptyResolved: 'no-treeshake', - emptyTransformed: 'no-treeshake', - 'main1.js': true, - 'main2.js': true - } - ); - assert.deepStrictEqual( - getObject( - Object.entries(bundle).map(([chunkId, chunk]) => [ - chunkId, - Object.keys(chunk.modules).map(moduleId => path.relative(__dirname, moduleId)) - ]) - ), - { - 'main1.js': ['emptyResolved', 'main1.js'], - 'main2.js': ['emptyLoaded', 'main2.js'], - 'generated-emptyTransformed.js': ['emptyTransformed'] - } - ); - } - } - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/amd/generated-emptyTransformed.js b/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/amd/generated-emptyTransformed.js deleted file mode 100644 index a9e9419e2..000000000 --- a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/amd/generated-emptyTransformed.js +++ /dev/null @@ -1,5 +0,0 @@ -define((function () { 'use strict'; - - - -})); diff --git a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/amd/main1.js b/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/amd/main1.js deleted file mode 100644 index 79b7506c8..000000000 --- a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/amd/main1.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./generated-emptyTransformed'], (function (emptyTransformed) { 'use strict'; - - console.log('main1'); - -})); diff --git a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/amd/main2.js b/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/amd/main2.js deleted file mode 100644 index 5637dfe6a..000000000 --- a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/amd/main2.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./generated-emptyTransformed'], (function (emptyTransformed) { 'use strict'; - - console.log('main2'); - -})); diff --git a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/cjs/generated-emptyTransformed.js b/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/cjs/generated-emptyTransformed.js deleted file mode 100644 index eb109abbe..000000000 --- a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/cjs/generated-emptyTransformed.js +++ /dev/null @@ -1,2 +0,0 @@ -'use strict'; - diff --git a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/cjs/main1.js b/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/cjs/main1.js deleted file mode 100644 index 12fe59609..000000000 --- a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/cjs/main1.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -require('./generated-emptyTransformed.js'); - -console.log('main1'); diff --git a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/cjs/main2.js b/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/cjs/main2.js deleted file mode 100644 index 1e0275701..000000000 --- a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/cjs/main2.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -require('./generated-emptyTransformed.js'); - -console.log('main2'); diff --git a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/es/generated-emptyTransformed.js b/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/es/generated-emptyTransformed.js deleted file mode 100644 index 8b1378917..000000000 --- a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/es/generated-emptyTransformed.js +++ /dev/null @@ -1 +0,0 @@ - diff --git a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/es/main1.js b/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/es/main1.js deleted file mode 100644 index 3e33abdec..000000000 --- a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/es/main1.js +++ /dev/null @@ -1,3 +0,0 @@ -import './generated-emptyTransformed.js'; - -console.log('main1'); diff --git a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/es/main2.js b/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/es/main2.js deleted file mode 100644 index 897b460ad..000000000 --- a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/es/main2.js +++ /dev/null @@ -1,3 +0,0 @@ -import './generated-emptyTransformed.js'; - -console.log('main2'); diff --git a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/system/generated-emptyTransformed.js b/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/system/generated-emptyTransformed.js deleted file mode 100644 index 343cc3a51..000000000 --- a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/system/generated-emptyTransformed.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function () { - 'use strict'; - return { - execute: (function () { - - - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/system/main1.js b/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/system/main1.js deleted file mode 100644 index 11b0d79c4..000000000 --- a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/system/main1.js +++ /dev/null @@ -1,11 +0,0 @@ -System.register(['./generated-emptyTransformed.js'], (function () { - 'use strict'; - return { - setters: [null], - execute: (function () { - - console.log('main1'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/system/main2.js b/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/system/main2.js deleted file mode 100644 index a2b1c4a1a..000000000 --- a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/system/main2.js +++ /dev/null @@ -1,11 +0,0 @@ -System.register(['./generated-emptyTransformed.js'], (function () { - 'use strict'; - return { - setters: [null], - execute: (function () { - - console.log('main2'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/main1.js b/test/chunking-form/samples/deprecated/empty-module-no-treeshake/main1.js deleted file mode 100644 index a8e85af41..000000000 --- a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/main1.js +++ /dev/null @@ -1,4 +0,0 @@ -import 'empty'; -import 'emptyResolved'; -import 'emptyTransformed'; -console.log('main1'); diff --git a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/main2.js b/test/chunking-form/samples/deprecated/empty-module-no-treeshake/main2.js deleted file mode 100644 index 6fe715b25..000000000 --- a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/main2.js +++ /dev/null @@ -1,4 +0,0 @@ -import 'empty'; -import 'emptyLoaded'; -import 'emptyTransformed'; -console.log('main2'); diff --git a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_config.js b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_config.js deleted file mode 100644 index 481a1edb5..000000000 --- a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_config.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = defineTest({ - description: 'does not drop indirect reexports when preserving modules', - expectedWarnings: ['MIXED_EXPORTS', 'DEPRECATED_FEATURE'], - options: { - strictDeprecations: false, - output: { name: 'bundle' }, - preserveModules: true - } -}); diff --git a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/amd/components/index.js b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/amd/components/index.js deleted file mode 100644 index a03efcb5e..000000000 --- a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/amd/components/index.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['exports', './sub/index'], (function (exports, index) { 'use strict'; - - const baz = { bar: index.default }; - - exports.foo = index.foo; - exports.baz = baz; - -})); diff --git a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/amd/components/sub/index.js b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/amd/components/sub/index.js deleted file mode 100644 index 9da33feb2..000000000 --- a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/amd/components/sub/index.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - const foo = 'bar'; - var bar = () => {}; - - exports.default = bar; - exports.foo = foo; - - Object.defineProperty(exports, '__esModule', { value: true }); - -})); diff --git a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/amd/main.js b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/amd/main.js deleted file mode 100644 index c17dc35d9..000000000 --- a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/amd/main.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['exports', './components/index', './components/sub/index'], (function (exports, index, index$1) { 'use strict'; - - - - exports.baz = index.baz; - exports.foo = index$1.foo; - -})); diff --git a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/cjs/components/index.js b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/cjs/components/index.js deleted file mode 100644 index c6e74030a..000000000 --- a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/cjs/components/index.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var index = require('./sub/index.js'); - -const baz = { bar: index.default }; - -exports.foo = index.foo; -exports.baz = baz; diff --git a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/cjs/components/sub/index.js b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/cjs/components/sub/index.js deleted file mode 100644 index 8ffc494cb..000000000 --- a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/cjs/components/sub/index.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -const foo = 'bar'; -var bar = () => {}; - -exports.default = bar; -exports.foo = foo; diff --git a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/cjs/main.js deleted file mode 100644 index 6bcd93609..000000000 --- a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/cjs/main.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -var index = require('./components/index.js'); -var index$1 = require('./components/sub/index.js'); - - - -exports.baz = index.baz; -exports.foo = index$1.foo; diff --git a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/es/components/index.js b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/es/components/index.js deleted file mode 100644 index baeee792c..000000000 --- a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/es/components/index.js +++ /dev/null @@ -1,6 +0,0 @@ -import bar from './sub/index.js'; -export { foo } from './sub/index.js'; - -const baz = { bar }; - -export { baz }; diff --git a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/es/components/sub/index.js b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/es/components/sub/index.js deleted file mode 100644 index 1ee02cde7..000000000 --- a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/es/components/sub/index.js +++ /dev/null @@ -1,4 +0,0 @@ -const foo = 'bar'; -var bar = () => {}; - -export { bar as default, foo }; diff --git a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/es/main.js b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/es/main.js deleted file mode 100644 index d3455118d..000000000 --- a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/es/main.js +++ /dev/null @@ -1,2 +0,0 @@ -export { baz } from './components/index.js'; -export { foo } from './components/sub/index.js'; diff --git a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/system/components/index.js b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/system/components/index.js deleted file mode 100644 index 1400753db..000000000 --- a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/system/components/index.js +++ /dev/null @@ -1,15 +0,0 @@ -System.register('bundle', ['./sub/index.js'], (function (exports) { - 'use strict'; - var bar; - return { - setters: [function (module) { - bar = module.default; - exports('foo', module.foo); - }], - execute: (function () { - - const baz = exports('baz', { bar }); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/system/components/sub/index.js b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/system/components/sub/index.js deleted file mode 100644 index f6f4fdff6..000000000 --- a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/system/components/sub/index.js +++ /dev/null @@ -1,11 +0,0 @@ -System.register('bundle', [], (function (exports) { - 'use strict'; - return { - execute: (function () { - - const foo = exports('foo', 'bar'); - var bar = exports('default', () => {}); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/system/main.js b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/system/main.js deleted file mode 100644 index 26be107a7..000000000 --- a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/system/main.js +++ /dev/null @@ -1,15 +0,0 @@ -System.register('bundle', ['./components/index.js', './components/sub/index.js'], (function (exports) { - 'use strict'; - return { - setters: [function (module) { - exports('baz', module.baz); - }, function (module) { - exports('foo', module.foo); - }], - execute: (function () { - - - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/components/index.js b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/components/index.js deleted file mode 100644 index 0c5913716..000000000 --- a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/components/index.js +++ /dev/null @@ -1,4 +0,0 @@ -import bar, { foo } from './sub/index'; - -export const baz = { bar }; -export { foo }; diff --git a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/components/sub/index.js b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/components/sub/index.js deleted file mode 100644 index 0bce193fc..000000000 --- a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/components/sub/index.js +++ /dev/null @@ -1,4 +0,0 @@ -const foo = 'bar'; - -export { foo }; -export default () => {}; diff --git a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/main.js b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/main.js deleted file mode 100644 index 6dfbc9774..000000000 --- a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import { baz, foo } from './components/index'; - -export { baz, foo }; diff --git a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_config.js b/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_config.js deleted file mode 100644 index 41df7cd66..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_config.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = defineTest({ - description: 'avoid facades if possible when using manual chunks', - options: { - strictDeprecations: false, - input: ['main1', 'main2'], - manualChunks: { - manual: ['main2'] - } - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/amd/main1.js b/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/amd/main1.js deleted file mode 100644 index 56e0171e9..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/amd/main1.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./main2'], (function (manual) { 'use strict'; - - console.log('main', manual.reexported); - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/amd/main2.js b/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/amd/main2.js deleted file mode 100644 index 0c4218930..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/amd/main2.js +++ /dev/null @@ -1,9 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - const value = 42; - - console.log('main2', value); - - exports.reexported = value; - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/cjs/main1.js b/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/cjs/main1.js deleted file mode 100644 index 81de531a9..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/cjs/main1.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var manual = require('./main2.js'); - -console.log('main', manual.reexported); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/cjs/main2.js b/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/cjs/main2.js deleted file mode 100644 index 58617370c..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/cjs/main2.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -const value = 42; - -console.log('main2', value); - -exports.reexported = value; diff --git a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/es/main1.js b/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/es/main1.js deleted file mode 100644 index 6ba22536a..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/es/main1.js +++ /dev/null @@ -1,3 +0,0 @@ -import { reexported as value } from './main2.js'; - -console.log('main', value); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/es/main2.js b/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/es/main2.js deleted file mode 100644 index 897452bd6..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/es/main2.js +++ /dev/null @@ -1,5 +0,0 @@ -const value = 42; - -console.log('main2', value); - -export { value as reexported }; diff --git a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/system/main1.js b/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/system/main1.js deleted file mode 100644 index f189fb530..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/system/main1.js +++ /dev/null @@ -1,14 +0,0 @@ -System.register(['./main2.js'], (function () { - 'use strict'; - var value; - return { - setters: [function (module) { - value = module.reexported; - }], - execute: (function () { - - console.log('main', value); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/system/main2.js b/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/system/main2.js deleted file mode 100644 index ec2b81330..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/system/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - const value = exports('reexported', 42); - - console.log('main2', value); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/dep.js b/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/dep.js deleted file mode 100644 index 46d3ca8c6..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/dep.js +++ /dev/null @@ -1 +0,0 @@ -export const value = 42; diff --git a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/main1.js b/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/main1.js deleted file mode 100644 index 5da97663c..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/main1.js +++ /dev/null @@ -1,3 +0,0 @@ -import { value } from './dep'; - -console.log('main', value); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/main2.js b/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/main2.js deleted file mode 100644 index 868d23fd0..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/main2.js +++ /dev/null @@ -1,5 +0,0 @@ -import {value} from './dep.js'; - -console.log('main2', value); - -export { value as reexported }; diff --git a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_config.js b/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_config.js deleted file mode 100644 index cac8317c3..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_config.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = defineTest({ - description: 'Uses entry alias if manual chunks contain entry chunks with different alias', - options: { - strictDeprecations: false, - input: { - main: 'main.js', - main2: 'main2.js' - }, - manualChunks: { - outer: ['outer'] - } - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/amd/main.js b/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/amd/main.js deleted file mode 100644 index 0dce9285f..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/amd/main.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - console.log('dep'); - - console.log('main'); - - const value = 42; - - exports.value = value; - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/amd/main2.js b/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/amd/main2.js deleted file mode 100644 index a8c2660dc..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/amd/main2.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./main'], (function (outer) { 'use strict'; - - - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/cjs/main.js deleted file mode 100644 index fe59aaab6..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/cjs/main.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -console.log('dep'); - -console.log('main'); - -const value = 42; - -exports.value = value; diff --git a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/cjs/main2.js b/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/cjs/main2.js deleted file mode 100644 index 7ca8a520b..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/cjs/main2.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -require('./main.js'); - diff --git a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/es/main.js b/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/es/main.js deleted file mode 100644 index 132b27a8d..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/es/main.js +++ /dev/null @@ -1,7 +0,0 @@ -console.log('dep'); - -console.log('main'); - -const value = 42; - -export { value }; diff --git a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/es/main2.js b/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/es/main2.js deleted file mode 100644 index 859ecc36b..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/es/main2.js +++ /dev/null @@ -1 +0,0 @@ -import './main.js'; diff --git a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/system/main.js b/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/system/main.js deleted file mode 100644 index 54287b3c8..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/system/main.js +++ /dev/null @@ -1,14 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - console.log('dep'); - - console.log('main'); - - const value = exports('value', 42); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/system/main2.js b/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/system/main2.js deleted file mode 100644 index e2a9d2652..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/system/main2.js +++ /dev/null @@ -1,11 +0,0 @@ -System.register(['./main.js'], (function () { - 'use strict'; - return { - setters: [null], - execute: (function () { - - - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/dep.js b/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/dep.js deleted file mode 100644 index b74a9837c..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/dep.js +++ /dev/null @@ -1 +0,0 @@ -console.log('dep'); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/main.js b/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/main.js deleted file mode 100644 index 983ead17e..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/main.js +++ /dev/null @@ -1,5 +0,0 @@ -import './dep.js'; - -console.log('main'); - -export const value = 42; diff --git a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/main2.js b/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/main2.js deleted file mode 100644 index d6cf3b024..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/main2.js +++ /dev/null @@ -1 +0,0 @@ -import './dep.js'; diff --git a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/outer.js b/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/outer.js deleted file mode 100644 index 26385b8a3..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/outer.js +++ /dev/null @@ -1,3 +0,0 @@ -import './main'; - -console.log('outer'); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_config.js b/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_config.js deleted file mode 100644 index c13a9584f..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_config.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = defineTest({ - description: - 'Identifies the entry chunk with the manual chunk that contains it if the aliases match', - options: { - strictDeprecations: false, - input: { - main: 'main.js' - }, - manualChunks: { - main: ['outer'] - } - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/amd/main.js b/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/amd/main.js deleted file mode 100644 index 0dce9285f..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/amd/main.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - console.log('dep'); - - console.log('main'); - - const value = 42; - - exports.value = value; - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/cjs/main.js deleted file mode 100644 index fe59aaab6..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/cjs/main.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -console.log('dep'); - -console.log('main'); - -const value = 42; - -exports.value = value; diff --git a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/es/main.js b/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/es/main.js deleted file mode 100644 index 132b27a8d..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/es/main.js +++ /dev/null @@ -1,7 +0,0 @@ -console.log('dep'); - -console.log('main'); - -const value = 42; - -export { value }; diff --git a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/system/main.js b/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/system/main.js deleted file mode 100644 index 54287b3c8..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/system/main.js +++ /dev/null @@ -1,14 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - console.log('dep'); - - console.log('main'); - - const value = exports('value', 42); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/dep.js b/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/dep.js deleted file mode 100644 index b74a9837c..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/dep.js +++ /dev/null @@ -1 +0,0 @@ -console.log('dep'); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/main.js b/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/main.js deleted file mode 100644 index 983ead17e..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/main.js +++ /dev/null @@ -1,5 +0,0 @@ -import './dep.js'; - -console.log('main'); - -export const value = 42; diff --git a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/outer.js b/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/outer.js deleted file mode 100644 index 26385b8a3..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/outer.js +++ /dev/null @@ -1,3 +0,0 @@ -import './main'; - -console.log('outer'); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_config.js b/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_config.js deleted file mode 100644 index 21f5ba76e..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_config.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = defineTest({ - description: 'Uses entry alias if manual chunks are entry chunks with different alias', - options: { - strictDeprecations: false, - input: { - main: 'main.js', - main2: 'main2.js' - }, - manualChunks: { - other: ['main'] - } - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/amd/main.js b/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/amd/main.js deleted file mode 100644 index 0dce9285f..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/amd/main.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - console.log('dep'); - - console.log('main'); - - const value = 42; - - exports.value = value; - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/amd/main2.js b/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/amd/main2.js deleted file mode 100644 index e5e4e1a17..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/amd/main2.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./main'], (function (other) { 'use strict'; - - - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/cjs/main.js deleted file mode 100644 index fe59aaab6..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/cjs/main.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -console.log('dep'); - -console.log('main'); - -const value = 42; - -exports.value = value; diff --git a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/cjs/main2.js b/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/cjs/main2.js deleted file mode 100644 index 7ca8a520b..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/cjs/main2.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -require('./main.js'); - diff --git a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/es/main.js b/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/es/main.js deleted file mode 100644 index 132b27a8d..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/es/main.js +++ /dev/null @@ -1,7 +0,0 @@ -console.log('dep'); - -console.log('main'); - -const value = 42; - -export { value }; diff --git a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/es/main2.js b/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/es/main2.js deleted file mode 100644 index 859ecc36b..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/es/main2.js +++ /dev/null @@ -1 +0,0 @@ -import './main.js'; diff --git a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/system/main.js b/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/system/main.js deleted file mode 100644 index 54287b3c8..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/system/main.js +++ /dev/null @@ -1,14 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - console.log('dep'); - - console.log('main'); - - const value = exports('value', 42); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/system/main2.js b/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/system/main2.js deleted file mode 100644 index e2a9d2652..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/system/main2.js +++ /dev/null @@ -1,11 +0,0 @@ -System.register(['./main.js'], (function () { - 'use strict'; - return { - setters: [null], - execute: (function () { - - - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/dep.js b/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/dep.js deleted file mode 100644 index b74a9837c..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/dep.js +++ /dev/null @@ -1 +0,0 @@ -console.log('dep'); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/main.js b/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/main.js deleted file mode 100644 index 983ead17e..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/main.js +++ /dev/null @@ -1,5 +0,0 @@ -import './dep.js'; - -console.log('main'); - -export const value = 42; diff --git a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/main2.js b/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/main2.js deleted file mode 100644 index d6cf3b024..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/main2.js +++ /dev/null @@ -1 +0,0 @@ -import './dep.js'; diff --git a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_config.js b/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_config.js deleted file mode 100644 index 3f5ac1553..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_config.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = defineTest({ - description: - 'Identifies the entry chunk with the manual chunk that has the same entry if the aliases match', - options: { - strictDeprecations: false, - input: { - main: 'main.js' - }, - manualChunks: { - main: ['main'] - } - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/amd/main.js b/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/amd/main.js deleted file mode 100644 index 0dce9285f..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/amd/main.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - console.log('dep'); - - console.log('main'); - - const value = 42; - - exports.value = value; - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/cjs/main.js deleted file mode 100644 index fe59aaab6..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/cjs/main.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -console.log('dep'); - -console.log('main'); - -const value = 42; - -exports.value = value; diff --git a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/es/main.js b/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/es/main.js deleted file mode 100644 index 132b27a8d..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/es/main.js +++ /dev/null @@ -1,7 +0,0 @@ -console.log('dep'); - -console.log('main'); - -const value = 42; - -export { value }; diff --git a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/system/main.js b/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/system/main.js deleted file mode 100644 index 54287b3c8..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/system/main.js +++ /dev/null @@ -1,14 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - console.log('dep'); - - console.log('main'); - - const value = exports('value', 42); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/dep.js b/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/dep.js deleted file mode 100644 index b74a9837c..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/dep.js +++ /dev/null @@ -1 +0,0 @@ -console.log('dep'); diff --git a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/main.js b/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/main.js deleted file mode 100644 index 983ead17e..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/main.js +++ /dev/null @@ -1,5 +0,0 @@ -import './dep.js'; - -console.log('main'); - -export const value = 42; diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_config.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_config.js deleted file mode 100644 index e50efec07..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_config.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = defineTest({ - description: 'manual chunks can have other manual chunks as dependencies', - options: { - strictDeprecations: false, - input: ['main.js'], - manualChunks: { - 'manual-outer': ['outer.js'], - 'manual-inner': ['inner.js'], - 'manual-middle': ['middle.js'] - } - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amd/generated-manual-inner.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amd/generated-manual-inner.js deleted file mode 100644 index a0d11c04e..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amd/generated-manual-inner.js +++ /dev/null @@ -1,5 +0,0 @@ -define((function () { 'use strict'; - - console.log('inner'); - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amd/generated-manual-middle.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amd/generated-manual-middle.js deleted file mode 100644 index 15b8a8171..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amd/generated-manual-middle.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./generated-manual-inner'], (function (manualInner) { 'use strict'; - - console.log('middle'); - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amd/generated-manual-outer.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amd/generated-manual-outer.js deleted file mode 100644 index e40914a91..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amd/generated-manual-outer.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./generated-manual-middle'], (function (manualMiddle) { 'use strict'; - - console.log('outer'); - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amd/main.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amd/main.js deleted file mode 100644 index bab51c5ba..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amd/main.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./generated-manual-outer', './generated-manual-middle', './generated-manual-inner'], (function (manualOuter, manualMiddle, manualInner) { 'use strict'; - - console.log('main'); - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs/generated-manual-inner.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs/generated-manual-inner.js deleted file mode 100644 index 02ef883da..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs/generated-manual-inner.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -console.log('inner'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs/generated-manual-middle.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs/generated-manual-middle.js deleted file mode 100644 index 77da3dd71..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs/generated-manual-middle.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -require('./generated-manual-inner.js'); - -console.log('middle'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs/generated-manual-outer.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs/generated-manual-outer.js deleted file mode 100644 index 8a4efba72..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs/generated-manual-outer.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -require('./generated-manual-middle.js'); - -console.log('outer'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs/main.js deleted file mode 100644 index 70f464747..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs/main.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -require('./generated-manual-outer.js'); -require('./generated-manual-middle.js'); -require('./generated-manual-inner.js'); - -console.log('main'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/es/generated-manual-inner.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/es/generated-manual-inner.js deleted file mode 100644 index 8e1a29ca9..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/es/generated-manual-inner.js +++ /dev/null @@ -1 +0,0 @@ -console.log('inner'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/es/generated-manual-middle.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/es/generated-manual-middle.js deleted file mode 100644 index 247a57bae..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/es/generated-manual-middle.js +++ /dev/null @@ -1,3 +0,0 @@ -import './generated-manual-inner.js'; - -console.log('middle'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/es/generated-manual-outer.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/es/generated-manual-outer.js deleted file mode 100644 index f348b3875..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/es/generated-manual-outer.js +++ /dev/null @@ -1,3 +0,0 @@ -import './generated-manual-middle.js'; - -console.log('outer'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/es/main.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/es/main.js deleted file mode 100644 index 10b9ca2eb..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/es/main.js +++ /dev/null @@ -1,5 +0,0 @@ -import './generated-manual-outer.js'; -import './generated-manual-middle.js'; -import './generated-manual-inner.js'; - -console.log('main'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/system/generated-manual-inner.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/system/generated-manual-inner.js deleted file mode 100644 index 402e3d2df..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/system/generated-manual-inner.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function () { - 'use strict'; - return { - execute: (function () { - - console.log('inner'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/system/generated-manual-middle.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/system/generated-manual-middle.js deleted file mode 100644 index f36fecb95..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/system/generated-manual-middle.js +++ /dev/null @@ -1,11 +0,0 @@ -System.register(['./generated-manual-inner.js'], (function () { - 'use strict'; - return { - setters: [null], - execute: (function () { - - console.log('middle'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/system/generated-manual-outer.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/system/generated-manual-outer.js deleted file mode 100644 index b44b4b9de..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/system/generated-manual-outer.js +++ /dev/null @@ -1,11 +0,0 @@ -System.register(['./generated-manual-middle.js'], (function () { - 'use strict'; - return { - setters: [null], - execute: (function () { - - console.log('outer'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/system/main.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/system/main.js deleted file mode 100644 index 875b0a428..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/system/main.js +++ /dev/null @@ -1,11 +0,0 @@ -System.register(['./generated-manual-outer.js', './generated-manual-middle.js', './generated-manual-inner.js'], (function () { - 'use strict'; - return { - setters: [null, null, null], - execute: (function () { - - console.log('main'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/inner.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/inner.js deleted file mode 100644 index 8e1a29ca9..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/inner.js +++ /dev/null @@ -1 +0,0 @@ -console.log('inner'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/main.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/main.js deleted file mode 100644 index b46ebb222..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import './outer.js'; - -console.log('main'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/middle.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/middle.js deleted file mode 100644 index 007325908..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/middle.js +++ /dev/null @@ -1,3 +0,0 @@ -import './inner.js'; - -console.log('middle'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/outer.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/outer.js deleted file mode 100644 index c77196cec..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/outer.js +++ /dev/null @@ -1,3 +0,0 @@ -import './middle.js'; - -console.log('outer'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_config.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_config.js deleted file mode 100644 index b906013da..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_config.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = defineTest({ - description: 'creates facades for dynamic manual chunks if necessary', - options: { - strictDeprecations: false, - input: ['main.js'], - manualChunks: { - dynamic: ['dynamic1.js'] - } - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/amd/generated-dynamic.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/amd/generated-dynamic.js deleted file mode 100644 index 8568aedda..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/amd/generated-dynamic.js +++ /dev/null @@ -1,34 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - const DEP = 'DEP'; - - const DYNAMIC_2 = 'DYNAMIC_2'; - - var dynamic2 = /*#__PURE__*/Object.freeze({ - __proto__: null, - DYNAMIC_2: DYNAMIC_2 - }); - - const DYNAMIC_3 = 'DYNAMIC_3'; - - var dynamic3 = /*#__PURE__*/Object.freeze({ - __proto__: null, - DYNAMIC_3: DYNAMIC_3 - }); - - const DYNAMIC_1 = 'DYNAMIC_1'; - - var dynamic1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - DEP: DEP, - DYNAMIC_1: DYNAMIC_1, - DYNAMIC_2: DYNAMIC_2, - DYNAMIC_3: DYNAMIC_3 - }); - - exports.DEP = DEP; - exports.dynamic1 = dynamic1; - exports.dynamic2 = dynamic2; - exports.dynamic3 = dynamic3; - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/amd/main.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/amd/main.js deleted file mode 100644 index 7326ba1aa..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/amd/main.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['require', './generated-dynamic'], (function (require, dynamic) { 'use strict'; - - Promise.all([new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(function (n) { return n.dynamic1; }), new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(function (n) { return n.dynamic2; }), new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(function (n) { return n.dynamic3; })]).then( - results => console.log(results, dynamic.DEP) - ); - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/cjs/generated-dynamic.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/cjs/generated-dynamic.js deleted file mode 100644 index d4f21ff81..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/cjs/generated-dynamic.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -const DEP = 'DEP'; - -const DYNAMIC_2 = 'DYNAMIC_2'; - -var dynamic2 = /*#__PURE__*/Object.freeze({ - __proto__: null, - DYNAMIC_2: DYNAMIC_2 -}); - -const DYNAMIC_3 = 'DYNAMIC_3'; - -var dynamic3 = /*#__PURE__*/Object.freeze({ - __proto__: null, - DYNAMIC_3: DYNAMIC_3 -}); - -const DYNAMIC_1 = 'DYNAMIC_1'; - -var dynamic1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - DEP: DEP, - DYNAMIC_1: DYNAMIC_1, - DYNAMIC_2: DYNAMIC_2, - DYNAMIC_3: DYNAMIC_3 -}); - -exports.DEP = DEP; -exports.dynamic1 = dynamic1; -exports.dynamic2 = dynamic2; -exports.dynamic3 = dynamic3; diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/cjs/main.js deleted file mode 100644 index 6d822d5ed..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/cjs/main.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -var dynamic = require('./generated-dynamic.js'); - -Promise.all([Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(function (n) { return n.dynamic1; }), Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(function (n) { return n.dynamic2; }), Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(function (n) { return n.dynamic3; })]).then( - results => console.log(results, dynamic.DEP) -); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/es/generated-dynamic.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/es/generated-dynamic.js deleted file mode 100644 index cff71eaf1..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/es/generated-dynamic.js +++ /dev/null @@ -1,27 +0,0 @@ -const DEP = 'DEP'; - -const DYNAMIC_2 = 'DYNAMIC_2'; - -var dynamic2 = /*#__PURE__*/Object.freeze({ - __proto__: null, - DYNAMIC_2: DYNAMIC_2 -}); - -const DYNAMIC_3 = 'DYNAMIC_3'; - -var dynamic3 = /*#__PURE__*/Object.freeze({ - __proto__: null, - DYNAMIC_3: DYNAMIC_3 -}); - -const DYNAMIC_1 = 'DYNAMIC_1'; - -var dynamic1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - DEP: DEP, - DYNAMIC_1: DYNAMIC_1, - DYNAMIC_2: DYNAMIC_2, - DYNAMIC_3: DYNAMIC_3 -}); - -export { DEP as D, dynamic3 as a, dynamic1 as b, dynamic2 as d }; diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/es/main.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/es/main.js deleted file mode 100644 index 0ef6f970d..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/es/main.js +++ /dev/null @@ -1,5 +0,0 @@ -import { D as DEP } from './generated-dynamic.js'; - -Promise.all([import('./generated-dynamic.js').then(function (n) { return n.b; }), import('./generated-dynamic.js').then(function (n) { return n.d; }), import('./generated-dynamic.js').then(function (n) { return n.a; })]).then( - results => console.log(results, DEP) -); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/system/generated-dynamic.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/system/generated-dynamic.js deleted file mode 100644 index 12d54f94f..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/system/generated-dynamic.js +++ /dev/null @@ -1,37 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - const DEP = exports('D', 'DEP'); - - const DYNAMIC_2 = 'DYNAMIC_2'; - - var dynamic2 = /*#__PURE__*/Object.freeze({ - __proto__: null, - DYNAMIC_2: DYNAMIC_2 - }); - exports('d', dynamic2); - - const DYNAMIC_3 = 'DYNAMIC_3'; - - var dynamic3 = /*#__PURE__*/Object.freeze({ - __proto__: null, - DYNAMIC_3: DYNAMIC_3 - }); - exports('a', dynamic3); - - const DYNAMIC_1 = 'DYNAMIC_1'; - - var dynamic1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - DEP: DEP, - DYNAMIC_1: DYNAMIC_1, - DYNAMIC_2: DYNAMIC_2, - DYNAMIC_3: DYNAMIC_3 - }); - exports('b', dynamic1); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/system/main.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/system/main.js deleted file mode 100644 index f8bb41b07..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/system/main.js +++ /dev/null @@ -1,16 +0,0 @@ -System.register(['./generated-dynamic.js'], (function (exports, module) { - 'use strict'; - var DEP; - return { - setters: [function (module) { - DEP = module.D; - }], - execute: (function () { - - Promise.all([module.import('./generated-dynamic.js').then(function (n) { return n.b; }), module.import('./generated-dynamic.js').then(function (n) { return n.d; }), module.import('./generated-dynamic.js').then(function (n) { return n.a; })]).then( - results => console.log(results, DEP) - ); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/dep.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/dep.js deleted file mode 100644 index 4be514fd7..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/dep.js +++ /dev/null @@ -1 +0,0 @@ -export const DEP = 'DEP'; diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/dynamic1.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/dynamic1.js deleted file mode 100644 index 1591826ea..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/dynamic1.js +++ /dev/null @@ -1,4 +0,0 @@ -export * from './dep.js'; -export * from './dynamic2.js'; -export * from './dynamic3.js'; -export const DYNAMIC_1 = 'DYNAMIC_1'; diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/dynamic2.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/dynamic2.js deleted file mode 100644 index 11eeeb428..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/dynamic2.js +++ /dev/null @@ -1 +0,0 @@ -export const DYNAMIC_2 = 'DYNAMIC_2'; diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/dynamic3.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/dynamic3.js deleted file mode 100644 index 439fa36aa..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/dynamic3.js +++ /dev/null @@ -1 +0,0 @@ -export const DYNAMIC_3 = 'DYNAMIC_3'; diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/main.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/main.js deleted file mode 100644 index 317e03b17..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/main.js +++ /dev/null @@ -1,5 +0,0 @@ -import { DEP } from './dep'; - -Promise.all([import('./dynamic1.js'), import('./dynamic2.js'), import('./dynamic3.js')]).then( - results => console.log(results, DEP) -); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_config.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_config.js deleted file mode 100644 index e9c932a35..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_config.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = defineTest({ - description: 'handles name conflicts in manual chunks', - options: { - strictDeprecations: false, - input: ['main.js'], - manualChunks: { - dynamic: ['dynamic1.js'] - } - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/amd/generated-dynamic.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/amd/generated-dynamic.js deleted file mode 100644 index 166f39a68..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/amd/generated-dynamic.js +++ /dev/null @@ -1,25 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - console.log('dynamic2'); - - const DYNAMIC_A = 'DYNAMIC_A'; - const DYNAMIC_B = 'DYNAMIC_B'; - - var dynamic2 = /*#__PURE__*/Object.freeze({ - __proto__: null, - DYNAMIC_A: DYNAMIC_A, - DYNAMIC_B: DYNAMIC_B - }); - - console.log('dynamic1'); - - var dynamic1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - DYNAMIC_A: DYNAMIC_B, - DYNAMIC_B: DYNAMIC_A - }); - - exports.dynamic1 = dynamic1; - exports.dynamic2 = dynamic2; - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/amd/main.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/amd/main.js deleted file mode 100644 index ac3701e11..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/amd/main.js +++ /dev/null @@ -1,6 +0,0 @@ -define(['require'], (function (require) { 'use strict'; - - new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(function (n) { return n.dynamic1; }).then(result => console.log(result)); - new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(function (n) { return n.dynamic2; }).then(result => console.log(result)); - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/cjs/generated-dynamic.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/cjs/generated-dynamic.js deleted file mode 100644 index fd2a4ea60..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/cjs/generated-dynamic.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -console.log('dynamic2'); - -const DYNAMIC_A = 'DYNAMIC_A'; -const DYNAMIC_B = 'DYNAMIC_B'; - -var dynamic2 = /*#__PURE__*/Object.freeze({ - __proto__: null, - DYNAMIC_A: DYNAMIC_A, - DYNAMIC_B: DYNAMIC_B -}); - -console.log('dynamic1'); - -var dynamic1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - DYNAMIC_A: DYNAMIC_B, - DYNAMIC_B: DYNAMIC_A -}); - -exports.dynamic1 = dynamic1; -exports.dynamic2 = dynamic2; diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/cjs/main.js deleted file mode 100644 index 436abdbbe..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/cjs/main.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(function (n) { return n.dynamic1; }).then(result => console.log(result)); -Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(function (n) { return n.dynamic2; }).then(result => console.log(result)); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/es/generated-dynamic.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/es/generated-dynamic.js deleted file mode 100644 index 9f46b61f9..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/es/generated-dynamic.js +++ /dev/null @@ -1,20 +0,0 @@ -console.log('dynamic2'); - -const DYNAMIC_A = 'DYNAMIC_A'; -const DYNAMIC_B = 'DYNAMIC_B'; - -var dynamic2 = /*#__PURE__*/Object.freeze({ - __proto__: null, - DYNAMIC_A: DYNAMIC_A, - DYNAMIC_B: DYNAMIC_B -}); - -console.log('dynamic1'); - -var dynamic1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - DYNAMIC_A: DYNAMIC_B, - DYNAMIC_B: DYNAMIC_A -}); - -export { dynamic1 as a, dynamic2 as d }; diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/es/main.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/es/main.js deleted file mode 100644 index e6906c3f8..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/es/main.js +++ /dev/null @@ -1,2 +0,0 @@ -import('./generated-dynamic.js').then(function (n) { return n.a; }).then(result => console.log(result)); -import('./generated-dynamic.js').then(function (n) { return n.d; }).then(result => console.log(result)); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/system/generated-dynamic.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/system/generated-dynamic.js deleted file mode 100644 index eaeee4da9..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/system/generated-dynamic.js +++ /dev/null @@ -1,29 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - console.log('dynamic2'); - - const DYNAMIC_A = 'DYNAMIC_A'; - const DYNAMIC_B = 'DYNAMIC_B'; - - var dynamic2 = /*#__PURE__*/Object.freeze({ - __proto__: null, - DYNAMIC_A: DYNAMIC_A, - DYNAMIC_B: DYNAMIC_B - }); - exports('d', dynamic2); - - console.log('dynamic1'); - - var dynamic1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - DYNAMIC_A: DYNAMIC_B, - DYNAMIC_B: DYNAMIC_A - }); - exports('a', dynamic1); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/system/main.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/system/main.js deleted file mode 100644 index ac2320103..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/system/main.js +++ /dev/null @@ -1,11 +0,0 @@ -System.register([], (function (exports, module) { - 'use strict'; - return { - execute: (function () { - - module.import('./generated-dynamic.js').then(function (n) { return n.a; }).then(result => console.log(result)); - module.import('./generated-dynamic.js').then(function (n) { return n.d; }).then(result => console.log(result)); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/dynamic1.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/dynamic1.js deleted file mode 100644 index ee02308dd..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/dynamic1.js +++ /dev/null @@ -1,3 +0,0 @@ -console.log('dynamic1'); - -export { DYNAMIC_A as DYNAMIC_B, DYNAMIC_B as DYNAMIC_A } from './dynamic2'; diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/dynamic2.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/dynamic2.js deleted file mode 100644 index 6d087c59d..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/dynamic2.js +++ /dev/null @@ -1,4 +0,0 @@ -console.log('dynamic2'); - -export const DYNAMIC_A = 'DYNAMIC_A'; -export const DYNAMIC_B = 'DYNAMIC_B'; diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/main.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/main.js deleted file mode 100644 index 9e2abfea0..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/main.js +++ /dev/null @@ -1,2 +0,0 @@ -import('./dynamic1.js').then(result => console.log(result)); -import('./dynamic2.js').then(result => console.log(result)); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_config.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_config.js deleted file mode 100644 index 2501bda21..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_config.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = defineTest({ - description: 'supports dynamic manual chunks', - options: { - strictDeprecations: false, - input: ['main.js'], - manualChunks: { - dynamic: ['dynamic.js'] - } - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/amd/generated-dynamic.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/amd/generated-dynamic.js deleted file mode 100644 index 49c2415e4..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/amd/generated-dynamic.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - const DYNAMIC_USED_BY_A = 'DYNAMIC_USED_BY_A'; - - exports.DYNAMIC_USED_BY_A = DYNAMIC_USED_BY_A; - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/amd/main.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/amd/main.js deleted file mode 100644 index 9dd81f187..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/amd/main.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['require'], (function (require) { 'use strict'; - - new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(({DYNAMIC_USED_BY_A}) => console.log(DYNAMIC_USED_BY_A)); - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/cjs/generated-dynamic.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/cjs/generated-dynamic.js deleted file mode 100644 index 28e15f913..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/cjs/generated-dynamic.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -const DYNAMIC_USED_BY_A = 'DYNAMIC_USED_BY_A'; - -exports.DYNAMIC_USED_BY_A = DYNAMIC_USED_BY_A; diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/cjs/main.js deleted file mode 100644 index 48ed2ac42..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/cjs/main.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(({DYNAMIC_USED_BY_A}) => console.log(DYNAMIC_USED_BY_A)); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/es/generated-dynamic.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/es/generated-dynamic.js deleted file mode 100644 index 4ccf63214..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/es/generated-dynamic.js +++ /dev/null @@ -1,3 +0,0 @@ -const DYNAMIC_USED_BY_A = 'DYNAMIC_USED_BY_A'; - -export { DYNAMIC_USED_BY_A }; diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/es/main.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/es/main.js deleted file mode 100644 index aefad148d..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/es/main.js +++ /dev/null @@ -1 +0,0 @@ -import('./generated-dynamic.js').then(({DYNAMIC_USED_BY_A}) => console.log(DYNAMIC_USED_BY_A)); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/system/generated-dynamic.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/system/generated-dynamic.js deleted file mode 100644 index 7cf6795c0..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/system/generated-dynamic.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - const DYNAMIC_USED_BY_A = exports('DYNAMIC_USED_BY_A', 'DYNAMIC_USED_BY_A'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/system/main.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/system/main.js deleted file mode 100644 index df0f0195b..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/system/main.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports, module) { - 'use strict'; - return { - execute: (function () { - - module.import('./generated-dynamic.js').then(({DYNAMIC_USED_BY_A}) => console.log(DYNAMIC_USED_BY_A)); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic/dynamic.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic/dynamic.js deleted file mode 100644 index 38cb5406d..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic/dynamic.js +++ /dev/null @@ -1 +0,0 @@ -export const DYNAMIC_USED_BY_A = 'DYNAMIC_USED_BY_A'; \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic/main.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic/main.js deleted file mode 100644 index c4c598881..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic/main.js +++ /dev/null @@ -1 +0,0 @@ -import('./dynamic.js').then(({DYNAMIC_USED_BY_A}) => console.log(DYNAMIC_USED_BY_A)); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-function/_config.js b/test/chunking-form/samples/deprecated/manual-chunks-function/_config.js deleted file mode 100644 index 8952acaec..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-function/_config.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = defineTest({ - description: 'allows to define manual chunks via a function', - options: { - strictDeprecations: false, - input: ['main-a'], - manualChunks(id) { - if (id[id.length - 5] === '-') { - return `chunk-${id[id.length - 4]}`; - } - } - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/amd/generated-chunk-b.js b/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/amd/generated-chunk-b.js deleted file mode 100644 index 4e491fbab..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/amd/generated-chunk-b.js +++ /dev/null @@ -1,7 +0,0 @@ -define((function () { 'use strict'; - - console.log('dep2'); - - console.log('dep-b'); - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/amd/generated-chunk-c.js b/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/amd/generated-chunk-c.js deleted file mode 100644 index 0fbaf713d..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/amd/generated-chunk-c.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./generated-chunk-b'], (function (chunkB) { 'use strict'; - - console.log('dep-c'); - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/amd/main-a.js b/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/amd/main-a.js deleted file mode 100644 index e3934b106..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/amd/main-a.js +++ /dev/null @@ -1,9 +0,0 @@ -define(['./generated-chunk-c', './generated-chunk-b'], (function (chunkC, chunkB) { 'use strict'; - - console.log('dep1'); - - console.log('dep-a'); - - console.log('main-a'); - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/cjs/generated-chunk-b.js b/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/cjs/generated-chunk-b.js deleted file mode 100644 index 51b3d3e3d..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/cjs/generated-chunk-b.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -console.log('dep2'); - -console.log('dep-b'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/cjs/generated-chunk-c.js b/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/cjs/generated-chunk-c.js deleted file mode 100644 index d8349602b..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/cjs/generated-chunk-c.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -require('./generated-chunk-b.js'); - -console.log('dep-c'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/cjs/main-a.js b/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/cjs/main-a.js deleted file mode 100644 index 2d8f820fd..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/cjs/main-a.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -require('./generated-chunk-c.js'); -require('./generated-chunk-b.js'); - -console.log('dep1'); - -console.log('dep-a'); - -console.log('main-a'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/es/generated-chunk-b.js b/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/es/generated-chunk-b.js deleted file mode 100644 index 16fb2a902..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/es/generated-chunk-b.js +++ /dev/null @@ -1,3 +0,0 @@ -console.log('dep2'); - -console.log('dep-b'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/es/generated-chunk-c.js b/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/es/generated-chunk-c.js deleted file mode 100644 index 78ee7d95d..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/es/generated-chunk-c.js +++ /dev/null @@ -1,3 +0,0 @@ -import './generated-chunk-b.js'; - -console.log('dep-c'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/es/main-a.js b/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/es/main-a.js deleted file mode 100644 index d3864b714..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/es/main-a.js +++ /dev/null @@ -1,8 +0,0 @@ -import './generated-chunk-c.js'; -import './generated-chunk-b.js'; - -console.log('dep1'); - -console.log('dep-a'); - -console.log('main-a'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/system/generated-chunk-b.js b/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/system/generated-chunk-b.js deleted file mode 100644 index 5dd8fc974..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/system/generated-chunk-b.js +++ /dev/null @@ -1,12 +0,0 @@ -System.register([], (function () { - 'use strict'; - return { - execute: (function () { - - console.log('dep2'); - - console.log('dep-b'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/system/generated-chunk-c.js b/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/system/generated-chunk-c.js deleted file mode 100644 index 07a992419..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/system/generated-chunk-c.js +++ /dev/null @@ -1,11 +0,0 @@ -System.register(['./generated-chunk-b.js'], (function () { - 'use strict'; - return { - setters: [null], - execute: (function () { - - console.log('dep-c'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/system/main-a.js b/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/system/main-a.js deleted file mode 100644 index 9b06dfa55..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/system/main-a.js +++ /dev/null @@ -1,15 +0,0 @@ -System.register(['./generated-chunk-c.js', './generated-chunk-b.js'], (function () { - 'use strict'; - return { - setters: [null, null], - execute: (function () { - - console.log('dep1'); - - console.log('dep-a'); - - console.log('main-a'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-function/dep-a.js b/test/chunking-form/samples/deprecated/manual-chunks-function/dep-a.js deleted file mode 100644 index 5cf180c14..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-function/dep-a.js +++ /dev/null @@ -1,4 +0,0 @@ -import './dep-c'; -import './dep1'; - -console.log('dep-a'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-function/dep-b.js b/test/chunking-form/samples/deprecated/manual-chunks-function/dep-b.js deleted file mode 100644 index 67c590f58..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-function/dep-b.js +++ /dev/null @@ -1,3 +0,0 @@ -import './dep2'; - -console.log('dep-b'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-function/dep-c.js b/test/chunking-form/samples/deprecated/manual-chunks-function/dep-c.js deleted file mode 100644 index 3934b0ad9..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-function/dep-c.js +++ /dev/null @@ -1,3 +0,0 @@ -import './dep2'; - -console.log('dep-c'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-function/dep1.js b/test/chunking-form/samples/deprecated/manual-chunks-function/dep1.js deleted file mode 100644 index 6aa6066ce..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-function/dep1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('dep1'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-function/dep2.js b/test/chunking-form/samples/deprecated/manual-chunks-function/dep2.js deleted file mode 100644 index f5325d80e..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-function/dep2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('dep2'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-function/main-a.js b/test/chunking-form/samples/deprecated/manual-chunks-function/main-a.js deleted file mode 100644 index cf97f330a..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-function/main-a.js +++ /dev/null @@ -1,4 +0,0 @@ -import './dep-a'; -import './dep-b'; - -console.log('main-a'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-nested/_config.js b/test/chunking-form/samples/deprecated/manual-chunks-nested/_config.js deleted file mode 100644 index e988680a0..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-nested/_config.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = defineTest({ - description: 'manual chunks can contain nested modules', - options: { - strictDeprecations: false, - input: ['main.js'], - manualChunks: { - manual: ['middle.js', 'inner.js', 'outer.js'] - } - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/amd/generated-manual.js b/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/amd/generated-manual.js deleted file mode 100644 index 3c9aa92fa..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/amd/generated-manual.js +++ /dev/null @@ -1,9 +0,0 @@ -define((function () { 'use strict'; - - console.log('inner'); - - console.log('middle'); - - console.log('outer'); - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/amd/main.js b/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/amd/main.js deleted file mode 100644 index b9a9d6430..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/amd/main.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./generated-manual'], (function (manual) { 'use strict'; - - console.log('main'); - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/cjs/generated-manual.js b/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/cjs/generated-manual.js deleted file mode 100644 index 3ce3b1a69..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/cjs/generated-manual.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -console.log('inner'); - -console.log('middle'); - -console.log('outer'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/cjs/main.js deleted file mode 100644 index f679e51bf..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/cjs/main.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -require('./generated-manual.js'); - -console.log('main'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/es/generated-manual.js b/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/es/generated-manual.js deleted file mode 100644 index 7abdcd7f1..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/es/generated-manual.js +++ /dev/null @@ -1,5 +0,0 @@ -console.log('inner'); - -console.log('middle'); - -console.log('outer'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/es/main.js b/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/es/main.js deleted file mode 100644 index ddeb648f1..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/es/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import './generated-manual.js'; - -console.log('main'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/system/generated-manual.js b/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/system/generated-manual.js deleted file mode 100644 index 4596d906e..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/system/generated-manual.js +++ /dev/null @@ -1,14 +0,0 @@ -System.register([], (function () { - 'use strict'; - return { - execute: (function () { - - console.log('inner'); - - console.log('middle'); - - console.log('outer'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/system/main.js b/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/system/main.js deleted file mode 100644 index 3e762e61f..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/system/main.js +++ /dev/null @@ -1,11 +0,0 @@ -System.register(['./generated-manual.js'], (function () { - 'use strict'; - return { - setters: [null], - execute: (function () { - - console.log('main'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-nested/inner.js b/test/chunking-form/samples/deprecated/manual-chunks-nested/inner.js deleted file mode 100644 index 8e1a29ca9..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-nested/inner.js +++ /dev/null @@ -1 +0,0 @@ -console.log('inner'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-nested/main.js b/test/chunking-form/samples/deprecated/manual-chunks-nested/main.js deleted file mode 100644 index b46ebb222..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-nested/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import './outer.js'; - -console.log('main'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-nested/middle.js b/test/chunking-form/samples/deprecated/manual-chunks-nested/middle.js deleted file mode 100644 index 007325908..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-nested/middle.js +++ /dev/null @@ -1,3 +0,0 @@ -import './inner.js'; - -console.log('middle'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks-nested/outer.js b/test/chunking-form/samples/deprecated/manual-chunks-nested/outer.js deleted file mode 100644 index c77196cec..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks-nested/outer.js +++ /dev/null @@ -1,3 +0,0 @@ -import './middle.js'; - -console.log('outer'); diff --git a/test/chunking-form/samples/deprecated/manual-chunks/_config.js b/test/chunking-form/samples/deprecated/manual-chunks/_config.js deleted file mode 100644 index 08bb1489d..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks/_config.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = defineTest({ - description: 'manual chunks support', - options: { - strictDeprecations: false, - input: ['main.js'], - manualChunks: { - lib1: ['lib1.js'], - deps2and3: ['dep2.js', 'dep3.js'] - } - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/manual-chunks/_expected/amd/generated-deps2and3.js b/test/chunking-form/samples/deprecated/manual-chunks/_expected/amd/generated-deps2and3.js deleted file mode 100644 index 2321db642..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks/_expected/amd/generated-deps2and3.js +++ /dev/null @@ -1,20 +0,0 @@ -define(['exports', './generated-lib1'], (function (exports, lib1) { 'use strict'; - - function fn$2 () { - console.log('lib2 fn'); - } - - function fn$1 () { - fn$2(); - console.log('dep2 fn'); - } - - function fn () { - lib1.fn(); - console.log('dep3 fn'); - } - - exports.fn = fn$1; - exports.fn$1 = fn; - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks/_expected/amd/generated-lib1.js b/test/chunking-form/samples/deprecated/manual-chunks/_expected/amd/generated-lib1.js deleted file mode 100644 index 6d846653c..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks/_expected/amd/generated-lib1.js +++ /dev/null @@ -1,9 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - function fn () { - console.log('lib1 fn'); - } - - exports.fn = fn; - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks/_expected/amd/main.js b/test/chunking-form/samples/deprecated/manual-chunks/_expected/amd/main.js deleted file mode 100644 index 89925cb11..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks/_expected/amd/main.js +++ /dev/null @@ -1,17 +0,0 @@ -define(['./generated-deps2and3', './generated-lib1'], (function (deps2and3, lib1) { 'use strict'; - - function fn () { - console.log('dep1 fn'); - } - - class Main { - constructor () { - fn(); - deps2and3.fn(); - deps2and3.fn$1(); - } - } - - return Main; - -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks/_expected/cjs/generated-deps2and3.js b/test/chunking-form/samples/deprecated/manual-chunks/_expected/cjs/generated-deps2and3.js deleted file mode 100644 index b9087cf6b..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks/_expected/cjs/generated-deps2and3.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -var lib1 = require('./generated-lib1.js'); - -function fn$2 () { - console.log('lib2 fn'); -} - -function fn$1 () { - fn$2(); - console.log('dep2 fn'); -} - -function fn () { - lib1.fn(); - console.log('dep3 fn'); -} - -exports.fn = fn$1; -exports.fn$1 = fn; diff --git a/test/chunking-form/samples/deprecated/manual-chunks/_expected/cjs/generated-lib1.js b/test/chunking-form/samples/deprecated/manual-chunks/_expected/cjs/generated-lib1.js deleted file mode 100644 index 6a9d99129..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks/_expected/cjs/generated-lib1.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -function fn () { - console.log('lib1 fn'); -} - -exports.fn = fn; diff --git a/test/chunking-form/samples/deprecated/manual-chunks/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/manual-chunks/_expected/cjs/main.js deleted file mode 100644 index 2a68746ba..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks/_expected/cjs/main.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -var deps2and3 = require('./generated-deps2and3.js'); -require('./generated-lib1.js'); - -function fn () { - console.log('dep1 fn'); -} - -class Main { - constructor () { - fn(); - deps2and3.fn(); - deps2and3.fn$1(); - } -} - -module.exports = Main; diff --git a/test/chunking-form/samples/deprecated/manual-chunks/_expected/es/generated-deps2and3.js b/test/chunking-form/samples/deprecated/manual-chunks/_expected/es/generated-deps2and3.js deleted file mode 100644 index 7e3f8acc1..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks/_expected/es/generated-deps2and3.js +++ /dev/null @@ -1,17 +0,0 @@ -import { f as fn$3 } from './generated-lib1.js'; - -function fn$2 () { - console.log('lib2 fn'); -} - -function fn$1 () { - fn$2(); - console.log('dep2 fn'); -} - -function fn () { - fn$3(); - console.log('dep3 fn'); -} - -export { fn as a, fn$1 as f }; diff --git a/test/chunking-form/samples/deprecated/manual-chunks/_expected/es/generated-lib1.js b/test/chunking-form/samples/deprecated/manual-chunks/_expected/es/generated-lib1.js deleted file mode 100644 index ae5cdca14..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks/_expected/es/generated-lib1.js +++ /dev/null @@ -1,5 +0,0 @@ -function fn () { - console.log('lib1 fn'); -} - -export { fn as f }; diff --git a/test/chunking-form/samples/deprecated/manual-chunks/_expected/es/main.js b/test/chunking-form/samples/deprecated/manual-chunks/_expected/es/main.js deleted file mode 100644 index 6982299f9..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks/_expected/es/main.js +++ /dev/null @@ -1,16 +0,0 @@ -import { f as fn$1, a as fn$2 } from './generated-deps2and3.js'; -import './generated-lib1.js'; - -function fn () { - console.log('dep1 fn'); -} - -class Main { - constructor () { - fn(); - fn$1(); - fn$2(); - } -} - -export { Main as default }; diff --git a/test/chunking-form/samples/deprecated/manual-chunks/_expected/system/generated-deps2and3.js b/test/chunking-form/samples/deprecated/manual-chunks/_expected/system/generated-deps2and3.js deleted file mode 100644 index a0867bcd9..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks/_expected/system/generated-deps2and3.js +++ /dev/null @@ -1,31 +0,0 @@ -System.register(['./generated-lib1.js'], (function (exports) { - 'use strict'; - var fn$3; - return { - setters: [function (module) { - fn$3 = module.f; - }], - execute: (function () { - - exports({ - a: fn, - f: fn$1 - }); - - function fn$2 () { - console.log('lib2 fn'); - } - - function fn$1 () { - fn$2(); - console.log('dep2 fn'); - } - - function fn () { - fn$3(); - console.log('dep3 fn'); - } - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks/_expected/system/generated-lib1.js b/test/chunking-form/samples/deprecated/manual-chunks/_expected/system/generated-lib1.js deleted file mode 100644 index a6918ea9b..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks/_expected/system/generated-lib1.js +++ /dev/null @@ -1,14 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - exports('f', fn); - - function fn () { - console.log('lib1 fn'); - } - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks/_expected/system/main.js b/test/chunking-form/samples/deprecated/manual-chunks/_expected/system/main.js deleted file mode 100644 index 61a751d32..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks/_expected/system/main.js +++ /dev/null @@ -1,25 +0,0 @@ -System.register(['./generated-deps2and3.js', './generated-lib1.js'], (function (exports) { - 'use strict'; - var fn$1, fn$2; - return { - setters: [function (module) { - fn$1 = module.f; - fn$2 = module.a; - }, null], - execute: (function () { - - function fn () { - console.log('dep1 fn'); - } - - class Main { - constructor () { - fn(); - fn$1(); - fn$2(); - } - } exports('default', Main); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/manual-chunks/dep1.js b/test/chunking-form/samples/deprecated/manual-chunks/dep1.js deleted file mode 100644 index b67d0bbb2..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks/dep1.js +++ /dev/null @@ -1,3 +0,0 @@ -export function fn () { - console.log('dep1 fn'); -} \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/manual-chunks/dep2.js b/test/chunking-form/samples/deprecated/manual-chunks/dep2.js deleted file mode 100644 index 1549fc164..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks/dep2.js +++ /dev/null @@ -1,6 +0,0 @@ -import { fn as libfn } from './lib2.js'; - -export function fn () { - libfn(); - console.log('dep2 fn'); -} \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/manual-chunks/dep3.js b/test/chunking-form/samples/deprecated/manual-chunks/dep3.js deleted file mode 100644 index 4e3222210..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks/dep3.js +++ /dev/null @@ -1,8 +0,0 @@ -import { fn as libfn, treeshaked } from './lib1.js'; - -export function fn () { - libfn(); - console.log('dep3 fn'); -} - -export default treeshaked; \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/manual-chunks/lib1.js b/test/chunking-form/samples/deprecated/manual-chunks/lib1.js deleted file mode 100644 index 5ccf83b35..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks/lib1.js +++ /dev/null @@ -1,7 +0,0 @@ -export function fn () { - console.log('lib1 fn'); -} - -export function treeshaked () { - console.log('this is tree shaken!'); -} \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/manual-chunks/lib2.js b/test/chunking-form/samples/deprecated/manual-chunks/lib2.js deleted file mode 100644 index 2d6d2cf08..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks/lib2.js +++ /dev/null @@ -1,3 +0,0 @@ -export function fn () { - console.log('lib2 fn'); -} \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/manual-chunks/main.js b/test/chunking-form/samples/deprecated/manual-chunks/main.js deleted file mode 100644 index d65cf01a5..000000000 --- a/test/chunking-form/samples/deprecated/manual-chunks/main.js +++ /dev/null @@ -1,15 +0,0 @@ -import { fn } from './dep1.js'; -import { fn as fn2 } from './dep2.js'; -import { fn as fn3, default as treeshaked } from './dep3.js'; - -if (false) { - treeshaked(); -} - -export default class Main { - constructor () { - fn(); - fn2(); - fn3(); - } -} \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_config.js b/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_config.js deleted file mode 100644 index 3204a18a8..000000000 --- a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_config.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = defineTest({ - description: 'handles using dependencies with shimmed missing exports as ', - expectedWarnings: ['SHIMMED_EXPORT', 'DEPRECATED_FEATURE'], - options: { - strictDeprecations: false, - input: ['main.js'], - preserveModules: true, - shimMissingExports: true - } -}); diff --git a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/amd/dep1.js b/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/amd/dep1.js deleted file mode 100644 index 1ebb9552c..000000000 --- a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/amd/dep1.js +++ /dev/null @@ -1,17 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - var _missingExportShim = void 0; - - console.log('This is the output when a missing export is used internally but not reexported'); - - function almostUseUnused(useIt) { - if (useIt) { - console.log(_missingExportShim); - } - } - - almostUseUnused(false); - - exports.missing1 = _missingExportShim; - -})); diff --git a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/amd/dep2.js b/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/amd/dep2.js deleted file mode 100644 index 94c9d52cf..000000000 --- a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/amd/dep2.js +++ /dev/null @@ -1,14 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - var _missingExportShim = void 0; - - console.log('This is the output when a missing export is reexported'); - - var _missingExportShim$1 = void 0; - - console.log(_missingExportShim$1); - - exports.missing2 = _missingExportShim; - exports.previousShimmedExport = _missingExportShim$1; - -})); diff --git a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/amd/main.js b/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/amd/main.js deleted file mode 100644 index 86f8c8336..000000000 --- a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/amd/main.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./dep1', './dep2'], (function (dep1, dep2) { 'use strict'; - - console.log(dep1.missing1, dep2.missing2, dep2.previousShimmedExport); - -})); diff --git a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/cjs/dep1.js b/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/cjs/dep1.js deleted file mode 100644 index a024bcd6f..000000000 --- a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/cjs/dep1.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -var _missingExportShim = void 0; - -console.log('This is the output when a missing export is used internally but not reexported'); - -function almostUseUnused(useIt) { - if (useIt) { - console.log(_missingExportShim); - } -} - -almostUseUnused(false); - -exports.missing1 = _missingExportShim; diff --git a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/cjs/dep2.js b/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/cjs/dep2.js deleted file mode 100644 index f411ae569..000000000 --- a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/cjs/dep2.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -var _missingExportShim = void 0; - -console.log('This is the output when a missing export is reexported'); - -var _missingExportShim$1 = void 0; - -console.log(_missingExportShim$1); - -exports.missing2 = _missingExportShim; -exports.previousShimmedExport = _missingExportShim$1; diff --git a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/cjs/main.js deleted file mode 100644 index 0a8ed0c59..000000000 --- a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/cjs/main.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -var dep1 = require('./dep1.js'); -var dep2 = require('./dep2.js'); - -console.log(dep1.missing1, dep2.missing2, dep2.previousShimmedExport); diff --git a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/es/dep1.js b/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/es/dep1.js deleted file mode 100644 index 99f4196bf..000000000 --- a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/es/dep1.js +++ /dev/null @@ -1,13 +0,0 @@ -var _missingExportShim = void 0; - -console.log('This is the output when a missing export is used internally but not reexported'); - -function almostUseUnused(useIt) { - if (useIt) { - console.log(_missingExportShim); - } -} - -almostUseUnused(false); - -export { _missingExportShim as missing1 }; diff --git a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/es/dep2.js b/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/es/dep2.js deleted file mode 100644 index 1957fef7b..000000000 --- a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/es/dep2.js +++ /dev/null @@ -1,9 +0,0 @@ -var _missingExportShim = void 0; - -console.log('This is the output when a missing export is reexported'); - -var _missingExportShim$1 = void 0; - -console.log(_missingExportShim$1); - -export { _missingExportShim as missing2, _missingExportShim$1 as previousShimmedExport }; diff --git a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/es/main.js b/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/es/main.js deleted file mode 100644 index ea2616a1c..000000000 --- a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/es/main.js +++ /dev/null @@ -1,4 +0,0 @@ -import { missing1 as _missingExportShim } from './dep1.js'; -import { missing2 as _missingExportShim$1, previousShimmedExport as _missingExportShim$2 } from './dep2.js'; - -console.log(_missingExportShim, _missingExportShim$1, _missingExportShim$2); diff --git a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/system/dep1.js b/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/system/dep1.js deleted file mode 100644 index 566b812c7..000000000 --- a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/system/dep1.js +++ /dev/null @@ -1,22 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - var _missingExportShim = void 0; - - console.log('This is the output when a missing export is used internally but not reexported'); - - function almostUseUnused(useIt) { - if (useIt) { - console.log(_missingExportShim); - } - } - - almostUseUnused(false); - - exports('missing1', _missingExportShim); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/system/dep2.js b/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/system/dep2.js deleted file mode 100644 index 3683f4b73..000000000 --- a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/system/dep2.js +++ /dev/null @@ -1,18 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - var _missingExportShim = void 0; - - console.log('This is the output when a missing export is reexported'); - - var _missingExportShim$1 = exports('previousShimmedExport', void 0); - - console.log(_missingExportShim$1); - - exports('missing2', _missingExportShim); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/system/main.js b/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/system/main.js deleted file mode 100644 index 85562809d..000000000 --- a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/system/main.js +++ /dev/null @@ -1,17 +0,0 @@ -System.register(['./dep1.js', './dep2.js'], (function () { - 'use strict'; - var _missingExportShim, _missingExportShim$1, _missingExportShim$2; - return { - setters: [function (module) { - _missingExportShim = module.missing1; - }, function (module) { - _missingExportShim$1 = module.missing2; - _missingExportShim$2 = module.previousShimmedExport; - }], - execute: (function () { - - console.log(_missingExportShim, _missingExportShim$1, _missingExportShim$2); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/dep1.js b/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/dep1.js deleted file mode 100644 index 84e22e0fe..000000000 --- a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/dep1.js +++ /dev/null @@ -1,9 +0,0 @@ -console.log('This is the output when a missing export is used internally but not reexported'); - -function almostUseUnused(useIt) { - if (useIt) { - console.log(_missingExportShim); - } -} - -almostUseUnused(false); diff --git a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/dep2.js b/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/dep2.js deleted file mode 100644 index e49bb16dd..000000000 --- a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/dep2.js +++ /dev/null @@ -1,7 +0,0 @@ -console.log('This is the output when a missing export is reexported'); - -var _missingExportShim = void 0; - -console.log(_missingExportShim); - -export {_missingExportShim as previousShimmedExport} diff --git a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/main.js b/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/main.js deleted file mode 100644 index 167c08b23..000000000 --- a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/main.js +++ /dev/null @@ -1,4 +0,0 @@ -import { missing1 } from './dep1.js'; -import { missing2, previousShimmedExport } from './dep2.js'; - -console.log(missing1, missing2, previousShimmedExport); diff --git a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_config.js b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_config.js deleted file mode 100644 index acbfd7b6c..000000000 --- a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_config.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = defineTest({ - description: - 'adds Symbol.toStringTag property to dynamic imports of entry chunks with default export mode', - options: { - strictDeprecations: false, - input: ['main', 'foo'], - output: { - namespaceToStringTag: true - } - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/amd/foo.js b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/amd/foo.js deleted file mode 100644 index 69228f8fb..000000000 --- a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/amd/foo.js +++ /dev/null @@ -1,7 +0,0 @@ -define((function () { 'use strict'; - - var foo = 42; - - return foo; - -})); diff --git a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/amd/main.js b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/amd/main.js deleted file mode 100644 index 8f783a26d..000000000 --- a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/amd/main.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['require'], (function (require) { 'use strict'; - - function _interopNamespaceDefaultOnly (e) { return Object.freeze(Object.defineProperty({ __proto__: null, default: e }, Symbol.toStringTag, { value: 'Module' })); } - - new Promise(function (resolve, reject) { require(['./foo'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefaultOnly(m)); }, reject); }).then(console.log); - -})); diff --git a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/cjs/foo.js b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/cjs/foo.js deleted file mode 100644 index 476c8ac92..000000000 --- a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/cjs/foo.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var foo = 42; - -module.exports = foo; diff --git a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/cjs/main.js deleted file mode 100644 index fc716bca3..000000000 --- a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/cjs/main.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -function _interopNamespaceDefaultOnly (e) { return Object.freeze(Object.defineProperty({ __proto__: null, default: e }, Symbol.toStringTag, { value: 'Module' })); } - -Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./foo.js')); }).then(console.log); diff --git a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/es/foo.js b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/es/foo.js deleted file mode 100644 index 2685886fe..000000000 --- a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/es/foo.js +++ /dev/null @@ -1,3 +0,0 @@ -var foo = 42; - -export { foo as default }; diff --git a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/es/main.js b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/es/main.js deleted file mode 100644 index 1c55d6393..000000000 --- a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/es/main.js +++ /dev/null @@ -1 +0,0 @@ -import('./foo.js').then(console.log); diff --git a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/system/foo.js b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/system/foo.js deleted file mode 100644 index 98793de89..000000000 --- a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/system/foo.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - var foo = exports('default', 42); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/system/main.js b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/system/main.js deleted file mode 100644 index a5552580f..000000000 --- a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/system/main.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports, module) { - 'use strict'; - return { - execute: (function () { - - module.import('./foo.js').then(console.log); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/foo.js b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/foo.js deleted file mode 100644 index 7a4e8a723..000000000 --- a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/foo.js +++ /dev/null @@ -1 +0,0 @@ -export default 42; diff --git a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/main.js b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/main.js deleted file mode 100644 index 999da1256..000000000 --- a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/main.js +++ /dev/null @@ -1 +0,0 @@ -import('./foo').then(console.log); diff --git a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_config.js b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_config.js deleted file mode 100644 index 575cabf50..000000000 --- a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_config.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = defineTest({ - description: 'adds Symbol.toStringTag property to dynamic imports', - options: { - strictDeprecations: false, - output: { - namespaceToStringTag: true - } - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/amd/generated-foo.js b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/amd/generated-foo.js deleted file mode 100644 index ceaf138a5..000000000 --- a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/amd/generated-foo.js +++ /dev/null @@ -1,9 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - const bar = 42; - - exports.bar = bar; - - Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); - -})); diff --git a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/amd/main.js b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/amd/main.js deleted file mode 100644 index 5268640ba..000000000 --- a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/amd/main.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['require'], (function (require) { 'use strict'; - - new Promise(function (resolve, reject) { require(['./generated-foo'], resolve, reject); }).then(console.log); - -})); diff --git a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/cjs/generated-foo.js b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/cjs/generated-foo.js deleted file mode 100644 index 7e415cb77..000000000 --- a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/cjs/generated-foo.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); - -const bar = 42; - -exports.bar = bar; diff --git a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/cjs/main.js deleted file mode 100644 index 3fac08fba..000000000 --- a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/cjs/main.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -Promise.resolve().then(function () { return require('./generated-foo.js'); }).then(console.log); diff --git a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/es/generated-foo.js b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/es/generated-foo.js deleted file mode 100644 index 540eb09fb..000000000 --- a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/es/generated-foo.js +++ /dev/null @@ -1,3 +0,0 @@ -const bar = 42; - -export { bar }; diff --git a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/es/main.js b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/es/main.js deleted file mode 100644 index 7d43c4003..000000000 --- a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/es/main.js +++ /dev/null @@ -1 +0,0 @@ -import('./generated-foo.js').then(console.log); diff --git a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/system/generated-foo.js b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/system/generated-foo.js deleted file mode 100644 index f77176add..000000000 --- a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/system/generated-foo.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - const bar = exports('bar', 42); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/system/main.js b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/system/main.js deleted file mode 100644 index ed21ee675..000000000 --- a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/system/main.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports, module) { - 'use strict'; - return { - execute: (function () { - - module.import('./generated-foo.js').then(console.log); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/foo.js b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/foo.js deleted file mode 100644 index 308e102fe..000000000 --- a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/foo.js +++ /dev/null @@ -1 +0,0 @@ -export const bar = 42; diff --git a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/main.js b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/main.js deleted file mode 100644 index 999da1256..000000000 --- a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/main.js +++ /dev/null @@ -1 +0,0 @@ -import('./foo').then(console.log); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_config.js deleted file mode 100644 index 0c0972b78..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_config.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = defineTest({ - description: 'Uses entry point semantics for all files when preserving modules', - options: { - strictDeprecations: false, - input: 'main.js', - preserveModules: true - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/amd/default.js b/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/amd/default.js deleted file mode 100644 index 855cb78e2..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/amd/default.js +++ /dev/null @@ -1,7 +0,0 @@ -define((function () { 'use strict'; - - var foo = 'default'; - - return foo; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/amd/main.js b/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/amd/main.js deleted file mode 100644 index fdb3413c4..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/amd/main.js +++ /dev/null @@ -1,12 +0,0 @@ -define(['require', './default', './named'], (function (require, _default, named) { 'use strict'; - - function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } - - console.log(_default, named.value); - - new Promise(function (resolve, reject) { require(['./default'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefaultOnly(m)); }, reject); }).then(result => console.log(result.default)); - new Promise(function (resolve, reject) { require(['./named'], resolve, reject); }).then(result => console.log(result.value)); - - return _default; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/amd/named.js b/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/amd/named.js deleted file mode 100644 index 2896dcf10..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/amd/named.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - const value = 'named'; - - exports.value = value; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/cjs/default.js b/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/cjs/default.js deleted file mode 100644 index f670b985a..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/cjs/default.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var foo = 'default'; - -module.exports = foo; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/cjs/main.js deleted file mode 100644 index 5f9d03b26..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/cjs/main.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -var _default = require('./default.js'); -var named = require('./named.js'); - -function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } - -console.log(_default, named.value); - -Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./default.js')); }).then(result => console.log(result.default)); -Promise.resolve().then(function () { return require('./named.js'); }).then(result => console.log(result.value)); - -module.exports = _default; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/cjs/named.js b/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/cjs/named.js deleted file mode 100644 index ec20bc0d7..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/cjs/named.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -const value = 'named'; - -exports.value = value; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/es/default.js b/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/es/default.js deleted file mode 100644 index 888d95cb3..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/es/default.js +++ /dev/null @@ -1,3 +0,0 @@ -var foo = 'default'; - -export { foo as default }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/es/main.js b/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/es/main.js deleted file mode 100644 index 4aad85561..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/es/main.js +++ /dev/null @@ -1,9 +0,0 @@ -import foo from './default.js'; -import { value } from './named.js'; - -console.log(foo, value); - -import('./default.js').then(result => console.log(result.default)); -import('./named.js').then(result => console.log(result.value)); - -export { foo as default }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/es/named.js b/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/es/named.js deleted file mode 100644 index f63259007..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/es/named.js +++ /dev/null @@ -1,3 +0,0 @@ -const value = 'named'; - -export { value }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/system/default.js b/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/system/default.js deleted file mode 100644 index 5879dd0d6..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/system/default.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - var foo = exports('default', 'default'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/system/main.js b/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/system/main.js deleted file mode 100644 index 16b732c16..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/system/main.js +++ /dev/null @@ -1,20 +0,0 @@ -System.register(['./default.js', './named.js'], (function (exports, module) { - 'use strict'; - var foo, value; - return { - setters: [function (module) { - foo = module.default; - exports('default', module.default); - }, function (module) { - value = module.value; - }], - execute: (function () { - - console.log(foo, value); - - module.import('./default.js').then(result => console.log(result.default)); - module.import('./named.js').then(result => console.log(result.value)); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/system/named.js b/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/system/named.js deleted file mode 100644 index 15ac00621..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/system/named.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - const value = exports('value', 'named'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/default.js b/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/default.js deleted file mode 100644 index 413f601a3..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/default.js +++ /dev/null @@ -1 +0,0 @@ -export default 'default'; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/main.js b/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/main.js deleted file mode 100644 index 72dc390d8..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/main.js +++ /dev/null @@ -1,8 +0,0 @@ -import foo from './default.js'; -import { value } from './named.js'; -console.log(foo, value); - -export { default } from './default.js'; - -import('./default').then(result => console.log(result.default)); -import('./named').then(result => console.log(result.value)); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/named.js b/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/named.js deleted file mode 100644 index a5c403fef..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/named.js +++ /dev/null @@ -1 +0,0 @@ -export const value = 'named'; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_config.js deleted file mode 100644 index 5a551c30a..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_config.js +++ /dev/null @@ -1,13 +0,0 @@ -const commonjs = require('@rollup/plugin-commonjs'); - -module.exports = defineTest({ - description: 'Handles output from @rollup/plugin-commonjs', - expectedWarnings: ['MIXED_EXPORTS', 'DEPRECATED_FEATURE'], - options: { - strictDeprecations: false, - input: 'main.js', - preserveModules: true, - external: ['external'], - plugins: [commonjs()] - } -}); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/_virtual/_commonjsHelpers.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/_virtual/_commonjsHelpers.js deleted file mode 100644 index f35ac4ef0..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/_virtual/_commonjsHelpers.js +++ /dev/null @@ -1,9 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - function getDefaultExportFromCjs (x) { - return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; - } - - exports.getDefaultExportFromCjs = getDefaultExportFromCjs; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/_virtual/other.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/_virtual/other.js deleted file mode 100644 index ab90c1d68..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/_virtual/other.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - var other = {}; - - exports.__exports = other; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/commonjs.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/commonjs.js deleted file mode 100644 index bd5d678d6..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/commonjs.js +++ /dev/null @@ -1,14 +0,0 @@ -define(['./_virtual/_commonjsHelpers', 'external', './other', './_virtual/other'], (function (_commonjsHelpers, require$$0, other$1, other) { 'use strict'; - - const external = require$$0; - const { value } = other.__exports; - - console.log(external, value); - - var commonjs = 42; - - var value$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(commonjs); - - return value$1; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/main.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/main.js deleted file mode 100644 index baedd1b30..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/main.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./commonjs', 'external'], (function (commonjs, require$$0) { 'use strict'; - - console.log(commonjs, require$$0); - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/other.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/other.js deleted file mode 100644 index 8697215bc..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/other.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./_virtual/other'], (function (other) { 'use strict'; - - other.__exports.value = 43; - - return other.__exports; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/_virtual/_commonjsHelpers.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/_virtual/_commonjsHelpers.js deleted file mode 100644 index ceeaa4d07..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/_virtual/_commonjsHelpers.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -function getDefaultExportFromCjs (x) { - return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; -} - -exports.getDefaultExportFromCjs = getDefaultExportFromCjs; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/_virtual/other.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/_virtual/other.js deleted file mode 100644 index 6569c1d2a..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/_virtual/other.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var other = {}; - -exports.__exports = other; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/commonjs.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/commonjs.js deleted file mode 100644 index f2004b532..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/commonjs.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -var _commonjsHelpers = require('./_virtual/_commonjsHelpers.js'); -var require$$0 = require('external'); -require('./other.js'); -var other = require('./_virtual/other.js'); - -const external = require$$0; -const { value } = other.__exports; - -console.log(external, value); - -var commonjs = 42; - -var value$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(commonjs); - -module.exports = value$1; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/main.js deleted file mode 100644 index a38e11646..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/main.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -var commonjs = require('./commonjs.js'); -var require$$0 = require('external'); - -console.log(commonjs, require$$0); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/other.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/other.js deleted file mode 100644 index b2e2e3e12..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/other.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -var other = require('./_virtual/other.js'); - -other.__exports.value = 43; - -module.exports = other.__exports; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/_virtual/_commonjsHelpers.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/_virtual/_commonjsHelpers.js deleted file mode 100644 index 7b7c5f4f5..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/_virtual/_commonjsHelpers.js +++ /dev/null @@ -1,5 +0,0 @@ -function getDefaultExportFromCjs (x) { - return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; -} - -export { getDefaultExportFromCjs }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/_virtual/other.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/_virtual/other.js deleted file mode 100644 index 4825c11dd..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/_virtual/other.js +++ /dev/null @@ -1,3 +0,0 @@ -var other = {}; - -export { other as __exports }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/commonjs.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/commonjs.js deleted file mode 100644 index 2beaaa309..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/commonjs.js +++ /dev/null @@ -1,15 +0,0 @@ -import { getDefaultExportFromCjs } from './_virtual/_commonjsHelpers.js'; -import require$$0 from 'external'; -import './other.js'; -import { __exports as other } from './_virtual/other.js'; - -const external = require$$0; -const { value } = other; - -console.log(external, value); - -var commonjs = 42; - -var value$1 = /*@__PURE__*/getDefaultExportFromCjs(commonjs); - -export { value$1 as default }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/main.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/main.js deleted file mode 100644 index f1c736b1a..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/main.js +++ /dev/null @@ -1,4 +0,0 @@ -import value from './commonjs.js'; -import require$$0 from 'external'; - -console.log(value, require$$0); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/other.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/other.js deleted file mode 100644 index 005a4febb..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/other.js +++ /dev/null @@ -1,5 +0,0 @@ -import { __exports as other } from './_virtual/other.js'; - -other.value = 43; - -export { other as default }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/_virtual/_commonjsHelpers.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/_virtual/_commonjsHelpers.js deleted file mode 100644 index 46eeb613e..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/_virtual/_commonjsHelpers.js +++ /dev/null @@ -1,14 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - exports('getDefaultExportFromCjs', getDefaultExportFromCjs); - - function getDefaultExportFromCjs (x) { - return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; - } - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/_virtual/other.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/_virtual/other.js deleted file mode 100644 index c3374bd03..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/_virtual/other.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - var other = exports('__exports', {}); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/commonjs.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/commonjs.js deleted file mode 100644 index 8f67e9fb2..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/commonjs.js +++ /dev/null @@ -1,25 +0,0 @@ -System.register(['./_virtual/_commonjsHelpers.js', 'external', './other.js', './_virtual/other.js'], (function (exports) { - 'use strict'; - var getDefaultExportFromCjs, require$$0, other; - return { - setters: [function (module) { - getDefaultExportFromCjs = module.getDefaultExportFromCjs; - }, function (module) { - require$$0 = module.default; - }, null, function (module) { - other = module.__exports; - }], - execute: (function () { - - const external = require$$0; - const { value } = other; - - console.log(external, value); - - var commonjs = 42; - - var value$1 = exports('default', /*@__PURE__*/getDefaultExportFromCjs(commonjs)); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/main.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/main.js deleted file mode 100644 index 3a8974e9b..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/main.js +++ /dev/null @@ -1,16 +0,0 @@ -System.register(['./commonjs.js', 'external'], (function () { - 'use strict'; - var value, require$$0; - return { - setters: [function (module) { - value = module.default; - }, function (module) { - require$$0 = module.default; - }], - execute: (function () { - - console.log(value, require$$0); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/other.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/other.js deleted file mode 100644 index 1f428fbcf..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/other.js +++ /dev/null @@ -1,15 +0,0 @@ -System.register(['./_virtual/other.js'], (function (exports) { - 'use strict'; - var other; - return { - setters: [function (module) { - other = module.__exports; - exports('default', module.__exports); - }], - execute: (function () { - - other.value = 43; - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/commonjs.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/commonjs.js deleted file mode 100644 index b9bf49c3f..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/commonjs.js +++ /dev/null @@ -1,6 +0,0 @@ -const external = require('external'); -const { value } = require('./other'); - -console.log(external, value); - -module.exports = 42; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/main.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/main.js deleted file mode 100644 index cfef423da..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/main.js +++ /dev/null @@ -1,4 +0,0 @@ -import value from './commonjs'; -import external from 'external'; - -console.log(value, external); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/other.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/other.js deleted file mode 100644 index cd9dcc83b..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/other.js +++ /dev/null @@ -1 +0,0 @@ -exports.value = 43; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_config.js deleted file mode 100644 index 565a7037a..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_config.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = defineTest({ - description: 'dynamic imports are handled correctly when preserving modules', - options: { - strictDeprecations: false, - input: ['main.js'], - preserveModules: true - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/amd/dynamic-included.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/amd/dynamic-included.js deleted file mode 100644 index 19414d6fd..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/amd/dynamic-included.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - const value = 'included'; - - exports.value = value; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/amd/main.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/amd/main.js deleted file mode 100644 index d46b5b5ed..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/amd/main.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['require'], (function (require) { 'use strict'; - - new Promise(function (resolve, reject) { require(['./dynamic-included'], resolve, reject); }).then(result => console.log(result)); - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/cjs/dynamic-included.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/cjs/dynamic-included.js deleted file mode 100644 index 7ce0b0473..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/cjs/dynamic-included.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -const value = 'included'; - -exports.value = value; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/cjs/main.js deleted file mode 100644 index ed78ead19..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/cjs/main.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -Promise.resolve().then(function () { return require('./dynamic-included.js'); }).then(result => console.log(result)); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/es/dynamic-included.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/es/dynamic-included.js deleted file mode 100644 index 6370bf943..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/es/dynamic-included.js +++ /dev/null @@ -1,3 +0,0 @@ -const value = 'included'; - -export { value }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/es/main.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/es/main.js deleted file mode 100644 index 72ed76ddf..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/es/main.js +++ /dev/null @@ -1 +0,0 @@ -import('./dynamic-included.js').then(result => console.log(result)); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/system/dynamic-included.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/system/dynamic-included.js deleted file mode 100644 index 1c146c4b0..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/system/dynamic-included.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - const value = exports('value', 'included'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/system/main.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/system/main.js deleted file mode 100644 index 46d09c0e3..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/system/main.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports, module) { - 'use strict'; - return { - execute: (function () { - - module.import('./dynamic-included.js').then(result => console.log(result)); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/dynamic-included.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/dynamic-included.js deleted file mode 100644 index 287c398f8..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/dynamic-included.js +++ /dev/null @@ -1 +0,0 @@ -export const value = 'included'; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/dynamic-removed.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/dynamic-removed.js deleted file mode 100644 index a0203faa4..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/dynamic-removed.js +++ /dev/null @@ -1 +0,0 @@ -export const value = 'removed'; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/main.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/main.js deleted file mode 100644 index 9449616c8..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/main.js +++ /dev/null @@ -1,6 +0,0 @@ -import('./dynamic-included').then(result => console.log(result)); - -const include = false; -if (include) { - import('./dynamic-removed').then(result => console.log(result)); -} diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_config.js deleted file mode 100644 index 36f30eeec..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_config.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = defineTest({ - description: 'Preserve modules properly handles internal namespace imports (#2576)', - options: { - strictDeprecations: false, - input: ['main.js'], - preserveModules: true - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/amd/m1.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/amd/m1.js deleted file mode 100644 index f5475ebcc..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/amd/m1.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['exports', './m2', './m3'], (function (exports, m2, m3) { 'use strict'; - - - - exports.m2 = m2; - exports.m3 = m3; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/amd/m2.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/amd/m2.js deleted file mode 100644 index 098da5f2a..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/amd/m2.js +++ /dev/null @@ -1,7 +0,0 @@ -define((function () { 'use strict'; - - var m2 = {a:1}; - - return m2; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/amd/m3.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/amd/m3.js deleted file mode 100644 index 54273ec86..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/amd/m3.js +++ /dev/null @@ -1,7 +0,0 @@ -define((function () { 'use strict'; - - var m3 = {b:2}; - - return m3; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/amd/main.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/amd/main.js deleted file mode 100644 index 46411907b..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/amd/main.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./m1'], (function (m1) { 'use strict'; - - console.log(m1); - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/cjs/m1.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/cjs/m1.js deleted file mode 100644 index bd9f1e273..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/cjs/m1.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -var m2 = require('./m2.js'); -var m3 = require('./m3.js'); - - - -exports.m2 = m2; -exports.m3 = m3; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/cjs/m2.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/cjs/m2.js deleted file mode 100644 index 4e7045d3f..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/cjs/m2.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var m2 = {a:1}; - -module.exports = m2; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/cjs/m3.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/cjs/m3.js deleted file mode 100644 index 8e9846236..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/cjs/m3.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var m3 = {b:2}; - -module.exports = m3; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/cjs/main.js deleted file mode 100644 index 79afdf397..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/cjs/main.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var m1 = require('./m1.js'); - -console.log(m1); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/es/m1.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/es/m1.js deleted file mode 100644 index 86968950d..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/es/m1.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default as m2 } from './m2.js'; -export { default as m3 } from './m3.js'; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/es/m2.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/es/m2.js deleted file mode 100644 index 2e316b8ff..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/es/m2.js +++ /dev/null @@ -1,3 +0,0 @@ -var m2 = {a:1}; - -export { m2 as default }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/es/m3.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/es/m3.js deleted file mode 100644 index 4e4d52f98..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/es/m3.js +++ /dev/null @@ -1,3 +0,0 @@ -var m3 = {b:2}; - -export { m3 as default }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/es/main.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/es/main.js deleted file mode 100644 index 0240c9102..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/es/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import * as m1 from './m1.js'; - -console.log(m1); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/system/m1.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/system/m1.js deleted file mode 100644 index 05fd277e1..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/system/m1.js +++ /dev/null @@ -1,15 +0,0 @@ -System.register(['./m2.js', './m3.js'], (function (exports) { - 'use strict'; - return { - setters: [function (module) { - exports('m2', module.default); - }, function (module) { - exports('m3', module.default); - }], - execute: (function () { - - - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/system/m2.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/system/m2.js deleted file mode 100644 index 70eab9fde..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/system/m2.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - var m2 = exports('default', {a:1}); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/system/m3.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/system/m3.js deleted file mode 100644 index d64ef84b7..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/system/m3.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - var m3 = exports('default', {b:2}); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/system/main.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/system/main.js deleted file mode 100644 index 2055d1533..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/system/main.js +++ /dev/null @@ -1,14 +0,0 @@ -System.register(['./m1.js'], (function () { - 'use strict'; - var m1; - return { - setters: [function (module) { - m1 = module; - }], - execute: (function () { - - console.log(m1); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/m1.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/m1.js deleted file mode 100644 index 611f3360f..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/m1.js +++ /dev/null @@ -1,5 +0,0 @@ -import m2 from './m2.js'; -import m3 from './m3.js'; - -// console.log('m1'); -export { m2, m3 }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/m2.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/m2.js deleted file mode 100644 index 040aecae2..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/m2.js +++ /dev/null @@ -1,2 +0,0 @@ -var m2 = {a:1}; -export default m2; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/m3.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/m3.js deleted file mode 100644 index e58c26e98..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/m3.js +++ /dev/null @@ -1,2 +0,0 @@ -var m3 = {b:2}; -export default m3; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/main.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/main.js deleted file mode 100644 index c7526ddd8..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import * as ms from './m1.js'; - -console.log(ms); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-empty/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-empty/_config.js deleted file mode 100644 index 9c0b23efc..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-empty/_config.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = defineTest({ - description: 'Preserve modules remove empty dependencies', - options: { - strictDeprecations: false, - input: 'main.js', - preserveModules: true - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/amd/main.js b/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/amd/main.js deleted file mode 100644 index a52a88cf6..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/amd/main.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./two'], (function (two) { 'use strict'; - - window.APP = { a: two }; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/amd/two.js b/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/amd/two.js deleted file mode 100644 index 813004c18..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/amd/two.js +++ /dev/null @@ -1,7 +0,0 @@ -define((function () { 'use strict'; - - var a = {}; - - return a; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/cjs/main.js deleted file mode 100644 index b882d86f3..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/cjs/main.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var two = require('./two.js'); - -window.APP = { a: two }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/cjs/two.js b/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/cjs/two.js deleted file mode 100644 index 62ff33f50..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/cjs/two.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var a = {}; - -module.exports = a; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/es/main.js b/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/es/main.js deleted file mode 100644 index c69a33559..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/es/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import a from './two.js'; - -window.APP = { a }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/es/two.js b/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/es/two.js deleted file mode 100644 index 2c1648548..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/es/two.js +++ /dev/null @@ -1,3 +0,0 @@ -var a = {}; - -export { a as default }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/system/main.js b/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/system/main.js deleted file mode 100644 index 1d72392b6..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/system/main.js +++ /dev/null @@ -1,14 +0,0 @@ -System.register(['./two.js'], (function () { - 'use strict'; - var a; - return { - setters: [function (module) { - a = module.default; - }], - execute: (function () { - - window.APP = { a }; - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/system/two.js b/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/system/two.js deleted file mode 100644 index 1b4ea34f1..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/system/two.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - var a = exports('default', {}); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-empty/main.js b/test/chunking-form/samples/deprecated/preserve-modules-empty/main.js deleted file mode 100644 index 944087cb5..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-empty/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import { a } from './one'; - -window.APP = { a }; \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/preserve-modules-empty/one.js b/test/chunking-form/samples/deprecated/preserve-modules-empty/one.js deleted file mode 100644 index 2fa4a4dfd..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-empty/one.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default as a } from './two'; -export { default as b } from './three'; \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/preserve-modules-empty/three.js b/test/chunking-form/samples/deprecated/preserve-modules-empty/three.js deleted file mode 100644 index 7c645e42f..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-empty/three.js +++ /dev/null @@ -1 +0,0 @@ -export default {}; \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/preserve-modules-empty/two.js b/test/chunking-form/samples/deprecated/preserve-modules-empty/two.js deleted file mode 100644 index 7c645e42f..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-empty/two.js +++ /dev/null @@ -1 +0,0 @@ -export default {}; \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_config.js deleted file mode 100644 index d544144ad..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_config.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = defineTest({ - description: 'confirm export aliases are preserved in modules', - options: { - strictDeprecations: false, - input: ['main1.js', 'main2.js'], - preserveModules: true - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/amd/dep.js b/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/amd/dep.js deleted file mode 100644 index 42ccc5f12..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/amd/dep.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - const foo = 1; - - exports.bar = foo; - exports.foo = foo; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/amd/main1.js b/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/amd/main1.js deleted file mode 100644 index a9086d328..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/amd/main1.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['exports', './dep'], (function (exports, dep) { 'use strict'; - - - - exports.bar = dep.foo; - exports.foo = dep.foo; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/amd/main2.js b/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/amd/main2.js deleted file mode 100644 index 43cad3604..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/amd/main2.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['exports', './dep'], (function (exports, dep) { 'use strict'; - - - - exports.bar = dep.foo; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/cjs/dep.js b/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/cjs/dep.js deleted file mode 100644 index ce2fd9a65..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/cjs/dep.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -const foo = 1; - -exports.bar = foo; -exports.foo = foo; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/cjs/main1.js b/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/cjs/main1.js deleted file mode 100644 index f9483644b..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/cjs/main1.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var dep = require('./dep.js'); - - - -exports.bar = dep.foo; -exports.foo = dep.foo; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/cjs/main2.js b/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/cjs/main2.js deleted file mode 100644 index 68babfaab..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/cjs/main2.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -var dep = require('./dep.js'); - - - -exports.bar = dep.foo; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/es/dep.js b/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/es/dep.js deleted file mode 100644 index fd00364ba..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/es/dep.js +++ /dev/null @@ -1,3 +0,0 @@ -const foo = 1; - -export { foo as bar, foo }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/es/main1.js b/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/es/main1.js deleted file mode 100644 index ed1ba0cbf..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/es/main1.js +++ /dev/null @@ -1 +0,0 @@ -export { foo as bar, foo } from './dep.js'; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/es/main2.js b/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/es/main2.js deleted file mode 100644 index e7cedc5ee..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/es/main2.js +++ /dev/null @@ -1 +0,0 @@ -export { foo as bar } from './dep.js'; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/system/dep.js b/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/system/dep.js deleted file mode 100644 index 5b18e441e..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/system/dep.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - const foo = 1; exports({ foo: foo, bar: foo }); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/system/main1.js b/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/system/main1.js deleted file mode 100644 index ab503c81c..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/system/main1.js +++ /dev/null @@ -1,13 +0,0 @@ -System.register(['./dep.js'], (function (exports) { - 'use strict'; - return { - setters: [function (module) { - exports({ bar: module.foo, foo: module.foo }); - }], - execute: (function () { - - - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/system/main2.js b/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/system/main2.js deleted file mode 100644 index 47fbb8724..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/system/main2.js +++ /dev/null @@ -1,13 +0,0 @@ -System.register(['./dep.js'], (function (exports) { - 'use strict'; - return { - setters: [function (module) { - exports('bar', module.foo); - }], - execute: (function () { - - - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/dep.js b/test/chunking-form/samples/deprecated/preserve-modules-export-alias/dep.js deleted file mode 100644 index 6e70164af..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/dep.js +++ /dev/null @@ -1,3 +0,0 @@ -const foo = 1; - -export { foo, foo as bar }; \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/main1.js b/test/chunking-form/samples/deprecated/preserve-modules-export-alias/main1.js deleted file mode 100644 index d6dbbf4db..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/main1.js +++ /dev/null @@ -1 +0,0 @@ -export { foo, bar } from './dep'; \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/main2.js b/test/chunking-form/samples/deprecated/preserve-modules-export-alias/main2.js deleted file mode 100644 index a9aa169df..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/main2.js +++ /dev/null @@ -1 +0,0 @@ -export { bar } from './dep'; \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_config.js deleted file mode 100644 index aa99c0a74..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_config.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = defineTest({ - description: 'entryFileNames pattern supported in combination with preserveModules', - options: { - strictDeprecations: false, - input: 'src/main.ts', - output: { - entryFileNames: '[name]-[format]-[hash].js' - }, - preserveModules: true - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/foo-amd-0f9dc16c.js b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/foo-amd-0f9dc16c.js deleted file mode 100644 index 69228f8fb..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/foo-amd-0f9dc16c.js +++ /dev/null @@ -1,7 +0,0 @@ -define((function () { 'use strict'; - - var foo = 42; - - return foo; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/main-amd-f0570656.js b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/main-amd-f0570656.js deleted file mode 100644 index 92eec8fa3..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/main-amd-f0570656.js +++ /dev/null @@ -1,10 +0,0 @@ -define(['exports', './foo-amd-0f9dc16c', './nested/bar-amd-f038b10c', './nested/baz-amd-d3de4cc0', './no-ext-amd-9d2c6ef6'], (function (exports, foo, bar, baz, noExt) { 'use strict'; - - - - exports.foo = foo; - exports.bar = bar; - exports.baz = baz; - exports.noExt = noExt; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/nested/bar-amd-f038b10c.js b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/nested/bar-amd-f038b10c.js deleted file mode 100644 index 55e47d04b..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/nested/bar-amd-f038b10c.js +++ /dev/null @@ -1,7 +0,0 @@ -define((function () { 'use strict'; - - var bar = 'banana'; - - return bar; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/nested/baz-amd-d3de4cc0.js b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/nested/baz-amd-d3de4cc0.js deleted file mode 100644 index 518b69f55..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/nested/baz-amd-d3de4cc0.js +++ /dev/null @@ -1,7 +0,0 @@ -define((function () { 'use strict'; - - var baz = 'whatever'; - - return baz; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/no-ext-amd-9d2c6ef6.js b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/no-ext-amd-9d2c6ef6.js deleted file mode 100644 index 4d9b6f896..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/no-ext-amd-9d2c6ef6.js +++ /dev/null @@ -1,7 +0,0 @@ -define((function () { 'use strict'; - - var noExt = 'no-ext'; - - return noExt; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/foo-cjs-0d5774b5.js b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/foo-cjs-0d5774b5.js deleted file mode 100644 index 476c8ac92..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/foo-cjs-0d5774b5.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var foo = 42; - -module.exports = foo; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/main-cjs-e39bf23f.js b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/main-cjs-e39bf23f.js deleted file mode 100644 index 5feb8352e..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/main-cjs-e39bf23f.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -var foo = require('./foo-cjs-0d5774b5.js'); -var bar = require('./nested/bar-cjs-abedc91d.js'); -var baz = require('./nested/baz-cjs-4a9c02fc.js'); -var noExt = require('./no-ext-cjs-500f8f81.js'); - - - -exports.foo = foo; -exports.bar = bar; -exports.baz = baz; -exports.noExt = noExt; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/nested/bar-cjs-abedc91d.js b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/nested/bar-cjs-abedc91d.js deleted file mode 100644 index f8f56e6fc..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/nested/bar-cjs-abedc91d.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var bar = 'banana'; - -module.exports = bar; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/nested/baz-cjs-4a9c02fc.js b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/nested/baz-cjs-4a9c02fc.js deleted file mode 100644 index 0ba506ad3..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/nested/baz-cjs-4a9c02fc.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var baz = 'whatever'; - -module.exports = baz; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/no-ext-cjs-500f8f81.js b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/no-ext-cjs-500f8f81.js deleted file mode 100644 index 5e9e9eb2c..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/no-ext-cjs-500f8f81.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var noExt = 'no-ext'; - -module.exports = noExt; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/foo-es-3585f3eb.js b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/foo-es-3585f3eb.js deleted file mode 100644 index 2685886fe..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/foo-es-3585f3eb.js +++ /dev/null @@ -1,3 +0,0 @@ -var foo = 42; - -export { foo as default }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/main-es-d43a43b5.js b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/main-es-d43a43b5.js deleted file mode 100644 index dcc851a2a..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/main-es-d43a43b5.js +++ /dev/null @@ -1,4 +0,0 @@ -export { default as foo } from './foo-es-3585f3eb.js'; -export { default as bar } from './nested/bar-es-bd5e2ae1.js'; -export { default as baz } from './nested/baz-es-a913ab4d.js'; -export { default as noExt } from './no-ext-es-1f34b6e8.js'; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/nested/bar-es-bd5e2ae1.js b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/nested/bar-es-bd5e2ae1.js deleted file mode 100644 index f383a3735..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/nested/bar-es-bd5e2ae1.js +++ /dev/null @@ -1,3 +0,0 @@ -var bar = 'banana'; - -export { bar as default }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/nested/baz-es-a913ab4d.js b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/nested/baz-es-a913ab4d.js deleted file mode 100644 index 11a48a575..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/nested/baz-es-a913ab4d.js +++ /dev/null @@ -1,3 +0,0 @@ -var baz = 'whatever'; - -export { baz as default }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/no-ext-es-1f34b6e8.js b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/no-ext-es-1f34b6e8.js deleted file mode 100644 index ae037040b..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/no-ext-es-1f34b6e8.js +++ /dev/null @@ -1,3 +0,0 @@ -var noExt = 'no-ext'; - -export { noExt as default }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/system/foo-system-0e2d8e48.js b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/system/foo-system-0e2d8e48.js deleted file mode 100644 index 98793de89..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/system/foo-system-0e2d8e48.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - var foo = exports('default', 42); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/system/main-system-5684b811.js b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/system/main-system-5684b811.js deleted file mode 100644 index c41dd42ae..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/system/main-system-5684b811.js +++ /dev/null @@ -1,19 +0,0 @@ -System.register(['./foo-system-0e2d8e48.js', './nested/bar-system-a72f6c95.js', './nested/baz-system-71d114fd.js', './no-ext-system-0cf938a8.js'], (function (exports) { - 'use strict'; - return { - setters: [function (module) { - exports('foo', module.default); - }, function (module) { - exports('bar', module.default); - }, function (module) { - exports('baz', module.default); - }, function (module) { - exports('noExt', module.default); - }], - execute: (function () { - - - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/system/nested/bar-system-a72f6c95.js b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/system/nested/bar-system-a72f6c95.js deleted file mode 100644 index 21575fdff..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/system/nested/bar-system-a72f6c95.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - var bar = exports('default', 'banana'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/system/nested/baz-system-71d114fd.js b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/system/nested/baz-system-71d114fd.js deleted file mode 100644 index 54bd1e94e..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/system/nested/baz-system-71d114fd.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - var baz = exports('default', 'whatever'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/system/no-ext-system-0cf938a8.js b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/system/no-ext-system-0cf938a8.js deleted file mode 100644 index 95f0f758b..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/system/no-ext-system-0cf938a8.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - var noExt = exports('default', 'no-ext'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/foo.ts b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/foo.ts deleted file mode 100644 index 7a4e8a723..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/foo.ts +++ /dev/null @@ -1 +0,0 @@ -export default 42; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/main.ts b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/main.ts deleted file mode 100644 index 3f169c8f4..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/main.ts +++ /dev/null @@ -1,8 +0,0 @@ -// @ts-ignore -export { default as foo } from './foo.ts'; -// @ts-ignore -export { default as bar } from './nested/bar.ts'; -// @ts-ignore -export { default as baz } from './nested/baz.ts'; -// @ts-ignore -export { default as noExt } from './no-ext'; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/nested/bar.ts b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/nested/bar.ts deleted file mode 100644 index 7d79d5a99..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/nested/bar.ts +++ /dev/null @@ -1 +0,0 @@ -export default 'banana'; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/nested/baz.ts b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/nested/baz.ts deleted file mode 100644 index 6d70feca8..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/nested/baz.ts +++ /dev/null @@ -1 +0,0 @@ -export default 'whatever'; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/no-ext b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/no-ext deleted file mode 100644 index a59381f72..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/no-ext +++ /dev/null @@ -1 +0,0 @@ -export default 'no-ext' diff --git a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_config.js deleted file mode 100644 index 2d68e2aac..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_config.js +++ /dev/null @@ -1,23 +0,0 @@ -module.exports = defineTest({ - description: 'Preserve modules id case sensitive', - options: { - strictDeprecations: false, - input: 'main.js', - preserveModules: true, - plugins: [ - { - resolveId(id) { - if (id.toLowerCase().includes('one')) { - return id; - } - }, - load(id) { - if (id.toLowerCase().includes('one')) { - return `export default '${id.replace('\0', '')}'`; - } - } - } - ] - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/amd/_virtual/_One1.js b/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/amd/_virtual/_One1.js deleted file mode 100644 index c6281aeed..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/amd/_virtual/_One1.js +++ /dev/null @@ -1,7 +0,0 @@ -define((function () { 'use strict'; - - var c = 'One1.js'; - - return c; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/amd/_virtual/_One2.js b/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/amd/_virtual/_One2.js deleted file mode 100644 index e34aacf55..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/amd/_virtual/_One2.js +++ /dev/null @@ -1,7 +0,0 @@ -define((function () { 'use strict'; - - var b = 'One.js'; - - return b; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/amd/_virtual/_one.js b/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/amd/_virtual/_one.js deleted file mode 100644 index 80666603e..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/amd/_virtual/_one.js +++ /dev/null @@ -1,7 +0,0 @@ -define((function () { 'use strict'; - - var a = 'one.js'; - - return a; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/amd/main.js b/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/amd/main.js deleted file mode 100644 index 581279681..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/amd/main.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./_virtual/_one', './_virtual/_One2', './_virtual/_One1'], (function (_one, _One, _One1) { 'use strict'; - - window.APP = { a: _one, b: _One, c: _One1 }; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/cjs/_virtual/_One1.js b/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/cjs/_virtual/_One1.js deleted file mode 100644 index 2e2081c7b..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/cjs/_virtual/_One1.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var c = 'One1.js'; - -module.exports = c; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/cjs/_virtual/_One2.js b/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/cjs/_virtual/_One2.js deleted file mode 100644 index 94e5e6eeb..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/cjs/_virtual/_One2.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var b = 'One.js'; - -module.exports = b; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/cjs/_virtual/_one.js b/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/cjs/_virtual/_one.js deleted file mode 100644 index 04b4a696e..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/cjs/_virtual/_one.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var a = 'one.js'; - -module.exports = a; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/cjs/main.js deleted file mode 100644 index d11335251..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/cjs/main.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -var _one = require('./_virtual/_one.js'); -var _One = require('./_virtual/_One2.js'); -var _One1 = require('./_virtual/_One1.js'); - -window.APP = { a: _one, b: _One, c: _One1 }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es/_virtual/_One1.js b/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es/_virtual/_One1.js deleted file mode 100644 index 0a993ba1f..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es/_virtual/_One1.js +++ /dev/null @@ -1,3 +0,0 @@ -var c = 'One1.js'; - -export { c as default }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es/_virtual/_One2.js b/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es/_virtual/_One2.js deleted file mode 100644 index 127ca31fe..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es/_virtual/_One2.js +++ /dev/null @@ -1,3 +0,0 @@ -var b = 'One.js'; - -export { b as default }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es/_virtual/_one.js b/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es/_virtual/_one.js deleted file mode 100644 index d53f39de1..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es/_virtual/_one.js +++ /dev/null @@ -1,3 +0,0 @@ -var a = 'one.js'; - -export { a as default }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es/main.js b/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es/main.js deleted file mode 100644 index e7a751f41..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es/main.js +++ /dev/null @@ -1,5 +0,0 @@ -import a from './_virtual/_one.js'; -import b from './_virtual/_One2.js'; -import c from './_virtual/_One1.js'; - -window.APP = { a, b, c }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/system/_virtual/_One1.js b/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/system/_virtual/_One1.js deleted file mode 100644 index 1f2e04b79..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/system/_virtual/_One1.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - var c = exports('default', 'One1.js'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/system/_virtual/_One2.js b/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/system/_virtual/_One2.js deleted file mode 100644 index 1a8a96728..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/system/_virtual/_One2.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - var b = exports('default', 'One.js'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/system/_virtual/_one.js b/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/system/_virtual/_one.js deleted file mode 100644 index 5606dfa6b..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/system/_virtual/_one.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - var a = exports('default', 'one.js'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/system/main.js b/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/system/main.js deleted file mode 100644 index df50fc520..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/system/main.js +++ /dev/null @@ -1,18 +0,0 @@ -System.register(['./_virtual/_one.js', './_virtual/_One2.js', './_virtual/_One1.js'], (function () { - 'use strict'; - var a, b, c; - return { - setters: [function (module) { - a = module.default; - }, function (module) { - b = module.default; - }, function (module) { - c = module.default; - }], - execute: (function () { - - window.APP = { a, b, c }; - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/main.js b/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/main.js deleted file mode 100644 index 49a5f34ff..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/main.js +++ /dev/null @@ -1,5 +0,0 @@ -import a from '\0one.js'; -import b from '\0One.js'; -import c from '\0One1.js'; - -window.APP = { a, b, c }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_config.js deleted file mode 100644 index 6ad3a9ed2..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_config.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = defineTest({ - description: 'respects "named" export mode in all chunks when preserving modules', - options: { - strictDeprecations: false, - input: 'main.js', - preserveModules: true, - output: { - exports: 'named' - } - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/amd/default.js b/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/amd/default.js deleted file mode 100644 index 18d757daa..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/amd/default.js +++ /dev/null @@ -1,9 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - var foo = 'default'; - - exports.default = foo; - - Object.defineProperty(exports, '__esModule', { value: true }); - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/amd/main.js b/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/amd/main.js deleted file mode 100644 index 2b82f1bb6..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/amd/main.js +++ /dev/null @@ -1,12 +0,0 @@ -define(['require', 'exports', './default', './named'], (function (require, exports, _default, named) { 'use strict'; - - console.log(_default.default, named.value); - - new Promise(function (resolve, reject) { require(['./default'], resolve, reject); }).then(result => console.log(result.default)); - new Promise(function (resolve, reject) { require(['./named'], resolve, reject); }).then(result => console.log(result.value)); - - exports.default = _default.default; - - Object.defineProperty(exports, '__esModule', { value: true }); - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/amd/named.js b/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/amd/named.js deleted file mode 100644 index 2896dcf10..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/amd/named.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - const value = 'named'; - - exports.value = value; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/cjs/default.js b/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/cjs/default.js deleted file mode 100644 index bc9cb9bdc..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/cjs/default.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var foo = 'default'; - -exports.default = foo; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/cjs/main.js deleted file mode 100644 index 9ff3162ba..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/cjs/main.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var _default = require('./default.js'); -var named = require('./named.js'); - -console.log(_default.default, named.value); - -Promise.resolve().then(function () { return require('./default.js'); }).then(result => console.log(result.default)); -Promise.resolve().then(function () { return require('./named.js'); }).then(result => console.log(result.value)); - -exports.default = _default.default; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/cjs/named.js b/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/cjs/named.js deleted file mode 100644 index ec20bc0d7..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/cjs/named.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -const value = 'named'; - -exports.value = value; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/es/default.js b/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/es/default.js deleted file mode 100644 index 888d95cb3..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/es/default.js +++ /dev/null @@ -1,3 +0,0 @@ -var foo = 'default'; - -export { foo as default }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/es/main.js b/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/es/main.js deleted file mode 100644 index 4aad85561..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/es/main.js +++ /dev/null @@ -1,9 +0,0 @@ -import foo from './default.js'; -import { value } from './named.js'; - -console.log(foo, value); - -import('./default.js').then(result => console.log(result.default)); -import('./named.js').then(result => console.log(result.value)); - -export { foo as default }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/es/named.js b/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/es/named.js deleted file mode 100644 index f63259007..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/es/named.js +++ /dev/null @@ -1,3 +0,0 @@ -const value = 'named'; - -export { value }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/system/default.js b/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/system/default.js deleted file mode 100644 index 5879dd0d6..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/system/default.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - var foo = exports('default', 'default'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/system/main.js b/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/system/main.js deleted file mode 100644 index 16b732c16..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/system/main.js +++ /dev/null @@ -1,20 +0,0 @@ -System.register(['./default.js', './named.js'], (function (exports, module) { - 'use strict'; - var foo, value; - return { - setters: [function (module) { - foo = module.default; - exports('default', module.default); - }, function (module) { - value = module.value; - }], - execute: (function () { - - console.log(foo, value); - - module.import('./default.js').then(result => console.log(result.default)); - module.import('./named.js').then(result => console.log(result.value)); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/system/named.js b/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/system/named.js deleted file mode 100644 index 15ac00621..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/system/named.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - const value = exports('value', 'named'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/default.js b/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/default.js deleted file mode 100644 index 413f601a3..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/default.js +++ /dev/null @@ -1 +0,0 @@ -export default 'default'; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/main.js b/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/main.js deleted file mode 100644 index 72dc390d8..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/main.js +++ /dev/null @@ -1,8 +0,0 @@ -import foo from './default.js'; -import { value } from './named.js'; -console.log(foo, value); - -export { default } from './default.js'; - -import('./default').then(result => console.log(result.default)); -import('./named').then(result => console.log(result.value)); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/named.js b/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/named.js deleted file mode 100644 index a5c403fef..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/named.js +++ /dev/null @@ -1 +0,0 @@ -export const value = 'named'; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_config.js deleted file mode 100644 index 5ec0f7692..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_config.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = defineTest({ - description: 'confirm exports are deconflicted when exporting nested index aliases', - options: { - strictDeprecations: false, - input: 'main.js', - preserveModules: true - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/amd/main.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/amd/main.js deleted file mode 100644 index 0a1b6a12c..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/amd/main.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['exports', './module-a/v1/index', './module-b/v1/index'], (function (exports, index, index$1) { 'use strict'; - - - - exports.ModuleA_V1 = index; - exports.ModuleB_V1 = index$1; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/amd/module-a/v1/index.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/amd/module-a/v1/index.js deleted file mode 100644 index 6b677084b..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/amd/module-a/v1/index.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - const TEST_MODULE_A = 'A'; - - exports.TEST_MODULE_A = TEST_MODULE_A; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/amd/module-b/v1/index.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/amd/module-b/v1/index.js deleted file mode 100644 index 5d1b35b6a..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/amd/module-b/v1/index.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - const TEST_MODULE_B = 'A'; - - exports.TEST_MODULE_B = TEST_MODULE_B; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjs/main.js deleted file mode 100644 index 85ed071a2..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjs/main.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -var index = require('./module-a/v1/index.js'); -var index$1 = require('./module-b/v1/index.js'); - - - -exports.ModuleA_V1 = index; -exports.ModuleB_V1 = index$1; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjs/module-a/v1/index.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjs/module-a/v1/index.js deleted file mode 100644 index 6f57cdac8..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjs/module-a/v1/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -const TEST_MODULE_A = 'A'; - -exports.TEST_MODULE_A = TEST_MODULE_A; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjs/module-b/v1/index.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjs/module-b/v1/index.js deleted file mode 100644 index 99cce36ed..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjs/module-b/v1/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -const TEST_MODULE_B = 'A'; - -exports.TEST_MODULE_B = TEST_MODULE_B; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/es/main.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/es/main.js deleted file mode 100644 index 537dda397..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/es/main.js +++ /dev/null @@ -1,4 +0,0 @@ -import * as index from './module-a/v1/index.js'; -export { index as ModuleA_V1 }; -import * as index$1 from './module-b/v1/index.js'; -export { index$1 as ModuleB_V1 }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/es/module-a/v1/index.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/es/module-a/v1/index.js deleted file mode 100644 index a81583804..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/es/module-a/v1/index.js +++ /dev/null @@ -1,3 +0,0 @@ -const TEST_MODULE_A = 'A'; - -export { TEST_MODULE_A }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/es/module-b/v1/index.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/es/module-b/v1/index.js deleted file mode 100644 index 338a266e1..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/es/module-b/v1/index.js +++ /dev/null @@ -1,3 +0,0 @@ -const TEST_MODULE_B = 'A'; - -export { TEST_MODULE_B }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/system/main.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/system/main.js deleted file mode 100644 index ef257319d..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/system/main.js +++ /dev/null @@ -1,15 +0,0 @@ -System.register(['./module-a/v1/index.js', './module-b/v1/index.js'], (function (exports) { - 'use strict'; - return { - setters: [function (module) { - exports('ModuleA_V1', module); - }, function (module) { - exports('ModuleB_V1', module); - }], - execute: (function () { - - - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/system/module-a/v1/index.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/system/module-a/v1/index.js deleted file mode 100644 index 0f9df3153..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/system/module-a/v1/index.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - const TEST_MODULE_A = exports('TEST_MODULE_A', 'A'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/system/module-b/v1/index.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/system/module-b/v1/index.js deleted file mode 100644 index d5228c075..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/system/module-b/v1/index.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - const TEST_MODULE_B = exports('TEST_MODULE_B', 'A'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/main.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/main.js deleted file mode 100644 index 6322b9468..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/main.js +++ /dev/null @@ -1,2 +0,0 @@ -export * from './module-a/index' -export * from './module-b/index' \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-a/index.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-a/index.js deleted file mode 100644 index 6bd359daf..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-a/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import * as ModuleA_V1 from './v1/index' - -export { ModuleA_V1 } \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-a/v1/index.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-a/v1/index.js deleted file mode 100644 index 8bc392c75..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-a/v1/index.js +++ /dev/null @@ -1 +0,0 @@ -export const TEST_MODULE_A = 'A' \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-b/index.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-b/index.js deleted file mode 100644 index f9b363cdf..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-b/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import * as ModuleB_V1 from './v1/index' - -export { ModuleB_V1 } \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-b/v1/index.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-b/v1/index.js deleted file mode 100644 index 1d751964f..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-b/v1/index.js +++ /dev/null @@ -1 +0,0 @@ -export const TEST_MODULE_B = 'A' \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_config.js deleted file mode 100644 index 2997fa8cf..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_config.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = defineTest({ - description: 'confirm exports are preserved when exporting a module', - options: { - strictDeprecations: false, - input: 'main.js', - preserveModules: true - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/amd/inner/more_inner/something.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/amd/inner/more_inner/something.js deleted file mode 100644 index 9e690e2c1..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/amd/inner/more_inner/something.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - const Something = 'Hello World'; - - exports.Something = Something; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/amd/inner/some_effect.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/amd/inner/some_effect.js deleted file mode 100644 index 3edb2a595..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/amd/inner/some_effect.js +++ /dev/null @@ -1,5 +0,0 @@ -define((function () { 'use strict'; - - console.log('side-effect'); - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/amd/main.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/amd/main.js deleted file mode 100644 index 851960722..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/amd/main.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['exports', './inner/more_inner/something', './inner/some_effect'], (function (exports, something, some_effect) { 'use strict'; - - - - exports.Something = something.Something; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/cjs/inner/more_inner/something.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/cjs/inner/more_inner/something.js deleted file mode 100644 index 12aa3ba79..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/cjs/inner/more_inner/something.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -const Something = 'Hello World'; - -exports.Something = Something; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/cjs/inner/some_effect.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/cjs/inner/some_effect.js deleted file mode 100644 index 28e48ebec..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/cjs/inner/some_effect.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -console.log('side-effect'); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/cjs/main.js deleted file mode 100644 index affdcc85a..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/cjs/main.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var something = require('./inner/more_inner/something.js'); -require('./inner/some_effect.js'); - - - -exports.Something = something.Something; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/es/inner/more_inner/something.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/es/inner/more_inner/something.js deleted file mode 100644 index 636a41324..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/es/inner/more_inner/something.js +++ /dev/null @@ -1,3 +0,0 @@ -const Something = 'Hello World'; - -export { Something }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/es/inner/some_effect.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/es/inner/some_effect.js deleted file mode 100644 index 4ca9b41c4..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/es/inner/some_effect.js +++ /dev/null @@ -1 +0,0 @@ -console.log('side-effect'); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/es/main.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/es/main.js deleted file mode 100644 index efa908a5a..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/es/main.js +++ /dev/null @@ -1,2 +0,0 @@ -export { Something } from './inner/more_inner/something.js'; -import './inner/some_effect.js'; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/system/inner/more_inner/something.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/system/inner/more_inner/something.js deleted file mode 100644 index f087474c2..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/system/inner/more_inner/something.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - const Something = exports('Something', 'Hello World'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/system/inner/some_effect.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/system/inner/some_effect.js deleted file mode 100644 index f019bf7e7..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/system/inner/some_effect.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function () { - 'use strict'; - return { - execute: (function () { - - console.log('side-effect'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/system/main.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/system/main.js deleted file mode 100644 index 6f66e5852..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/system/main.js +++ /dev/null @@ -1,13 +0,0 @@ -System.register(['./inner/more_inner/something.js', './inner/some_effect.js'], (function (exports) { - 'use strict'; - return { - setters: [function (module) { - exports('Something', module.Something); - }, null], - execute: (function () { - - - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/index.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/index.js deleted file mode 100644 index b46f14091..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export * from './more_inner/index'; -import './some_effect'; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/more_inner/index.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/more_inner/index.js deleted file mode 100644 index 93e297c24..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/more_inner/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from './something'; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/more_inner/something.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/more_inner/something.js deleted file mode 100644 index 60e3455d0..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/more_inner/something.js +++ /dev/null @@ -1 +0,0 @@ -export const Something = 'Hello World'; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/some_effect.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/some_effect.js deleted file mode 100644 index 4ca9b41c4..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/some_effect.js +++ /dev/null @@ -1 +0,0 @@ -console.log('side-effect'); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/main.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-export/main.js deleted file mode 100644 index ee0c76083..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/main.js +++ /dev/null @@ -1 +0,0 @@ -export * from './inner/index'; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_config.js deleted file mode 100644 index d7e6ce270..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_config.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = defineTest({ - description: 'imports and exports of non-entry points are tracked', - options: { - strictDeprecations: false, - input: 'main.js', - preserveModules: true - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/amd/dep2.js b/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/amd/dep2.js deleted file mode 100644 index 4ee99d606..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/amd/dep2.js +++ /dev/null @@ -1,7 +0,0 @@ -define((function () { 'use strict'; - - function foo() {} - - return foo; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/amd/main.js b/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/amd/main.js deleted file mode 100644 index 2121744c9..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/amd/main.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./dep2'], (function (dep2) { 'use strict'; - - - - return dep2; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/cjs/dep2.js b/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/cjs/dep2.js deleted file mode 100644 index d356914dc..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/cjs/dep2.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -function foo() {} - -module.exports = foo; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/cjs/main.js deleted file mode 100644 index 663b040c9..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/cjs/main.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -var dep2 = require('./dep2.js'); - - - -module.exports = dep2; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/es/dep2.js b/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/es/dep2.js deleted file mode 100644 index 4987d698d..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/es/dep2.js +++ /dev/null @@ -1,3 +0,0 @@ -function foo() {} - -export { foo as default }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/es/main.js b/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/es/main.js deleted file mode 100644 index 46cbf60f1..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/es/main.js +++ /dev/null @@ -1,5 +0,0 @@ -import foo from './dep2.js'; - - - -export { foo as default }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/system/dep2.js b/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/system/dep2.js deleted file mode 100644 index 704c184b6..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/system/dep2.js +++ /dev/null @@ -1,12 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - exports('default', foo); - - function foo() {} - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/system/main.js b/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/system/main.js deleted file mode 100644 index 5efe40310..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/system/main.js +++ /dev/null @@ -1,15 +0,0 @@ -System.register(['./dep2.js'], (function (exports) { - 'use strict'; - var foo; - return { - setters: [function (module) { - foo = module.default; - exports('default', module.default); - }], - execute: (function () { - - - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/dep1.js b/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/dep1.js deleted file mode 100644 index 2c5a157d2..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/dep1.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './dep2'; \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/dep2.js b/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/dep2.js deleted file mode 100644 index a5e4ff338..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/dep2.js +++ /dev/null @@ -1 +0,0 @@ -export default function() {}; \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/main.js b/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/main.js deleted file mode 100644 index 24640f29f..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import foo from './dep1'; - -export default foo; \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_config.js deleted file mode 100644 index 951a6d939..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_config.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = defineTest({ - description: - 'correctly resolves imports via a proxy module as direct imports when preserving modules', - options: { - strictDeprecations: false, - preserveModules: true, - external: 'external' - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/amd/main.js b/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/amd/main.js deleted file mode 100644 index b58d356d5..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/amd/main.js +++ /dev/null @@ -1,6 +0,0 @@ -define(['external'], (function (path) { 'use strict'; - - console.log(path.normalize('foo\\bar')); - console.log(path.normalize('foo\\bar')); - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/amd/proxy.js b/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/amd/proxy.js deleted file mode 100644 index 40b6b7b8b..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/amd/proxy.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['external'], (function (path) { 'use strict'; - - - - return path; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/cjs/main.js deleted file mode 100644 index 7db07e727..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/cjs/main.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -var path = require('external'); - -console.log(path.normalize('foo\\bar')); -console.log(path.normalize('foo\\bar')); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/cjs/proxy.js b/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/cjs/proxy.js deleted file mode 100644 index de6089fad..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/cjs/proxy.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -var path = require('external'); - - - -module.exports = path; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/es/main.js b/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/es/main.js deleted file mode 100644 index 57a9f2785..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/es/main.js +++ /dev/null @@ -1,4 +0,0 @@ -import path from 'external'; - -console.log(path.normalize('foo\\bar')); -console.log(path.normalize('foo\\bar')); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/es/proxy.js b/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/es/proxy.js deleted file mode 100644 index 0b1c97e9b..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/es/proxy.js +++ /dev/null @@ -1,2 +0,0 @@ -import path from 'external'; -export { default } from 'external'; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/system/main.js b/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/system/main.js deleted file mode 100644 index 1955da8f2..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/system/main.js +++ /dev/null @@ -1,15 +0,0 @@ -System.register(['external'], (function () { - 'use strict'; - var path; - return { - setters: [function (module) { - path = module.default; - }], - execute: (function () { - - console.log(path.normalize('foo\\bar')); - console.log(path.normalize('foo\\bar')); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/system/proxy.js b/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/system/proxy.js deleted file mode 100644 index 1f83348dc..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/system/proxy.js +++ /dev/null @@ -1,15 +0,0 @@ -System.register(['external'], (function (exports) { - 'use strict'; - var path; - return { - setters: [function (module) { - path = module.default; - exports('default', module.default); - }], - execute: (function () { - - - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/main.js b/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/main.js deleted file mode 100644 index 288bd4a16..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/main.js +++ /dev/null @@ -1,5 +0,0 @@ -import path from 'external'; -import proxyPath from './proxy'; - -console.log(path.normalize('foo\\bar')); -console.log(proxyPath.normalize('foo\\bar')); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/proxy.js b/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/proxy.js deleted file mode 100644 index 4635dc5b4..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/proxy.js +++ /dev/null @@ -1,2 +0,0 @@ -import path from 'external'; -export default path; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_config.js deleted file mode 100644 index 804c626e7..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_config.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = defineTest({ - description: 'change the module destination', - options: { - strictDeprecations: false, - input: 'src/lib/main.js', - preserveModules: true - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/amd/dep.js b/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/amd/dep.js deleted file mode 100644 index e919531b9..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/amd/dep.js +++ /dev/null @@ -1,9 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - function fn () { - console.log('dep fn'); - } - - exports.fn = fn; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/amd/lib/main.js b/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/amd/lib/main.js deleted file mode 100644 index 7530d2bf1..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/amd/lib/main.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['../dep'], (function (dep) { 'use strict'; - - class Main { - constructor () { - dep.fn(); - } - } - - return Main; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/cjs/dep.js b/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/cjs/dep.js deleted file mode 100644 index 119bca3dd..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/cjs/dep.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -function fn () { - console.log('dep fn'); -} - -exports.fn = fn; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/cjs/lib/main.js b/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/cjs/lib/main.js deleted file mode 100644 index fb6e31f3a..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/cjs/lib/main.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -var dep = require('../dep.js'); - -class Main { - constructor () { - dep.fn(); - } -} - -module.exports = Main; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/es/dep.js b/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/es/dep.js deleted file mode 100644 index bfe925a46..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/es/dep.js +++ /dev/null @@ -1,5 +0,0 @@ -function fn () { - console.log('dep fn'); -} - -export { fn }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/es/lib/main.js b/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/es/lib/main.js deleted file mode 100644 index 7e0751fbc..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/es/lib/main.js +++ /dev/null @@ -1,9 +0,0 @@ -import { fn } from '../dep.js'; - -class Main { - constructor () { - fn(); - } -} - -export { Main as default }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/system/dep.js b/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/system/dep.js deleted file mode 100644 index 8c38ad144..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/system/dep.js +++ /dev/null @@ -1,14 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - exports('fn', fn); - - function fn () { - console.log('dep fn'); - } - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/system/lib/main.js b/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/system/lib/main.js deleted file mode 100644 index 440f4c9f9..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/system/lib/main.js +++ /dev/null @@ -1,18 +0,0 @@ -System.register(['../dep.js'], (function (exports) { - 'use strict'; - var fn; - return { - setters: [function (module) { - fn = module.fn; - }], - execute: (function () { - - class Main { - constructor () { - fn(); - } - } exports('default', Main); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/src/dep.js b/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/src/dep.js deleted file mode 100644 index b725c96e3..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/src/dep.js +++ /dev/null @@ -1,3 +0,0 @@ -export function fn () { - console.log('dep fn'); -} \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/src/lib/main.js b/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/src/lib/main.js deleted file mode 100644 index a8f1f1403..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/src/lib/main.js +++ /dev/null @@ -1,7 +0,0 @@ -import { fn } from '../dep'; - -export default class Main { - constructor () { - fn(); - } -} \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_config.js deleted file mode 100644 index 53398ea68..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_config.js +++ /dev/null @@ -1,32 +0,0 @@ -const path = require('node:path'); - -module.exports = defineTest({ - description: 'scriptified assets have extension in preserveModules output filename', - options: { - strictDeprecations: false, - input: 'src/main.js', - preserveModules: true, - plugins: [ - { - name: 'str-num-plugin', - transform(code, id) { - switch (path.extname(id)) { - case '.num': { - return { code: `export default ${code.trim()}` }; - } - case '.str': { - return { code: `export default "${code.trim()}"` }; - } - case '': { - return { code: 'export default "COULDN\'T TRANSFORM"' }; - } - default: { - return null; - } - } - } - } - ] - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/amd/answer.num.js b/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/amd/answer.num.js deleted file mode 100644 index 29099bd21..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/amd/answer.num.js +++ /dev/null @@ -1,7 +0,0 @@ -define((function () { 'use strict'; - - var answer = 42; - - return answer; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/amd/lorem.str.js b/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/amd/lorem.str.js deleted file mode 100644 index 82deb072e..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/amd/lorem.str.js +++ /dev/null @@ -1,7 +0,0 @@ -define((function () { 'use strict'; - - var lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; - - return lorem; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/amd/main.js b/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/amd/main.js deleted file mode 100644 index 11b93e1ce..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/amd/main.js +++ /dev/null @@ -1,9 +0,0 @@ -define(['exports', './answer.num', './lorem.str', './no-ext'], (function (exports, answer, lorem, noExt) { 'use strict'; - - - - exports.answer = answer; - exports.lorem = lorem; - exports.noExt = noExt; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/amd/no-ext.js b/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/amd/no-ext.js deleted file mode 100644 index 2395eddcd..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/amd/no-ext.js +++ /dev/null @@ -1,7 +0,0 @@ -define((function () { 'use strict'; - - var noExt = "COULDN'T TRANSFORM"; - - return noExt; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/cjs/answer.num.js b/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/cjs/answer.num.js deleted file mode 100644 index afe78ce40..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/cjs/answer.num.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var answer = 42; - -module.exports = answer; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/cjs/lorem.str.js b/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/cjs/lorem.str.js deleted file mode 100644 index aa3ea036c..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/cjs/lorem.str.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; - -module.exports = lorem; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/cjs/main.js deleted file mode 100644 index 463a11a27..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/cjs/main.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -var answer = require('./answer.num.js'); -var lorem = require('./lorem.str.js'); -var noExt = require('./no-ext.js'); - - - -exports.answer = answer; -exports.lorem = lorem; -exports.noExt = noExt; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/cjs/no-ext.js b/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/cjs/no-ext.js deleted file mode 100644 index 912e8df3b..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/cjs/no-ext.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var noExt = "COULDN'T TRANSFORM"; - -module.exports = noExt; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/es/answer.num.js b/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/es/answer.num.js deleted file mode 100644 index bc6c6c354..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/es/answer.num.js +++ /dev/null @@ -1,3 +0,0 @@ -var answer = 42; - -export { answer as default }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/es/lorem.str.js b/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/es/lorem.str.js deleted file mode 100644 index 20a4e34f1..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/es/lorem.str.js +++ /dev/null @@ -1,3 +0,0 @@ -var lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; - -export { lorem as default }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/es/main.js b/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/es/main.js deleted file mode 100644 index 76d97e13f..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/es/main.js +++ /dev/null @@ -1,3 +0,0 @@ -export { default as answer } from './answer.num.js'; -export { default as lorem } from './lorem.str.js'; -export { default as noExt } from './no-ext.js'; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/es/no-ext.js b/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/es/no-ext.js deleted file mode 100644 index 10cc7f585..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/es/no-ext.js +++ /dev/null @@ -1,3 +0,0 @@ -var noExt = "COULDN'T TRANSFORM"; - -export { noExt as default }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/system/answer.num.js b/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/system/answer.num.js deleted file mode 100644 index 80f714d45..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/system/answer.num.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - var answer = exports('default', 42); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/system/lorem.str.js b/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/system/lorem.str.js deleted file mode 100644 index 4138e51e2..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/system/lorem.str.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - var lorem = exports('default', "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/system/main.js b/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/system/main.js deleted file mode 100644 index 7dd7f91b8..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/system/main.js +++ /dev/null @@ -1,17 +0,0 @@ -System.register(['./answer.num.js', './lorem.str.js', './no-ext.js'], (function (exports) { - 'use strict'; - return { - setters: [function (module) { - exports('answer', module.default); - }, function (module) { - exports('lorem', module.default); - }, function (module) { - exports('noExt', module.default); - }], - execute: (function () { - - - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/system/no-ext.js b/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/system/no-ext.js deleted file mode 100644 index adc4e116f..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/system/no-ext.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - var noExt = exports('default', "COULDN'T TRANSFORM"); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/src/answer.num b/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/src/answer.num deleted file mode 100644 index d81cc0710..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/src/answer.num +++ /dev/null @@ -1 +0,0 @@ -42 diff --git a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/src/lorem.str b/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/src/lorem.str deleted file mode 100644 index 1b376877f..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/src/lorem.str +++ /dev/null @@ -1 +0,0 @@ -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. diff --git a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/src/main.js b/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/src/main.js deleted file mode 100644 index 7ebfc9b7c..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/src/main.js +++ /dev/null @@ -1,3 +0,0 @@ -export { default as answer } from './answer.num'; -export { default as lorem } from './lorem.str'; -export { default as noExt } from './no-ext'; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/src/no-ext b/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/src/no-ext deleted file mode 100644 index ec25b34db..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/src/no-ext +++ /dev/null @@ -1 +0,0 @@ -WHATEVER diff --git a/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_config.js deleted file mode 100644 index 3391dffa7..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_config.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = defineTest({ - description: 'single entry names file correctly', - options: { - strictDeprecations: false, - input: 'main.js', - preserveModules: true - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/amd/main.js b/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/amd/main.js deleted file mode 100644 index 7b0ad1252..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/amd/main.js +++ /dev/null @@ -1,5 +0,0 @@ -define((function () { 'use strict'; - - console.log(); - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/cjs/main.js deleted file mode 100644 index 21c7c3af0..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/cjs/main.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -console.log(); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/es/main.js b/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/es/main.js deleted file mode 100644 index b7bd4c885..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/es/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log(); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/system/main.js b/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/system/main.js deleted file mode 100644 index 1063ea641..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/system/main.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function () { - 'use strict'; - return { - execute: (function () { - - console.log(); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-single-entry/main.js b/test/chunking-form/samples/deprecated/preserve-modules-single-entry/main.js deleted file mode 100644 index 13ae9bfee..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-single-entry/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log() \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_config.js deleted file mode 100644 index c9dc6418c..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_config.js +++ /dev/null @@ -1,24 +0,0 @@ -module.exports = defineTest({ - description: 'Generates actual files for virtual modules when preserving modules', - options: { - strictDeprecations: false, - input: 'main.js', - preserveModules: true, - plugins: [ - { - resolveId(id) { - if (id === '\0virtualModule') return id; - }, - load(id) { - if (id !== '\0virtualModule') return null; - return 'export const virtual = "Virtual!";\n'; - }, - transform(code, id) { - if (id === '\0virtualModule') return null; - return 'import {virtual} from "\0virtualModule";\n' + code; - } - } - ] - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/amd/_virtual/_virtualModule.js b/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/amd/_virtual/_virtualModule.js deleted file mode 100644 index dc4e209f3..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/amd/_virtual/_virtualModule.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - const virtual = "Virtual!"; - - exports.virtual = virtual; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/amd/main.js b/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/amd/main.js deleted file mode 100644 index 744ca4ba5..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/amd/main.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./_virtual/_virtualModule'], (function (_virtualModule) { 'use strict'; - - assert.equal(_virtualModule.virtual, 'Virtual!'); - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/cjs/_virtual/_virtualModule.js b/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/cjs/_virtual/_virtualModule.js deleted file mode 100644 index 266f8b024..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/cjs/_virtual/_virtualModule.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -const virtual = "Virtual!"; - -exports.virtual = virtual; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/cjs/main.js deleted file mode 100644 index a3d4133c5..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/cjs/main.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var _virtualModule = require('./_virtual/_virtualModule.js'); - -assert.equal(_virtualModule.virtual, 'Virtual!'); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/es/_virtual/_virtualModule.js b/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/es/_virtual/_virtualModule.js deleted file mode 100644 index 2bada18c3..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/es/_virtual/_virtualModule.js +++ /dev/null @@ -1,3 +0,0 @@ -const virtual = "Virtual!"; - -export { virtual }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/es/main.js b/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/es/main.js deleted file mode 100644 index 96f7b3317..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/es/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import { virtual } from './_virtual/_virtualModule.js'; - -assert.equal(virtual, 'Virtual!'); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/system/_virtual/_virtualModule.js b/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/system/_virtual/_virtualModule.js deleted file mode 100644 index 51cfccb8a..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/system/_virtual/_virtualModule.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - const virtual = exports('virtual', "Virtual!"); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/system/main.js b/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/system/main.js deleted file mode 100644 index f92fd6039..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/system/main.js +++ /dev/null @@ -1,14 +0,0 @@ -System.register(['./_virtual/_virtualModule.js'], (function () { - 'use strict'; - var virtual; - return { - setters: [function (module) { - virtual = module.virtual; - }], - execute: (function () { - - assert.equal(virtual, 'Virtual!'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/main.js b/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/main.js deleted file mode 100644 index 505982998..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/main.js +++ /dev/null @@ -1 +0,0 @@ -assert.equal(virtual, 'Virtual!'); diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_config.js b/test/chunking-form/samples/deprecated/preserve-modules/_config.js deleted file mode 100644 index f43884893..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_config.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = defineTest({ - description: 'Rewrite modules in-place', - options: { - strictDeprecations: false, - input: ['main1.js', 'main2.js'], - preserveModules: true - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/deps/dep1.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/deps/dep1.js deleted file mode 100644 index 59783d02d..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/deps/dep1.js +++ /dev/null @@ -1,9 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - function fn () { - console.log('dep1 fn'); - } - - exports.fn = fn; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/deps/dep2.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/deps/dep2.js deleted file mode 100644 index 2ab2557ab..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/deps/dep2.js +++ /dev/null @@ -1,10 +0,0 @@ -define(['exports', '../lib/lib2'], (function (exports, lib2) { 'use strict'; - - function fn () { - lib2.fn(); - console.log('dep2 fn'); - } - - exports.fn = fn; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/deps/dep3.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/deps/dep3.js deleted file mode 100644 index 3b871ce76..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/deps/dep3.js +++ /dev/null @@ -1,10 +0,0 @@ -define(['exports', '../lib/lib1'], (function (exports, lib1) { 'use strict'; - - function fn () { - lib1.fn(); - console.log('dep3 fn'); - } - - exports.fn = fn; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/lib/lib1.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/lib/lib1.js deleted file mode 100644 index 6d846653c..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/lib/lib1.js +++ /dev/null @@ -1,9 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - function fn () { - console.log('lib1 fn'); - } - - exports.fn = fn; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/lib/lib2.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/lib/lib2.js deleted file mode 100644 index be6d55fa4..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/lib/lib2.js +++ /dev/null @@ -1,9 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - function fn () { - console.log('lib2 fn'); - } - - exports.fn = fn; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/main1.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/main1.js deleted file mode 100644 index 296879eff..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/main1.js +++ /dev/null @@ -1,12 +0,0 @@ -define(['./deps/dep1', './deps/dep2'], (function (dep1, dep2) { 'use strict'; - - class Main1 { - constructor () { - dep1.fn(); - dep2.fn(); - } - } - - return Main1; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/main2.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/main2.js deleted file mode 100644 index adff70c23..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -define(['./deps/dep2', './deps/dep3'], (function (dep2, dep3) { 'use strict'; - - class Main2 { - constructor () { - dep3.fn(); - dep2.fn(); - } - } - - return Main2; - -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/deps/dep1.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/deps/dep1.js deleted file mode 100644 index 5d2f022fa..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/deps/dep1.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -function fn () { - console.log('dep1 fn'); -} - -exports.fn = fn; diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/deps/dep2.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/deps/dep2.js deleted file mode 100644 index 1c35a7c28..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/deps/dep2.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -var lib2 = require('../lib/lib2.js'); - -function fn () { - lib2.fn(); - console.log('dep2 fn'); -} - -exports.fn = fn; diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/deps/dep3.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/deps/dep3.js deleted file mode 100644 index 9459cf55d..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/deps/dep3.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -var lib1 = require('../lib/lib1.js'); - -function fn () { - lib1.fn(); - console.log('dep3 fn'); -} - -exports.fn = fn; diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/lib/lib1.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/lib/lib1.js deleted file mode 100644 index 6a9d99129..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/lib/lib1.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -function fn () { - console.log('lib1 fn'); -} - -exports.fn = fn; diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/lib/lib2.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/lib/lib2.js deleted file mode 100644 index cf6e36b03..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/lib/lib2.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -function fn () { - console.log('lib2 fn'); -} - -exports.fn = fn; diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/main1.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/main1.js deleted file mode 100644 index 0181b38e2..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/main1.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -var dep1 = require('./deps/dep1.js'); -var dep2 = require('./deps/dep2.js'); - -class Main1 { - constructor () { - dep1.fn(); - dep2.fn(); - } -} - -module.exports = Main1; diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/main2.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/main2.js deleted file mode 100644 index 5078fc785..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/main2.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -var dep2 = require('./deps/dep2.js'); -var dep3 = require('./deps/dep3.js'); - -class Main2 { - constructor () { - dep3.fn(); - dep2.fn(); - } -} - -module.exports = Main2; diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/deps/dep1.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/deps/dep1.js deleted file mode 100644 index 34a5e9c11..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/deps/dep1.js +++ /dev/null @@ -1,5 +0,0 @@ -function fn () { - console.log('dep1 fn'); -} - -export { fn }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/deps/dep2.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/deps/dep2.js deleted file mode 100644 index 233b8235a..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/deps/dep2.js +++ /dev/null @@ -1,8 +0,0 @@ -import { fn as fn$1 } from '../lib/lib2.js'; - -function fn () { - fn$1(); - console.log('dep2 fn'); -} - -export { fn }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/deps/dep3.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/deps/dep3.js deleted file mode 100644 index e01b47ef1..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/deps/dep3.js +++ /dev/null @@ -1,8 +0,0 @@ -import { fn as fn$1 } from '../lib/lib1.js'; - -function fn () { - fn$1(); - console.log('dep3 fn'); -} - -export { fn }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/lib/lib1.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/lib/lib1.js deleted file mode 100644 index 0d869dbec..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/lib/lib1.js +++ /dev/null @@ -1,5 +0,0 @@ -function fn () { - console.log('lib1 fn'); -} - -export { fn }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/lib/lib2.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/lib/lib2.js deleted file mode 100644 index a6f4f0324..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/lib/lib2.js +++ /dev/null @@ -1,5 +0,0 @@ -function fn () { - console.log('lib2 fn'); -} - -export { fn }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/main1.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/main1.js deleted file mode 100644 index a7780fee2..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/main1.js +++ /dev/null @@ -1,11 +0,0 @@ -import { fn } from './deps/dep1.js'; -import { fn as fn$1 } from './deps/dep2.js'; - -class Main1 { - constructor () { - fn(); - fn$1(); - } -} - -export { Main1 as default }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/main2.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/main2.js deleted file mode 100644 index 4e89541f0..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/main2.js +++ /dev/null @@ -1,11 +0,0 @@ -import { fn as fn$1 } from './deps/dep2.js'; -import { fn } from './deps/dep3.js'; - -class Main2 { - constructor () { - fn(); - fn$1(); - } -} - -export { Main2 as default }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/deps/dep1.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/deps/dep1.js deleted file mode 100644 index 30f5932b2..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/deps/dep1.js +++ /dev/null @@ -1,14 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - exports('fn', fn); - - function fn () { - console.log('dep1 fn'); - } - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/deps/dep2.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/deps/dep2.js deleted file mode 100644 index 266a74dbe..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/deps/dep2.js +++ /dev/null @@ -1,19 +0,0 @@ -System.register(['../lib/lib2.js'], (function (exports) { - 'use strict'; - var fn$1; - return { - setters: [function (module) { - fn$1 = module.fn; - }], - execute: (function () { - - exports('fn', fn); - - function fn () { - fn$1(); - console.log('dep2 fn'); - } - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/deps/dep3.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/deps/dep3.js deleted file mode 100644 index c7293a4ee..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/deps/dep3.js +++ /dev/null @@ -1,19 +0,0 @@ -System.register(['../lib/lib1.js'], (function (exports) { - 'use strict'; - var fn$1; - return { - setters: [function (module) { - fn$1 = module.fn; - }], - execute: (function () { - - exports('fn', fn); - - function fn () { - fn$1(); - console.log('dep3 fn'); - } - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/lib/lib1.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/lib/lib1.js deleted file mode 100644 index 38247e531..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/lib/lib1.js +++ /dev/null @@ -1,14 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - exports('fn', fn); - - function fn () { - console.log('lib1 fn'); - } - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/lib/lib2.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/lib/lib2.js deleted file mode 100644 index 942fe4550..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/lib/lib2.js +++ /dev/null @@ -1,14 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - exports('fn', fn); - - function fn () { - console.log('lib2 fn'); - } - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/main1.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/main1.js deleted file mode 100644 index a8ee090a6..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/main1.js +++ /dev/null @@ -1,21 +0,0 @@ -System.register(['./deps/dep1.js', './deps/dep2.js'], (function (exports) { - 'use strict'; - var fn, fn$1; - return { - setters: [function (module) { - fn = module.fn; - }, function (module) { - fn$1 = module.fn; - }], - execute: (function () { - - class Main1 { - constructor () { - fn(); - fn$1(); - } - } exports('default', Main1); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/main2.js b/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/main2.js deleted file mode 100644 index b2fe3e012..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/main2.js +++ /dev/null @@ -1,21 +0,0 @@ -System.register(['./deps/dep2.js', './deps/dep3.js'], (function (exports) { - 'use strict'; - var fn$1, fn; - return { - setters: [function (module) { - fn$1 = module.fn; - }, function (module) { - fn = module.fn; - }], - execute: (function () { - - class Main2 { - constructor () { - fn(); - fn$1(); - } - } exports('default', Main2); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/preserve-modules/deps/dep1.js b/test/chunking-form/samples/deprecated/preserve-modules/deps/dep1.js deleted file mode 100644 index b67d0bbb2..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/deps/dep1.js +++ /dev/null @@ -1,3 +0,0 @@ -export function fn () { - console.log('dep1 fn'); -} \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/preserve-modules/deps/dep2.js b/test/chunking-form/samples/deprecated/preserve-modules/deps/dep2.js deleted file mode 100644 index 031534c44..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/deps/dep2.js +++ /dev/null @@ -1,6 +0,0 @@ -import { fn as libfn } from '../lib/lib2.js'; - -export function fn () { - libfn(); - console.log('dep2 fn'); -} \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/preserve-modules/deps/dep3.js b/test/chunking-form/samples/deprecated/preserve-modules/deps/dep3.js deleted file mode 100644 index 0ebd9320b..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/deps/dep3.js +++ /dev/null @@ -1,8 +0,0 @@ -import { fn as libfn, treeshaked } from '../lib/lib1.js'; - -export function fn () { - libfn(); - console.log('dep3 fn'); -} - -export default treeshaked; \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/preserve-modules/lib/lib1.js b/test/chunking-form/samples/deprecated/preserve-modules/lib/lib1.js deleted file mode 100644 index 5ccf83b35..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/lib/lib1.js +++ /dev/null @@ -1,7 +0,0 @@ -export function fn () { - console.log('lib1 fn'); -} - -export function treeshaked () { - console.log('this is tree shaken!'); -} \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/preserve-modules/lib/lib2.js b/test/chunking-form/samples/deprecated/preserve-modules/lib/lib2.js deleted file mode 100644 index 2d6d2cf08..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/lib/lib2.js +++ /dev/null @@ -1,3 +0,0 @@ -export function fn () { - console.log('lib2 fn'); -} \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/preserve-modules/main1.js b/test/chunking-form/samples/deprecated/preserve-modules/main1.js deleted file mode 100644 index dfbcdf631..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -import { fn } from './deps/dep1.js'; -import { fn as fn2 } from './deps/dep2.js'; - -export default class Main1 { - constructor () { - fn(); - fn2(); - } -} \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/preserve-modules/main2.js b/test/chunking-form/samples/deprecated/preserve-modules/main2.js deleted file mode 100644 index 67202404b..000000000 --- a/test/chunking-form/samples/deprecated/preserve-modules/main2.js +++ /dev/null @@ -1,13 +0,0 @@ -import { fn } from './deps/dep2.js'; -import { fn as fn2, default as treeshaked } from './deps/dep3.js'; - -if (false) { - treeshaked(); -} - -export default class Main2 { - constructor () { - fn2(); - fn(); - } -} \ No newline at end of file diff --git a/test/cli/samples/warn-mixed-exports-multiple/rollup.config.js b/test/cli/samples/warn-mixed-exports-multiple/rollup.config.js index 2ee4513c4..083e1a120 100644 --- a/test/cli/samples/warn-mixed-exports-multiple/rollup.config.js +++ b/test/cli/samples/warn-mixed-exports-multiple/rollup.config.js @@ -1,7 +1,7 @@ module.exports = { input: 'main.js', - preserveModules: true, output: { - format: 'amd' + format: 'amd', + preserveModules: true } }; diff --git a/test/cli/samples/warn-unknown-options/rollup.config.js b/test/cli/samples/warn-unknown-options/rollup.config.js index c216ce3f7..87fe5f3d7 100644 --- a/test/cli/samples/warn-unknown-options/rollup.config.js +++ b/test/cli/samples/warn-unknown-options/rollup.config.js @@ -1,5 +1,5 @@ -var assert = require('node:assert'); -var replace = require('@rollup/plugin-replace'); +const assert = require('node:assert'); +const replace = require('@rollup/plugin-replace'); let warnings = 0; diff --git a/test/form/samples/deprecated/dynamic-import-inlining-array/_config.js b/test/form/samples/deprecated/dynamic-import-inlining-array/_config.js deleted file mode 100644 index dcdb14a77..000000000 --- a/test/form/samples/deprecated/dynamic-import-inlining-array/_config.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = defineTest({ - description: 'supports an array with a single entry when inlining dynamic imports', - options: { - strictDeprecations: false, - inlineDynamicImports: true, - input: ['main'] - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/form/samples/deprecated/dynamic-import-inlining-array/_expected.js b/test/form/samples/deprecated/dynamic-import-inlining-array/_expected.js deleted file mode 100644 index 5a35de939..000000000 --- a/test/form/samples/deprecated/dynamic-import-inlining-array/_expected.js +++ /dev/null @@ -1,8 +0,0 @@ -const bar = 2; -Promise.resolve().then(function () { return foo; }); - -var foo = /*#__PURE__*/Object.freeze({ - __proto__: null -}); - -export { bar }; diff --git a/test/form/samples/deprecated/dynamic-import-inlining-array/foo.js b/test/form/samples/deprecated/dynamic-import-inlining-array/foo.js deleted file mode 100644 index 6a8018af4..000000000 --- a/test/form/samples/deprecated/dynamic-import-inlining-array/foo.js +++ /dev/null @@ -1 +0,0 @@ -export const foo = 1; \ No newline at end of file diff --git a/test/form/samples/deprecated/dynamic-import-inlining-array/main.js b/test/form/samples/deprecated/dynamic-import-inlining-array/main.js deleted file mode 100644 index ee3e6a770..000000000 --- a/test/form/samples/deprecated/dynamic-import-inlining-array/main.js +++ /dev/null @@ -1,2 +0,0 @@ -export const bar = 2; -import('./foo.js'); diff --git a/test/form/samples/deprecated/dynamic-import-inlining/_config.js b/test/form/samples/deprecated/dynamic-import-inlining/_config.js deleted file mode 100644 index 1c08b44c2..000000000 --- a/test/form/samples/deprecated/dynamic-import-inlining/_config.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = defineTest({ - description: 'dynamic import inlining', - options: { - strictDeprecations: false, - inlineDynamicImports: true - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/form/samples/deprecated/dynamic-import-inlining/_expected.js b/test/form/samples/deprecated/dynamic-import-inlining/_expected.js deleted file mode 100644 index 5a35de939..000000000 --- a/test/form/samples/deprecated/dynamic-import-inlining/_expected.js +++ /dev/null @@ -1,8 +0,0 @@ -const bar = 2; -Promise.resolve().then(function () { return foo; }); - -var foo = /*#__PURE__*/Object.freeze({ - __proto__: null -}); - -export { bar }; diff --git a/test/form/samples/deprecated/dynamic-import-inlining/foo.js b/test/form/samples/deprecated/dynamic-import-inlining/foo.js deleted file mode 100644 index 6a8018af4..000000000 --- a/test/form/samples/deprecated/dynamic-import-inlining/foo.js +++ /dev/null @@ -1 +0,0 @@ -export const foo = 1; \ No newline at end of file diff --git a/test/form/samples/deprecated/dynamic-import-inlining/main.js b/test/form/samples/deprecated/dynamic-import-inlining/main.js deleted file mode 100644 index ee3e6a770..000000000 --- a/test/form/samples/deprecated/dynamic-import-inlining/main.js +++ /dev/null @@ -1,2 +0,0 @@ -export const bar = 2; -import('./foo.js'); diff --git a/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_config.js b/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_config.js deleted file mode 100644 index bd9972fd9..000000000 --- a/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_config.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = defineTest({ - description: 'completely removes tree-shaken dynamic imports ', - options: { - strictDeprecations: false, - inlineDynamicImports: true - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/amd.js b/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/amd.js deleted file mode 100644 index 49540b44d..000000000 --- a/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/amd.js +++ /dev/null @@ -1,5 +0,0 @@ -define((function () { 'use strict'; - - console.log('main'); - -})); diff --git a/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/cjs.js b/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/cjs.js deleted file mode 100644 index d0ed06d8c..000000000 --- a/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/cjs.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -console.log('main'); diff --git a/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/es.js b/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/es.js deleted file mode 100644 index c0b933d7b..000000000 --- a/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/es.js +++ /dev/null @@ -1 +0,0 @@ -console.log('main'); diff --git a/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/iife.js b/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/iife.js deleted file mode 100644 index 455edee6a..000000000 --- a/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/iife.js +++ /dev/null @@ -1,6 +0,0 @@ -(function () { - 'use strict'; - - console.log('main'); - -})(); diff --git a/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/system.js b/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/system.js deleted file mode 100644 index 35e269337..000000000 --- a/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/system.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function () { - 'use strict'; - return { - execute: (function () { - - console.log('main'); - - }) - }; -})); diff --git a/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/umd.js b/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/umd.js deleted file mode 100644 index c8ba7daa8..000000000 --- a/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/umd.js +++ /dev/null @@ -1,8 +0,0 @@ -(function (factory) { - typeof define === 'function' && define.amd ? define(factory) : - factory(); -})((function () { 'use strict'; - - console.log('main'); - -})); diff --git a/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/dynamic.js b/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/dynamic.js deleted file mode 100644 index 1d7a1acc1..000000000 --- a/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/dynamic.js +++ /dev/null @@ -1,2 +0,0 @@ -console.log('dynamic'); -export var dynamic = 42; diff --git a/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/main.js b/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/main.js deleted file mode 100644 index 9b0aad2c2..000000000 --- a/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/main.js +++ /dev/null @@ -1,2 +0,0 @@ -console.log('main'); -const getFoo = () => import('./dynamic.js'); diff --git a/test/form/samples/deprecated/namespace-tostring/entry-default/_config.js b/test/form/samples/deprecated/namespace-tostring/entry-default/_config.js deleted file mode 100644 index 9edd41090..000000000 --- a/test/form/samples/deprecated/namespace-tostring/entry-default/_config.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = defineTest({ - description: 'does not add Symbol.toStringTag property to entry chunks with default export mode', - options: { - strictDeprecations: false, - output: { - namespaceToStringTag: true, - exports: 'default', - name: 'bundle' - } - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/form/samples/deprecated/namespace-tostring/entry-default/_expected/amd.js b/test/form/samples/deprecated/namespace-tostring/entry-default/_expected/amd.js deleted file mode 100644 index 3c31a8f0b..000000000 --- a/test/form/samples/deprecated/namespace-tostring/entry-default/_expected/amd.js +++ /dev/null @@ -1,7 +0,0 @@ -define((function () { 'use strict'; - - var main = { foo: 42 }; - - return main; - -})); diff --git a/test/form/samples/deprecated/namespace-tostring/entry-default/_expected/cjs.js b/test/form/samples/deprecated/namespace-tostring/entry-default/_expected/cjs.js deleted file mode 100644 index 202ac69ae..000000000 --- a/test/form/samples/deprecated/namespace-tostring/entry-default/_expected/cjs.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var main = { foo: 42 }; - -module.exports = main; diff --git a/test/form/samples/deprecated/namespace-tostring/entry-default/_expected/es.js b/test/form/samples/deprecated/namespace-tostring/entry-default/_expected/es.js deleted file mode 100644 index 9f84202e4..000000000 --- a/test/form/samples/deprecated/namespace-tostring/entry-default/_expected/es.js +++ /dev/null @@ -1,3 +0,0 @@ -var main = { foo: 42 }; - -export { main as default }; diff --git a/test/form/samples/deprecated/namespace-tostring/entry-default/_expected/iife.js b/test/form/samples/deprecated/namespace-tostring/entry-default/_expected/iife.js deleted file mode 100644 index b9892e039..000000000 --- a/test/form/samples/deprecated/namespace-tostring/entry-default/_expected/iife.js +++ /dev/null @@ -1,8 +0,0 @@ -var bundle = (function () { - 'use strict'; - - var main = { foo: 42 }; - - return main; - -})(); diff --git a/test/form/samples/deprecated/namespace-tostring/entry-default/_expected/system.js b/test/form/samples/deprecated/namespace-tostring/entry-default/_expected/system.js deleted file mode 100644 index e78d3f095..000000000 --- a/test/form/samples/deprecated/namespace-tostring/entry-default/_expected/system.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register('bundle', [], (function (exports) { - 'use strict'; - return { - execute: (function () { - - var main = exports('default', { foo: 42 }); - - }) - }; -})); diff --git a/test/form/samples/deprecated/namespace-tostring/entry-default/_expected/umd.js b/test/form/samples/deprecated/namespace-tostring/entry-default/_expected/umd.js deleted file mode 100644 index 8bea77662..000000000 --- a/test/form/samples/deprecated/namespace-tostring/entry-default/_expected/umd.js +++ /dev/null @@ -1,11 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bundle = factory()); -})(this, (function () { 'use strict'; - - var main = { foo: 42 }; - - return main; - -})); diff --git a/test/form/samples/deprecated/namespace-tostring/entry-default/main.js b/test/form/samples/deprecated/namespace-tostring/entry-default/main.js deleted file mode 100644 index 407b3c24e..000000000 --- a/test/form/samples/deprecated/namespace-tostring/entry-default/main.js +++ /dev/null @@ -1 +0,0 @@ -export default { foo: 42 }; diff --git a/test/form/samples/deprecated/namespace-tostring/entry-named/_config.js b/test/form/samples/deprecated/namespace-tostring/entry-named/_config.js deleted file mode 100644 index fdb9c53e7..000000000 --- a/test/form/samples/deprecated/namespace-tostring/entry-named/_config.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = defineTest({ - description: 'adds Symbol.toStringTag property to entry chunks with named exports', - options: { - strictDeprecations: false, - output: { - namespaceToStringTag: true, - exports: 'named', - name: 'bundle' - } - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/form/samples/deprecated/namespace-tostring/entry-named/_expected/amd.js b/test/form/samples/deprecated/namespace-tostring/entry-named/_expected/amd.js deleted file mode 100644 index 9b68f32c6..000000000 --- a/test/form/samples/deprecated/namespace-tostring/entry-named/_expected/amd.js +++ /dev/null @@ -1,9 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - const foo = 42; - - exports.foo = foo; - - Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); - -})); diff --git a/test/form/samples/deprecated/namespace-tostring/entry-named/_expected/cjs.js b/test/form/samples/deprecated/namespace-tostring/entry-named/_expected/cjs.js deleted file mode 100644 index 3ced9f151..000000000 --- a/test/form/samples/deprecated/namespace-tostring/entry-named/_expected/cjs.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); - -const foo = 42; - -exports.foo = foo; diff --git a/test/form/samples/deprecated/namespace-tostring/entry-named/_expected/es.js b/test/form/samples/deprecated/namespace-tostring/entry-named/_expected/es.js deleted file mode 100644 index b72a22eac..000000000 --- a/test/form/samples/deprecated/namespace-tostring/entry-named/_expected/es.js +++ /dev/null @@ -1,3 +0,0 @@ -const foo = 42; - -export { foo }; diff --git a/test/form/samples/deprecated/namespace-tostring/entry-named/_expected/iife.js b/test/form/samples/deprecated/namespace-tostring/entry-named/_expected/iife.js deleted file mode 100644 index 031b5a7ba..000000000 --- a/test/form/samples/deprecated/namespace-tostring/entry-named/_expected/iife.js +++ /dev/null @@ -1,12 +0,0 @@ -var bundle = (function (exports) { - 'use strict'; - - const foo = 42; - - exports.foo = foo; - - Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); - - return exports; - -})({}); diff --git a/test/form/samples/deprecated/namespace-tostring/entry-named/_expected/system.js b/test/form/samples/deprecated/namespace-tostring/entry-named/_expected/system.js deleted file mode 100644 index 53ad1b79c..000000000 --- a/test/form/samples/deprecated/namespace-tostring/entry-named/_expected/system.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register('bundle', [], (function (exports) { - 'use strict'; - return { - execute: (function () { - - const foo = exports('foo', 42); - - }) - }; -})); diff --git a/test/form/samples/deprecated/namespace-tostring/entry-named/_expected/umd.js b/test/form/samples/deprecated/namespace-tostring/entry-named/_expected/umd.js deleted file mode 100644 index f69065ef0..000000000 --- a/test/form/samples/deprecated/namespace-tostring/entry-named/_expected/umd.js +++ /dev/null @@ -1,13 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {})); -})(this, (function (exports) { 'use strict'; - - const foo = 42; - - exports.foo = foo; - - Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); - -})); diff --git a/test/form/samples/deprecated/namespace-tostring/entry-named/main.js b/test/form/samples/deprecated/namespace-tostring/entry-named/main.js deleted file mode 100644 index 9d7381d29..000000000 --- a/test/form/samples/deprecated/namespace-tostring/entry-named/main.js +++ /dev/null @@ -1 +0,0 @@ -export const foo = 42; diff --git a/test/form/samples/deprecated/namespace-tostring/external-namespaces/_config.js b/test/form/samples/deprecated/namespace-tostring/external-namespaces/_config.js deleted file mode 100644 index a0c4e8717..000000000 --- a/test/form/samples/deprecated/namespace-tostring/external-namespaces/_config.js +++ /dev/null @@ -1,34 +0,0 @@ -module.exports = defineTest({ - description: 'adds Symbol.toStringTag property to external namespaces', - options: { - strictDeprecations: false, - external(id) { - return id.startsWith('external'); - }, - output: { - namespaceToStringTag: true, - globals: { - 'external-auto': 'externalAuto', - 'external-default': 'externalDefault', - 'external-defaultOnly': 'externalDefaultOnly' - }, - interop(id) { - switch (id) { - case 'external-auto': { - return 'auto'; - } - case 'external-default': { - return 'default'; - } - case 'external-defaultOnly': { - return 'defaultOnly'; - } - default: { - throw new Error(`Unexpected require "${id}"`); - } - } - } - } - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/amd.js b/test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/amd.js deleted file mode 100644 index 5a24d36b9..000000000 --- a/test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/amd.js +++ /dev/null @@ -1,40 +0,0 @@ -define(['external-auto', 'external-default', 'external-defaultOnly'], (function (externalAuto, externalDefault, externalDefaultOnly) { 'use strict'; - - function _interopNamespaceDefaultOnly (e) { return Object.freeze(Object.defineProperty({ __proto__: null, default: e }, Symbol.toStringTag, { value: 'Module' })); } - - function _interopNamespaceDefault(e) { - var n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } }); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { return e[k]; } - }); - } - }); - } - n.default = e; - return Object.freeze(n); - } - - function _interopNamespace (e) { return e && e.__esModule ? e : _interopNamespaceDefault(e); } - - var externalAuto__namespace = /*#__PURE__*/_interopNamespace(externalAuto); - var externalDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(externalDefault); - var externalDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly); - - assert.strictEqual(externalAuto__namespace[Symbol.toStringTag], 'Module'); - assert.strictEqual(Object.prototype.toString.call(externalAuto__namespace), '[object Module]'); - assert.strictEqual(externalAuto__namespace.foo, 42); - - assert.strictEqual(externalDefault__namespace[Symbol.toStringTag], 'Module'); - assert.strictEqual(Object.prototype.toString.call(externalDefault__namespace), '[object Module]'); - assert.strictEqual(externalDefault__namespace.foo, 42); - - assert.strictEqual(externalDefaultOnly__namespace[Symbol.toStringTag], 'Module'); - assert.strictEqual(Object.prototype.toString.call(externalDefaultOnly__namespace), '[object Module]'); - assert.deepStrictEqual(externalDefaultOnly__namespace.default, { foo: 42 }); - -})); diff --git a/test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/cjs.js b/test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/cjs.js deleted file mode 100644 index d06f93db4..000000000 --- a/test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/cjs.js +++ /dev/null @@ -1,42 +0,0 @@ -'use strict'; - -var externalAuto = require('external-auto'); -var externalDefault = require('external-default'); -var externalDefaultOnly = require('external-defaultOnly'); - -function _interopNamespaceDefaultOnly (e) { return Object.freeze(Object.defineProperty({ __proto__: null, default: e }, Symbol.toStringTag, { value: 'Module' })); } - -function _interopNamespaceDefault(e) { - var n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } }); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { return e[k]; } - }); - } - }); - } - n.default = e; - return Object.freeze(n); -} - -function _interopNamespace (e) { return e && e.__esModule ? e : _interopNamespaceDefault(e); } - -var externalAuto__namespace = /*#__PURE__*/_interopNamespace(externalAuto); -var externalDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(externalDefault); -var externalDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly); - -assert.strictEqual(externalAuto__namespace[Symbol.toStringTag], 'Module'); -assert.strictEqual(Object.prototype.toString.call(externalAuto__namespace), '[object Module]'); -assert.strictEqual(externalAuto__namespace.foo, 42); - -assert.strictEqual(externalDefault__namespace[Symbol.toStringTag], 'Module'); -assert.strictEqual(Object.prototype.toString.call(externalDefault__namespace), '[object Module]'); -assert.strictEqual(externalDefault__namespace.foo, 42); - -assert.strictEqual(externalDefaultOnly__namespace[Symbol.toStringTag], 'Module'); -assert.strictEqual(Object.prototype.toString.call(externalDefaultOnly__namespace), '[object Module]'); -assert.deepStrictEqual(externalDefaultOnly__namespace.default, { foo: 42 }); diff --git a/test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/es.js b/test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/es.js deleted file mode 100644 index 978de6a2c..000000000 --- a/test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/es.js +++ /dev/null @@ -1,15 +0,0 @@ -import * as externalAuto from 'external-auto'; -import * as externalDefault from 'external-default'; -import * as externalDefaultOnly from 'external-defaultOnly'; - -assert.strictEqual(externalAuto[Symbol.toStringTag], 'Module'); -assert.strictEqual(Object.prototype.toString.call(externalAuto), '[object Module]'); -assert.strictEqual(externalAuto.foo, 42); - -assert.strictEqual(externalDefault[Symbol.toStringTag], 'Module'); -assert.strictEqual(Object.prototype.toString.call(externalDefault), '[object Module]'); -assert.strictEqual(externalDefault.foo, 42); - -assert.strictEqual(externalDefaultOnly[Symbol.toStringTag], 'Module'); -assert.strictEqual(Object.prototype.toString.call(externalDefaultOnly), '[object Module]'); -assert.deepStrictEqual(externalDefaultOnly.default, { foo: 42 }); diff --git a/test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/iife.js b/test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/iife.js deleted file mode 100644 index eb04205bc..000000000 --- a/test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/iife.js +++ /dev/null @@ -1,41 +0,0 @@ -(function (externalAuto, externalDefault, externalDefaultOnly) { - 'use strict'; - - function _interopNamespaceDefaultOnly (e) { return Object.freeze(Object.defineProperty({ __proto__: null, default: e }, Symbol.toStringTag, { value: 'Module' })); } - - function _interopNamespaceDefault(e) { - var n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } }); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { return e[k]; } - }); - } - }); - } - n.default = e; - return Object.freeze(n); - } - - function _interopNamespace (e) { return e && e.__esModule ? e : _interopNamespaceDefault(e); } - - var externalAuto__namespace = /*#__PURE__*/_interopNamespace(externalAuto); - var externalDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(externalDefault); - var externalDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly); - - assert.strictEqual(externalAuto__namespace[Symbol.toStringTag], 'Module'); - assert.strictEqual(Object.prototype.toString.call(externalAuto__namespace), '[object Module]'); - assert.strictEqual(externalAuto__namespace.foo, 42); - - assert.strictEqual(externalDefault__namespace[Symbol.toStringTag], 'Module'); - assert.strictEqual(Object.prototype.toString.call(externalDefault__namespace), '[object Module]'); - assert.strictEqual(externalDefault__namespace.foo, 42); - - assert.strictEqual(externalDefaultOnly__namespace[Symbol.toStringTag], 'Module'); - assert.strictEqual(Object.prototype.toString.call(externalDefaultOnly__namespace), '[object Module]'); - assert.deepStrictEqual(externalDefaultOnly__namespace.default, { foo: 42 }); - -})(externalAuto, externalDefault, externalDefaultOnly); diff --git a/test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/system.js b/test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/system.js deleted file mode 100644 index 76dd2bf6c..000000000 --- a/test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/system.js +++ /dev/null @@ -1,28 +0,0 @@ -System.register(['external-auto', 'external-default', 'external-defaultOnly'], (function () { - 'use strict'; - var externalAuto, externalDefault, externalDefaultOnly; - return { - setters: [function (module) { - externalAuto = module; - }, function (module) { - externalDefault = module; - }, function (module) { - externalDefaultOnly = module; - }], - execute: (function () { - - assert.strictEqual(externalAuto[Symbol.toStringTag], 'Module'); - assert.strictEqual(Object.prototype.toString.call(externalAuto), '[object Module]'); - assert.strictEqual(externalAuto.foo, 42); - - assert.strictEqual(externalDefault[Symbol.toStringTag], 'Module'); - assert.strictEqual(Object.prototype.toString.call(externalDefault), '[object Module]'); - assert.strictEqual(externalDefault.foo, 42); - - assert.strictEqual(externalDefaultOnly[Symbol.toStringTag], 'Module'); - assert.strictEqual(Object.prototype.toString.call(externalDefaultOnly), '[object Module]'); - assert.deepStrictEqual(externalDefaultOnly.default, { foo: 42 }); - - }) - }; -})); diff --git a/test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/umd.js b/test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/umd.js deleted file mode 100644 index 8c3d88c66..000000000 --- a/test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/umd.js +++ /dev/null @@ -1,44 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('external-auto'), require('external-default'), require('external-defaultOnly')) : - typeof define === 'function' && define.amd ? define(['external-auto', 'external-default', 'external-defaultOnly'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.externalAuto, global.externalDefault, global.externalDefaultOnly)); -})(this, (function (externalAuto, externalDefault, externalDefaultOnly) { 'use strict'; - - function _interopNamespaceDefaultOnly (e) { return Object.freeze(Object.defineProperty({ __proto__: null, default: e }, Symbol.toStringTag, { value: 'Module' })); } - - function _interopNamespaceDefault(e) { - var n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } }); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { return e[k]; } - }); - } - }); - } - n.default = e; - return Object.freeze(n); - } - - function _interopNamespace (e) { return e && e.__esModule ? e : _interopNamespaceDefault(e); } - - var externalAuto__namespace = /*#__PURE__*/_interopNamespace(externalAuto); - var externalDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(externalDefault); - var externalDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly); - - assert.strictEqual(externalAuto__namespace[Symbol.toStringTag], 'Module'); - assert.strictEqual(Object.prototype.toString.call(externalAuto__namespace), '[object Module]'); - assert.strictEqual(externalAuto__namespace.foo, 42); - - assert.strictEqual(externalDefault__namespace[Symbol.toStringTag], 'Module'); - assert.strictEqual(Object.prototype.toString.call(externalDefault__namespace), '[object Module]'); - assert.strictEqual(externalDefault__namespace.foo, 42); - - assert.strictEqual(externalDefaultOnly__namespace[Symbol.toStringTag], 'Module'); - assert.strictEqual(Object.prototype.toString.call(externalDefaultOnly__namespace), '[object Module]'); - assert.deepStrictEqual(externalDefaultOnly__namespace.default, { foo: 42 }); - -})); diff --git a/test/form/samples/deprecated/namespace-tostring/external-namespaces/main.js b/test/form/samples/deprecated/namespace-tostring/external-namespaces/main.js deleted file mode 100644 index 978de6a2c..000000000 --- a/test/form/samples/deprecated/namespace-tostring/external-namespaces/main.js +++ /dev/null @@ -1,15 +0,0 @@ -import * as externalAuto from 'external-auto'; -import * as externalDefault from 'external-default'; -import * as externalDefaultOnly from 'external-defaultOnly'; - -assert.strictEqual(externalAuto[Symbol.toStringTag], 'Module'); -assert.strictEqual(Object.prototype.toString.call(externalAuto), '[object Module]'); -assert.strictEqual(externalAuto.foo, 42); - -assert.strictEqual(externalDefault[Symbol.toStringTag], 'Module'); -assert.strictEqual(Object.prototype.toString.call(externalDefault), '[object Module]'); -assert.strictEqual(externalDefault.foo, 42); - -assert.strictEqual(externalDefaultOnly[Symbol.toStringTag], 'Module'); -assert.strictEqual(Object.prototype.toString.call(externalDefaultOnly), '[object Module]'); -assert.deepStrictEqual(externalDefaultOnly.default, { foo: 42 }); diff --git a/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_config.js b/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_config.js deleted file mode 100644 index 38a04e821..000000000 --- a/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_config.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = defineTest({ - description: 'adds Symbol.toStringTag property to inlined namespaces', - options: { - strictDeprecations: false, - output: { - namespaceToStringTag: true - } - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/amd.js b/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/amd.js deleted file mode 100644 index 0fd104871..000000000 --- a/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/amd.js +++ /dev/null @@ -1,14 +0,0 @@ -define((function () { 'use strict'; - - const bar = 42; - - var foo = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({ - __proto__: null, - bar: bar - }, Symbol.toStringTag, { value: 'Module' })); - - assert.strictEqual(foo[Symbol.toStringTag], 'Module'); - assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); - assert.strictEqual(bar, 42); - -})); diff --git a/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/cjs.js b/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/cjs.js deleted file mode 100644 index 1d2be7a0b..000000000 --- a/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/cjs.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -const bar = 42; - -var foo = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({ - __proto__: null, - bar: bar -}, Symbol.toStringTag, { value: 'Module' })); - -assert.strictEqual(foo[Symbol.toStringTag], 'Module'); -assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); -assert.strictEqual(bar, 42); diff --git a/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/es.js b/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/es.js deleted file mode 100644 index a74e0a8f2..000000000 --- a/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/es.js +++ /dev/null @@ -1,10 +0,0 @@ -const bar = 42; - -var foo = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({ - __proto__: null, - bar: bar -}, Symbol.toStringTag, { value: 'Module' })); - -assert.strictEqual(foo[Symbol.toStringTag], 'Module'); -assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); -assert.strictEqual(bar, 42); diff --git a/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/iife.js b/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/iife.js deleted file mode 100644 index d960020bd..000000000 --- a/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/iife.js +++ /dev/null @@ -1,15 +0,0 @@ -(function () { - 'use strict'; - - const bar = 42; - - var foo = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({ - __proto__: null, - bar: bar - }, Symbol.toStringTag, { value: 'Module' })); - - assert.strictEqual(foo[Symbol.toStringTag], 'Module'); - assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); - assert.strictEqual(bar, 42); - -})(); diff --git a/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/system.js b/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/system.js deleted file mode 100644 index d26e50389..000000000 --- a/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/system.js +++ /dev/null @@ -1,19 +0,0 @@ -System.register([], (function () { - 'use strict'; - return { - execute: (function () { - - const bar = 42; - - var foo = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({ - __proto__: null, - bar: bar - }, Symbol.toStringTag, { value: 'Module' })); - - assert.strictEqual(foo[Symbol.toStringTag], 'Module'); - assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); - assert.strictEqual(bar, 42); - - }) - }; -})); diff --git a/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/umd.js b/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/umd.js deleted file mode 100644 index fdb31a26c..000000000 --- a/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/umd.js +++ /dev/null @@ -1,17 +0,0 @@ -(function (factory) { - typeof define === 'function' && define.amd ? define(factory) : - factory(); -})((function () { 'use strict'; - - const bar = 42; - - var foo = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({ - __proto__: null, - bar: bar - }, Symbol.toStringTag, { value: 'Module' })); - - assert.strictEqual(foo[Symbol.toStringTag], 'Module'); - assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); - assert.strictEqual(bar, 42); - -})); diff --git a/test/form/samples/deprecated/namespace-tostring/inlined-namespace/foo.js b/test/form/samples/deprecated/namespace-tostring/inlined-namespace/foo.js deleted file mode 100644 index 308e102fe..000000000 --- a/test/form/samples/deprecated/namespace-tostring/inlined-namespace/foo.js +++ /dev/null @@ -1 +0,0 @@ -export const bar = 42; diff --git a/test/form/samples/deprecated/namespace-tostring/inlined-namespace/main.js b/test/form/samples/deprecated/namespace-tostring/inlined-namespace/main.js deleted file mode 100644 index fb6b24345..000000000 --- a/test/form/samples/deprecated/namespace-tostring/inlined-namespace/main.js +++ /dev/null @@ -1,5 +0,0 @@ -import * as foo from './foo'; - -assert.strictEqual(foo[Symbol.toStringTag], 'Module'); -assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); -assert.strictEqual(foo.bar, 42); diff --git a/test/form/samples/deprecated/nested-inlined-dynamic-import/_config.js b/test/form/samples/deprecated/nested-inlined-dynamic-import/_config.js deleted file mode 100644 index 9b4467d5c..000000000 --- a/test/form/samples/deprecated/nested-inlined-dynamic-import/_config.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = defineTest({ - description: 'deconflicts variables when nested dynamic imports are inlined', - options: { - strictDeprecations: false, - inlineDynamicImports: true - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/amd.js b/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/amd.js deleted file mode 100644 index 9786f514a..000000000 --- a/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/amd.js +++ /dev/null @@ -1,18 +0,0 @@ -define((function () { 'use strict'; - - async function main() { - const foo$1 = 1; - const ns = await Promise.resolve().then(function () { return foo; }); - console.log(ns.value + foo$1); - } - - main(); - - const value = 42; - - var foo = /*#__PURE__*/Object.freeze({ - __proto__: null, - value: value - }); - -})); diff --git a/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/cjs.js b/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/cjs.js deleted file mode 100644 index 9226d1268..000000000 --- a/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/cjs.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -async function main() { - const foo$1 = 1; - const ns = await Promise.resolve().then(function () { return foo; }); - console.log(ns.value + foo$1); -} - -main(); - -const value = 42; - -var foo = /*#__PURE__*/Object.freeze({ - __proto__: null, - value: value -}); diff --git a/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/es.js b/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/es.js deleted file mode 100644 index 97b0b8e51..000000000 --- a/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/es.js +++ /dev/null @@ -1,14 +0,0 @@ -async function main() { - const foo$1 = 1; - const ns = await Promise.resolve().then(function () { return foo; }); - console.log(ns.value + foo$1); -} - -main(); - -const value = 42; - -var foo = /*#__PURE__*/Object.freeze({ - __proto__: null, - value: value -}); diff --git a/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/iife.js b/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/iife.js deleted file mode 100644 index 3dbed43ba..000000000 --- a/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/iife.js +++ /dev/null @@ -1,19 +0,0 @@ -(function () { - 'use strict'; - - async function main() { - const foo$1 = 1; - const ns = await Promise.resolve().then(function () { return foo; }); - console.log(ns.value + foo$1); - } - - main(); - - const value = 42; - - var foo = /*#__PURE__*/Object.freeze({ - __proto__: null, - value: value - }); - -})(); diff --git a/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/system.js b/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/system.js deleted file mode 100644 index 8cb925481..000000000 --- a/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/system.js +++ /dev/null @@ -1,23 +0,0 @@ -System.register([], (function () { - 'use strict'; - return { - execute: (function () { - - async function main() { - const foo$1 = 1; - const ns = await Promise.resolve().then(function () { return foo; }); - console.log(ns.value + foo$1); - } - - main(); - - const value = 42; - - var foo = /*#__PURE__*/Object.freeze({ - __proto__: null, - value: value - }); - - }) - }; -})); diff --git a/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/umd.js b/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/umd.js deleted file mode 100644 index 5fa0792d5..000000000 --- a/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/umd.js +++ /dev/null @@ -1,21 +0,0 @@ -(function (factory) { - typeof define === 'function' && define.amd ? define(factory) : - factory(); -})((function () { 'use strict'; - - async function main() { - const foo$1 = 1; - const ns = await Promise.resolve().then(function () { return foo; }); - console.log(ns.value + foo$1); - } - - main(); - - const value = 42; - - var foo = /*#__PURE__*/Object.freeze({ - __proto__: null, - value: value - }); - -})); diff --git a/test/form/samples/deprecated/nested-inlined-dynamic-import/foo.js b/test/form/samples/deprecated/nested-inlined-dynamic-import/foo.js deleted file mode 100644 index 46d3ca8c6..000000000 --- a/test/form/samples/deprecated/nested-inlined-dynamic-import/foo.js +++ /dev/null @@ -1 +0,0 @@ -export const value = 42; diff --git a/test/form/samples/deprecated/nested-inlined-dynamic-import/main.js b/test/form/samples/deprecated/nested-inlined-dynamic-import/main.js deleted file mode 100644 index 685c5cc1a..000000000 --- a/test/form/samples/deprecated/nested-inlined-dynamic-import/main.js +++ /dev/null @@ -1,7 +0,0 @@ -async function main() { - const foo = 1; - const ns = await import('./foo.js'); - console.log(ns.value + foo); -} - -main(); diff --git a/test/form/samples/deprecated/prefer-const/_config.js b/test/form/samples/deprecated/prefer-const/_config.js deleted file mode 100644 index ce844d456..000000000 --- a/test/form/samples/deprecated/prefer-const/_config.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = defineTest({ - description: 'uses const instead of var if specified (#653)', - options: { - strictDeprecations: false, - external: ['other'], - output: { - globals: { other: 'other' }, - name: 'myBundle', - preferConst: true - } - }, - expectedWarnings: ['DEPRECATED_FEATURE'] -}); diff --git a/test/form/samples/deprecated/prefer-const/_expected/amd.js b/test/form/samples/deprecated/prefer-const/_expected/amd.js deleted file mode 100644 index 4401f36e6..000000000 --- a/test/form/samples/deprecated/prefer-const/_expected/amd.js +++ /dev/null @@ -1,19 +0,0 @@ -define(['other'], (function (other) { 'use strict'; - - const a = 1; - const b = 2; - - const namespace = /*#__PURE__*/Object.freeze({ - __proto__: null, - a: a, - b: b - }); - - console.log( Object.keys( namespace ) ); - console.log( other.name ); - - const main = 42; - - return main; - -})); diff --git a/test/form/samples/deprecated/prefer-const/_expected/cjs.js b/test/form/samples/deprecated/prefer-const/_expected/cjs.js deleted file mode 100644 index 01aa90d15..000000000 --- a/test/form/samples/deprecated/prefer-const/_expected/cjs.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -const other = require('other'); - -const a = 1; -const b = 2; - -const namespace = /*#__PURE__*/Object.freeze({ - __proto__: null, - a: a, - b: b -}); - -console.log( Object.keys( namespace ) ); -console.log( other.name ); - -const main = 42; - -module.exports = main; diff --git a/test/form/samples/deprecated/prefer-const/_expected/es.js b/test/form/samples/deprecated/prefer-const/_expected/es.js deleted file mode 100644 index 83d2861ae..000000000 --- a/test/form/samples/deprecated/prefer-const/_expected/es.js +++ /dev/null @@ -1,17 +0,0 @@ -import { name } from 'other'; - -const a = 1; -const b = 2; - -const namespace = /*#__PURE__*/Object.freeze({ - __proto__: null, - a: a, - b: b -}); - -console.log( Object.keys( namespace ) ); -console.log( name ); - -const main = 42; - -export { main as default }; diff --git a/test/form/samples/deprecated/prefer-const/_expected/iife.js b/test/form/samples/deprecated/prefer-const/_expected/iife.js deleted file mode 100644 index 85ef2a3c2..000000000 --- a/test/form/samples/deprecated/prefer-const/_expected/iife.js +++ /dev/null @@ -1,20 +0,0 @@ -var myBundle = (function (other) { - 'use strict'; - - const a = 1; - const b = 2; - - const namespace = /*#__PURE__*/Object.freeze({ - __proto__: null, - a: a, - b: b - }); - - console.log( Object.keys( namespace ) ); - console.log( other.name ); - - const main = 42; - - return main; - -})(other); diff --git a/test/form/samples/deprecated/prefer-const/_expected/system.js b/test/form/samples/deprecated/prefer-const/_expected/system.js deleted file mode 100644 index aca77a4b3..000000000 --- a/test/form/samples/deprecated/prefer-const/_expected/system.js +++ /dev/null @@ -1,26 +0,0 @@ -System.register('myBundle', ['other'], (function (exports) { - 'use strict'; - var name; - return { - setters: [function (module) { - name = module.name; - }], - execute: (function () { - - const a = 1; - const b = 2; - - const namespace = /*#__PURE__*/Object.freeze({ - __proto__: null, - a: a, - b: b - }); - - console.log( Object.keys( namespace ) ); - console.log( name ); - - const main = exports('default', 42); - - }) - }; -})); diff --git a/test/form/samples/deprecated/prefer-const/_expected/umd.js b/test/form/samples/deprecated/prefer-const/_expected/umd.js deleted file mode 100644 index 5da7a70a2..000000000 --- a/test/form/samples/deprecated/prefer-const/_expected/umd.js +++ /dev/null @@ -1,23 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('other')) : - typeof define === 'function' && define.amd ? define(['other'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.myBundle = factory(global.other)); -})(this, (function (other) { 'use strict'; - - const a = 1; - const b = 2; - - const namespace = /*#__PURE__*/Object.freeze({ - __proto__: null, - a: a, - b: b - }); - - console.log( Object.keys( namespace ) ); - console.log( other.name ); - - const main = 42; - - return main; - -})); diff --git a/test/form/samples/deprecated/prefer-const/main.js b/test/form/samples/deprecated/prefer-const/main.js deleted file mode 100644 index 968604698..000000000 --- a/test/form/samples/deprecated/prefer-const/main.js +++ /dev/null @@ -1,7 +0,0 @@ -import { name } from 'other'; -import * as namespace from './namespace.js'; - -console.log( Object.keys( namespace ) ); -console.log( name ); - -export default 42; diff --git a/test/form/samples/deprecated/prefer-const/namespace.js b/test/form/samples/deprecated/prefer-const/namespace.js deleted file mode 100644 index 72ab60e17..000000000 --- a/test/form/samples/deprecated/prefer-const/namespace.js +++ /dev/null @@ -1,2 +0,0 @@ -export const a = 1; -export const b = 2; diff --git a/test/function/samples/deprecated/compact/_config.js b/test/function/samples/deprecated/compact/_config.js deleted file mode 100644 index 852426cfd..000000000 --- a/test/function/samples/deprecated/compact/_config.js +++ /dev/null @@ -1,32 +0,0 @@ -const path = require('node:path'); -const ID_MAIN = path.join(__dirname, 'main.js'); - -module.exports = defineTest({ - description: 'compact output with compact: true', - options: { - strictDeprecations: false, - external: ['external'], - output: { - compact: true, - namespaceToStringTag: true - } - }, - warnings: [ - { - code: 'CIRCULAR_DEPENDENCY', - ids: [ID_MAIN, ID_MAIN], - message: 'Circular dependency: main.js -> main.js' - }, - { - code: 'DEPRECATED_FEATURE', - message: - 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.', - url: 'https://rollupjs.org/configuration-options/#output-generatedcode-symbols' - } - ], - context: { - require() { - return 42; - } - } -}); diff --git a/test/function/samples/deprecated/compact/main.js b/test/function/samples/deprecated/compact/main.js deleted file mode 100644 index 6ecb287fb..000000000 --- a/test/function/samples/deprecated/compact/main.js +++ /dev/null @@ -1,12 +0,0 @@ -import x from 'external'; -import * as self from './main.js'; - -assert.equal(self && self['de' + 'fault'](), 42); - -export default function foo() { - return x; -} - -import('./main.js').then(self => { - assert.equal(self && self['de' + 'fault'](), 42); -}); diff --git a/test/function/samples/deprecated/dynamic-import-duplicates/_config.js b/test/function/samples/deprecated/dynamic-import-duplicates/_config.js deleted file mode 100644 index fa2edf25f..000000000 --- a/test/function/samples/deprecated/dynamic-import-duplicates/_config.js +++ /dev/null @@ -1,23 +0,0 @@ -const assert = require('node:assert'); - -module.exports = defineTest({ - description: 'Dynamic import inlining', - options: { - strictDeprecations: false, - inlineDynamicImports: true - }, - exports(exports) { - assert.equal(exports.x, 41); - return exports.promise.then(y => { - assert.equal(y, 42); - }); - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', - url: 'https://rollupjs.org/configuration-options/#output-inlinedynamicimports' - } - ] -}); diff --git a/test/function/samples/deprecated/dynamic-import-duplicates/foo.js b/test/function/samples/deprecated/dynamic-import-duplicates/foo.js deleted file mode 100644 index ddb14e152..000000000 --- a/test/function/samples/deprecated/dynamic-import-duplicates/foo.js +++ /dev/null @@ -1 +0,0 @@ -export var x = 42; \ No newline at end of file diff --git a/test/function/samples/deprecated/dynamic-import-duplicates/main.js b/test/function/samples/deprecated/dynamic-import-duplicates/main.js deleted file mode 100644 index 37a427d7d..000000000 --- a/test/function/samples/deprecated/dynamic-import-duplicates/main.js +++ /dev/null @@ -1,5 +0,0 @@ -export var x = 41; - -export var promise = Promise.all([import('./foo'), import('./foo')]).then(foos => { - return foos[0].x; -}); diff --git a/test/function/samples/deprecated/dynamic-import-inlining/_config.js b/test/function/samples/deprecated/dynamic-import-inlining/_config.js deleted file mode 100644 index fa2edf25f..000000000 --- a/test/function/samples/deprecated/dynamic-import-inlining/_config.js +++ /dev/null @@ -1,23 +0,0 @@ -const assert = require('node:assert'); - -module.exports = defineTest({ - description: 'Dynamic import inlining', - options: { - strictDeprecations: false, - inlineDynamicImports: true - }, - exports(exports) { - assert.equal(exports.x, 41); - return exports.promise.then(y => { - assert.equal(y, 42); - }); - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', - url: 'https://rollupjs.org/configuration-options/#output-inlinedynamicimports' - } - ] -}); diff --git a/test/function/samples/deprecated/dynamic-import-inlining/foo.js b/test/function/samples/deprecated/dynamic-import-inlining/foo.js deleted file mode 100644 index ddb14e152..000000000 --- a/test/function/samples/deprecated/dynamic-import-inlining/foo.js +++ /dev/null @@ -1 +0,0 @@ -export var x = 42; \ No newline at end of file diff --git a/test/function/samples/deprecated/dynamic-import-inlining/main.js b/test/function/samples/deprecated/dynamic-import-inlining/main.js deleted file mode 100644 index 94869cb0b..000000000 --- a/test/function/samples/deprecated/dynamic-import-inlining/main.js +++ /dev/null @@ -1,5 +0,0 @@ -export var x = 41; - -export var promise = import('./foo').then(foo => { - return foo.x; -}); diff --git a/test/function/samples/deprecated/dynamic-import-name-warn/_config.js b/test/function/samples/deprecated/dynamic-import-name-warn/_config.js deleted file mode 100644 index 611625380..000000000 --- a/test/function/samples/deprecated/dynamic-import-name-warn/_config.js +++ /dev/null @@ -1,46 +0,0 @@ -const assert = require('node:assert'); - -module.exports = defineTest({ - description: 'warns when specifying a custom importer function for formats other than "es"', - context: { - require(path) { - assert.equal(path, './foo.js'); - return 42; - } - }, - options: { - strictDeprecations: false, - input: 'main.js', - plugins: [ - { - resolveDynamicImport() { - return false; - } - } - ], - output: { - dynamicImportFunction: 'myImporter', - format: 'cjs', - dynamicImportInCjs: false - } - }, - exports(exports) { - return exports.fromFoo.then(value => - assert.deepStrictEqual(value, { __proto__: null, default: 42 }) - ); - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.', - url: 'https://rollupjs.org/plugin-development/#renderdynamicimport' - }, - { - code: 'INVALID_OPTION', - message: - 'Invalid value for option "output.dynamicImportFunction" - this option is ignored for formats other than "es".', - url: 'https://rollupjs.org/configuration-options/#output-dynamicimportfunction' - } - ] -}); diff --git a/test/function/samples/deprecated/dynamic-import-name-warn/main.js b/test/function/samples/deprecated/dynamic-import-name-warn/main.js deleted file mode 100644 index ed74de99f..000000000 --- a/test/function/samples/deprecated/dynamic-import-name-warn/main.js +++ /dev/null @@ -1 +0,0 @@ -export const fromFoo = import('./foo.js'); diff --git a/test/function/samples/deprecated/dynamic-import-name/_config.js b/test/function/samples/deprecated/dynamic-import-name/_config.js deleted file mode 100644 index 123c660a5..000000000 --- a/test/function/samples/deprecated/dynamic-import-name/_config.js +++ /dev/null @@ -1,38 +0,0 @@ -const assert = require('node:assert'); -let imported = false; - -module.exports = defineTest({ - description: 'allows specifying a custom importer function', - context: { - myImporter(path) { - assert.equal(path, './foo.js'); - imported = true; - } - }, - options: { - strictDeprecations: false, - input: 'main.js', - plugins: [ - { - resolveDynamicImport() { - return false; - } - } - ], - output: { - dynamicImportFunction: 'myImporter', - format: 'es' - } - }, - exports() { - assert.ok(imported); - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.', - url: 'https://rollupjs.org/plugin-development/#renderdynamicimport' - } - ] -}); diff --git a/test/function/samples/deprecated/dynamic-import-name/main.js b/test/function/samples/deprecated/dynamic-import-name/main.js deleted file mode 100644 index bbe4a5cc2..000000000 --- a/test/function/samples/deprecated/dynamic-import-name/main.js +++ /dev/null @@ -1 +0,0 @@ -import('./foo.js'); diff --git a/test/function/samples/deprecated/inline-dynamic-imports-bundle/_config.js b/test/function/samples/deprecated/inline-dynamic-imports-bundle/_config.js deleted file mode 100644 index d62ae029e..000000000 --- a/test/function/samples/deprecated/inline-dynamic-imports-bundle/_config.js +++ /dev/null @@ -1,28 +0,0 @@ -const assert = require('node:assert'); -const path = require('node:path'); - -module.exports = defineTest({ - description: 'ignores non-bundled modules when inlining dynamic imports', - options: { - strictDeprecations: false, - inlineDynamicImports: true, - plugins: [ - { - generateBundle(options, bundle) { - assert.deepStrictEqual(Object.keys(bundle['main.js'].modules), [ - path.join(__dirname, 'lib.js'), - path.join(__dirname, 'main.js') - ]); - } - } - ] - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', - url: 'https://rollupjs.org/configuration-options/#output-inlinedynamicimports' - } - ] -}); diff --git a/test/function/samples/deprecated/inline-dynamic-imports-bundle/lib.js b/test/function/samples/deprecated/inline-dynamic-imports-bundle/lib.js deleted file mode 100644 index 9d7381d29..000000000 --- a/test/function/samples/deprecated/inline-dynamic-imports-bundle/lib.js +++ /dev/null @@ -1 +0,0 @@ -export const foo = 42; diff --git a/test/function/samples/deprecated/inline-dynamic-imports-bundle/main.js b/test/function/samples/deprecated/inline-dynamic-imports-bundle/main.js deleted file mode 100644 index 0bb1f9f4b..000000000 --- a/test/function/samples/deprecated/inline-dynamic-imports-bundle/main.js +++ /dev/null @@ -1 +0,0 @@ -export { foo } from './reexporter'; diff --git a/test/function/samples/deprecated/inline-dynamic-imports-bundle/reexporter.js b/test/function/samples/deprecated/inline-dynamic-imports-bundle/reexporter.js deleted file mode 100644 index 26a05cf13..000000000 --- a/test/function/samples/deprecated/inline-dynamic-imports-bundle/reexporter.js +++ /dev/null @@ -1 +0,0 @@ -export { foo } from './lib'; diff --git a/test/function/samples/deprecated/inline-imports-with-manual/_config.js b/test/function/samples/deprecated/inline-imports-with-manual/_config.js deleted file mode 100644 index b72dc7f5b..000000000 --- a/test/function/samples/deprecated/inline-imports-with-manual/_config.js +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = defineTest({ - description: 'Manual chunks are not supported when inlining dynamic imports', - options: { - strictDeprecations: false, - input: ['main.js'], - inlineDynamicImports: true, - manualChunks: { - lib: ['lib.js'] - } - }, - generateError: { - code: 'INVALID_OPTION', - message: - 'Invalid value for option "output.manualChunks" - this option is not supported for "output.inlineDynamicImports".', - url: 'https://rollupjs.org/configuration-options/#output-manualchunks' - }, - warnings: [] -}); diff --git a/test/function/samples/deprecated/inline-imports-with-manual/lib.js b/test/function/samples/deprecated/inline-imports-with-manual/lib.js deleted file mode 100644 index 46d3ca8c6..000000000 --- a/test/function/samples/deprecated/inline-imports-with-manual/lib.js +++ /dev/null @@ -1 +0,0 @@ -export const value = 42; diff --git a/test/function/samples/deprecated/inline-imports-with-manual/main.js b/test/function/samples/deprecated/inline-imports-with-manual/main.js deleted file mode 100644 index 4869dc82f..000000000 --- a/test/function/samples/deprecated/inline-imports-with-manual/main.js +++ /dev/null @@ -1 +0,0 @@ -import('./lib').then(({value}) => assert.equal(value, 42)); diff --git a/test/function/samples/deprecated/inline-imports-with-multiple-array/_config.js b/test/function/samples/deprecated/inline-imports-with-multiple-array/_config.js deleted file mode 100644 index 30eeb3b6e..000000000 --- a/test/function/samples/deprecated/inline-imports-with-multiple-array/_config.js +++ /dev/null @@ -1,15 +0,0 @@ -module.exports = defineTest({ - description: 'Having multiple inputs in an array is not supported when inlining dynamic imports', - options: { - strictDeprecations: false, - input: ['main.js', 'lib.js'], - inlineDynamicImports: true - }, - generateError: { - code: 'INVALID_OPTION', - message: - 'Invalid value for option "output.inlineDynamicImports" - multiple inputs are not supported when "output.inlineDynamicImports" is true.', - url: 'https://rollupjs.org/configuration-options/#output-inlinedynamicimports' - }, - warnings: [] -}); diff --git a/test/function/samples/deprecated/inline-imports-with-multiple-array/lib.js b/test/function/samples/deprecated/inline-imports-with-multiple-array/lib.js deleted file mode 100644 index 46d3ca8c6..000000000 --- a/test/function/samples/deprecated/inline-imports-with-multiple-array/lib.js +++ /dev/null @@ -1 +0,0 @@ -export const value = 42; diff --git a/test/function/samples/deprecated/inline-imports-with-multiple-array/main.js b/test/function/samples/deprecated/inline-imports-with-multiple-array/main.js deleted file mode 100644 index 4869dc82f..000000000 --- a/test/function/samples/deprecated/inline-imports-with-multiple-array/main.js +++ /dev/null @@ -1 +0,0 @@ -import('./lib').then(({value}) => assert.equal(value, 42)); diff --git a/test/function/samples/deprecated/inline-imports-with-multiple-object/_config.js b/test/function/samples/deprecated/inline-imports-with-multiple-object/_config.js deleted file mode 100644 index 65df9df7e..000000000 --- a/test/function/samples/deprecated/inline-imports-with-multiple-object/_config.js +++ /dev/null @@ -1,21 +0,0 @@ -module.exports = defineTest({ - description: 'Having multiple inputs in an object is not supported when inlining dynamic imports', - options: { - strictDeprecations: false, - input: { main: 'main.js', lib: 'lib.js' }, - inlineDynamicImports: true - }, - generateError: { - code: 'INVALID_OPTION', - message: - 'Invalid value for option "output.inlineDynamicImports" - multiple inputs are not supported when "output.inlineDynamicImports" is true.', - url: 'https://rollupjs.org/configuration-options/#output-inlinedynamicimports' - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.' - } - ] -}); diff --git a/test/function/samples/deprecated/inline-imports-with-multiple-object/lib.js b/test/function/samples/deprecated/inline-imports-with-multiple-object/lib.js deleted file mode 100644 index 46d3ca8c6..000000000 --- a/test/function/samples/deprecated/inline-imports-with-multiple-object/lib.js +++ /dev/null @@ -1 +0,0 @@ -export const value = 42; diff --git a/test/function/samples/deprecated/inline-imports-with-multiple-object/main.js b/test/function/samples/deprecated/inline-imports-with-multiple-object/main.js deleted file mode 100644 index 4869dc82f..000000000 --- a/test/function/samples/deprecated/inline-imports-with-multiple-object/main.js +++ /dev/null @@ -1 +0,0 @@ -import('./lib').then(({value}) => assert.equal(value, 42)); diff --git a/test/function/samples/deprecated/manual-chunks-conflict/_config.js b/test/function/samples/deprecated/manual-chunks-conflict/_config.js deleted file mode 100644 index 789f7339c..000000000 --- a/test/function/samples/deprecated/manual-chunks-conflict/_config.js +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = defineTest({ - description: 'Throws for conflicts between manual chunks', - options: { - strictDeprecations: false, - input: ['main.js'], - output: { - manualChunks: { - dep1: ['dep.js'], - dep2: ['dep.js'] - } - } - }, - generateError: { - code: 'INVALID_CHUNK', - message: 'Cannot assign "dep.js" to the "dep2" chunk as it is already in the "dep1" chunk.' - }, - warnings: [] -}); diff --git a/test/function/samples/deprecated/manual-chunks-conflict/dep.js b/test/function/samples/deprecated/manual-chunks-conflict/dep.js deleted file mode 100644 index b74a9837c..000000000 --- a/test/function/samples/deprecated/manual-chunks-conflict/dep.js +++ /dev/null @@ -1 +0,0 @@ -console.log('dep'); diff --git a/test/function/samples/deprecated/manual-chunks-conflict/main.js b/test/function/samples/deprecated/manual-chunks-conflict/main.js deleted file mode 100644 index d6cf3b024..000000000 --- a/test/function/samples/deprecated/manual-chunks-conflict/main.js +++ /dev/null @@ -1 +0,0 @@ -import './dep.js'; diff --git a/test/function/samples/deprecated/manual-chunks-info/_config.js b/test/function/samples/deprecated/manual-chunks-info/_config.js deleted file mode 100644 index 816969b70..000000000 --- a/test/function/samples/deprecated/manual-chunks-info/_config.js +++ /dev/null @@ -1,315 +0,0 @@ -const assert = require('node:assert'); -const path = require('node:path'); -const { getObject } = require('../../../../utils'); - -function getId(name) { - return path.join(__dirname, `${name}.js`); -} - -module.exports = defineTest({ - description: 'provides additional chunk information to a manualChunks function', - options: { - strictDeprecations: false, - external: 'external', - output: { - manualChunks(id, { getModuleIds, getModuleInfo }) { - assert.deepStrictEqual( - getObject( - [...getModuleIds()].map(id => [id, JSON.parse(JSON.stringify(getModuleInfo(id)))]) - ), - { - [getId('dynamic')]: { - id: getId('dynamic'), - attributes: {}, - ast: { - type: 'Program', - start: 0, - end: 88, - body: [ - { - type: 'ExportNamedDeclaration', - start: 0, - end: 42, - declaration: { - type: 'VariableDeclaration', - start: 7, - end: 42, - declarations: [ - { - type: 'VariableDeclarator', - start: 13, - end: 41, - id: { type: 'Identifier', start: 13, end: 20, name: 'promise' }, - init: { - type: 'ImportExpression', - start: 23, - end: 41, - source: { - type: 'Literal', - start: 30, - end: 40, - value: 'external', - raw: "'external'" - } - } - } - ], - kind: 'const' - }, - specifiers: [], - source: null - }, - { - type: 'ExportNamedDeclaration', - start: 43, - end: 87, - declaration: null, - specifiers: [ - { - type: 'ExportSpecifier', - start: 52, - end: 71, - local: { type: 'Identifier', start: 52, end: 59, name: 'default' }, - exported: { type: 'Identifier', start: 63, end: 71, name: 'internal' } - } - ], - source: { type: 'Literal', start: 79, end: 86, value: './lib', raw: "'./lib'" } - } - ], - sourceType: 'module' - }, - code: "export const promise = import('external');\nexport { default as internal } from './lib';\n", - dynamicallyImportedIdResolutions: [ - { - attributes: {}, - external: true, - id: 'external', - meta: {}, - moduleSideEffects: true, - resolvedBy: 'rollup', - syntheticNamedExports: false - } - ], - dynamicallyImportedIds: ['external'], - dynamicImporters: [getId('main')], - exports: ['promise', 'internal'], - exportedBindings: { '.': ['promise'], './lib': ['internal'] }, - hasDefaultExport: false, - moduleSideEffects: true, - implicitlyLoadedAfterOneOf: [], - implicitlyLoadedBefore: [], - importedIdResolutions: [ - { - attributes: {}, - external: false, - id: getId('lib'), - meta: {}, - moduleSideEffects: true, - resolvedBy: 'rollup', - syntheticNamedExports: false - } - ], - importedIds: [getId('lib')], - importers: [], - isEntry: false, - isExternal: false, - isIncluded: true, - meta: {}, - syntheticNamedExports: false - }, - [getId('lib')]: { - id: getId('lib'), - attributes: {}, - ast: { - type: 'Program', - start: 0, - end: 19, - body: [ - { - type: 'ExportDefaultDeclaration', - start: 0, - end: 18, - declaration: { type: 'Literal', start: 15, end: 17, value: 42, raw: '42' } - } - ], - sourceType: 'module' - }, - code: 'export default 42;\n', - dynamicallyImportedIdResolutions: [], - dynamicallyImportedIds: [], - dynamicImporters: [], - exportedBindings: { '.': ['default'] }, - exports: ['default'], - hasDefaultExport: true, - moduleSideEffects: true, - implicitlyLoadedAfterOneOf: [], - implicitlyLoadedBefore: [], - importedIdResolutions: [], - importedIds: [], - importers: [getId('dynamic'), getId('main')], - isEntry: false, - isExternal: false, - isIncluded: true, - meta: {}, - syntheticNamedExports: false - }, - [getId('main')]: { - id: getId('main'), - attributes: {}, - ast: { - type: 'Program', - start: 0, - end: 123, - body: [ - { - type: 'ExportNamedDeclaration', - start: 0, - end: 43, - declaration: { - type: 'VariableDeclaration', - start: 7, - end: 43, - declarations: [ - { - type: 'VariableDeclarator', - start: 13, - end: 42, - id: { type: 'Identifier', start: 13, end: 20, name: 'promise' }, - init: { - type: 'ImportExpression', - start: 23, - end: 42, - source: { - type: 'Literal', - start: 30, - end: 41, - value: './dynamic', - raw: "'./dynamic'" - } - } - } - ], - kind: 'const' - }, - specifiers: [], - source: null - }, - { - type: 'ExportNamedDeclaration', - start: 44, - end: 85, - declaration: null, - specifiers: [ - { - type: 'ExportSpecifier', - start: 53, - end: 69, - local: { type: 'Identifier', start: 53, end: 60, name: 'default' }, - exported: { type: 'Identifier', start: 64, end: 69, name: 'value' } - } - ], - source: { type: 'Literal', start: 77, end: 84, value: './lib', raw: "'./lib'" } - }, - { - type: 'ExportNamedDeclaration', - start: 86, - end: 122, - declaration: null, - specifiers: [ - { - type: 'ExportSpecifier', - start: 95, - end: 103, - local: { type: 'Identifier', start: 95, end: 103, name: 'external' }, - exported: { type: 'Identifier', start: 95, end: 103, name: 'external' } - } - ], - source: { - type: 'Literal', - start: 111, - end: 121, - value: 'external', - raw: "'external'" - } - } - ], - sourceType: 'module' - }, - code: "export const promise = import('./dynamic');\nexport { default as value } from './lib';\nexport { external } from 'external';\n", - dynamicallyImportedIdResolutions: [ - { - attributes: {}, - external: false, - id: getId('dynamic'), - meta: {}, - moduleSideEffects: true, - resolvedBy: 'rollup', - syntheticNamedExports: false - } - ], - dynamicallyImportedIds: [getId('dynamic')], - dynamicImporters: [], - exportedBindings: { '.': ['promise'], './lib': ['value'], external: ['external'] }, - exports: ['promise', 'value', 'external'], - hasDefaultExport: false, - moduleSideEffects: true, - implicitlyLoadedAfterOneOf: [], - implicitlyLoadedBefore: [], - importedIdResolutions: [ - { - attributes: {}, - external: false, - id: getId('lib'), - meta: {}, - moduleSideEffects: true, - resolvedBy: 'rollup', - syntheticNamedExports: false - }, - { - attributes: {}, - external: true, - id: 'external', - meta: {}, - moduleSideEffects: true, - resolvedBy: 'rollup', - syntheticNamedExports: false - } - ], - importedIds: [getId('lib'), 'external'], - importers: [], - isEntry: true, - isExternal: false, - isIncluded: true, - meta: {}, - syntheticNamedExports: false - }, - external: { - id: 'external', - attributes: {}, - ast: null, - code: null, - dynamicallyImportedIdResolutions: [], - dynamicallyImportedIds: [], - dynamicImporters: [getId('dynamic')], - exportedBindings: null, - exports: null, - hasDefaultExport: null, - moduleSideEffects: true, - implicitlyLoadedAfterOneOf: [], - implicitlyLoadedBefore: [], - importedIdResolutions: [], - importedIds: [], - importers: [getId('main')], - isEntry: false, - isExternal: true, - isIncluded: null, - meta: {}, - syntheticNamedExports: false - } - } - ); - } - } - }, - warnings: [] -}); diff --git a/test/function/samples/deprecated/manual-chunks-info/dynamic.js b/test/function/samples/deprecated/manual-chunks-info/dynamic.js deleted file mode 100644 index 2d2ab6f35..000000000 --- a/test/function/samples/deprecated/manual-chunks-info/dynamic.js +++ /dev/null @@ -1,2 +0,0 @@ -export const promise = import('external'); -export { default as internal } from './lib'; diff --git a/test/function/samples/deprecated/manual-chunks-info/lib.js b/test/function/samples/deprecated/manual-chunks-info/lib.js deleted file mode 100644 index 7a4e8a723..000000000 --- a/test/function/samples/deprecated/manual-chunks-info/lib.js +++ /dev/null @@ -1 +0,0 @@ -export default 42; diff --git a/test/function/samples/deprecated/manual-chunks-info/main.js b/test/function/samples/deprecated/manual-chunks-info/main.js deleted file mode 100644 index c79c2fe09..000000000 --- a/test/function/samples/deprecated/manual-chunks-info/main.js +++ /dev/null @@ -1,3 +0,0 @@ -export const promise = import('./dynamic'); -export { default as value } from './lib'; -export { external } from 'external'; diff --git a/test/function/samples/deprecated/manual-chunks-preserve-modules/_config.js b/test/function/samples/deprecated/manual-chunks-preserve-modules/_config.js deleted file mode 100644 index 1afbdff0e..000000000 --- a/test/function/samples/deprecated/manual-chunks-preserve-modules/_config.js +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = defineTest({ - description: 'Assigning manual chunks fails when preserving modules', - options: { - strictDeprecations: false, - input: ['main.js'], - preserveModules: true, - manualChunks: { - lib: ['lib.js'] - } - }, - generateError: { - code: 'INVALID_OPTION', - message: - 'Invalid value for option "output.manualChunks" - this option is not supported for "output.preserveModules".', - url: 'https://rollupjs.org/configuration-options/#output-manualchunks' - }, - warnings: [] -}); diff --git a/test/function/samples/deprecated/manual-chunks-preserve-modules/lib.js b/test/function/samples/deprecated/manual-chunks-preserve-modules/lib.js deleted file mode 100644 index 46d3ca8c6..000000000 --- a/test/function/samples/deprecated/manual-chunks-preserve-modules/lib.js +++ /dev/null @@ -1 +0,0 @@ -export const value = 42; diff --git a/test/function/samples/deprecated/manual-chunks-preserve-modules/main.js b/test/function/samples/deprecated/manual-chunks-preserve-modules/main.js deleted file mode 100644 index 0786352d0..000000000 --- a/test/function/samples/deprecated/manual-chunks-preserve-modules/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import { value } from './lib'; - -assert.equal(value, 42); diff --git a/test/function/samples/deprecated/max-parallel-file-reads/infinity/1.js b/test/function/samples/deprecated/max-parallel-file-reads/infinity/1.js deleted file mode 100644 index 877dd1fbb..000000000 --- a/test/function/samples/deprecated/max-parallel-file-reads/infinity/1.js +++ /dev/null @@ -1 +0,0 @@ -export const x1 = 1; diff --git a/test/function/samples/deprecated/max-parallel-file-reads/infinity/2.js b/test/function/samples/deprecated/max-parallel-file-reads/infinity/2.js deleted file mode 100644 index c269ae0d2..000000000 --- a/test/function/samples/deprecated/max-parallel-file-reads/infinity/2.js +++ /dev/null @@ -1 +0,0 @@ -export const x2 = 2; diff --git a/test/function/samples/deprecated/max-parallel-file-reads/infinity/3.js b/test/function/samples/deprecated/max-parallel-file-reads/infinity/3.js deleted file mode 100644 index 1c3235399..000000000 --- a/test/function/samples/deprecated/max-parallel-file-reads/infinity/3.js +++ /dev/null @@ -1 +0,0 @@ -export const x3 = 3; diff --git a/test/function/samples/deprecated/max-parallel-file-reads/infinity/4.js b/test/function/samples/deprecated/max-parallel-file-reads/infinity/4.js deleted file mode 100644 index 1b01b419a..000000000 --- a/test/function/samples/deprecated/max-parallel-file-reads/infinity/4.js +++ /dev/null @@ -1 +0,0 @@ -export const x4 = 4; diff --git a/test/function/samples/deprecated/max-parallel-file-reads/infinity/5.js b/test/function/samples/deprecated/max-parallel-file-reads/infinity/5.js deleted file mode 100644 index 734bf3f6f..000000000 --- a/test/function/samples/deprecated/max-parallel-file-reads/infinity/5.js +++ /dev/null @@ -1 +0,0 @@ -export const x5 = 5; diff --git a/test/function/samples/deprecated/max-parallel-file-reads/infinity/_config.js b/test/function/samples/deprecated/max-parallel-file-reads/infinity/_config.js deleted file mode 100644 index 8f9700cf2..000000000 --- a/test/function/samples/deprecated/max-parallel-file-reads/infinity/_config.js +++ /dev/null @@ -1,37 +0,0 @@ -const assert = require('node:assert'); -const { promises: fs } = require('node:fs'); -const { wait } = require('../../../../../utils'); - -const fsReadFile = fs.readFile; -let currentReads = 0; -let maxReads = 0; - -module.exports = defineTest({ - description: 'maxParallelFileReads set to infinity', - options: { - strictDeprecations: false, - maxParallelFileReads: 0 - }, - before() { - fs.readFile = async (path, options) => { - currentReads++; - maxReads = Math.max(maxReads, currentReads); - const content = await fsReadFile(path, options); - await wait(50); - currentReads--; - return content; - }; - }, - after() { - fs.readFile = fsReadFile; - assert.strictEqual(maxReads, 5, 'Wrong number of parallel file reads: ' + maxReads); - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.', - url: 'https://rollupjs.org/configuration-options/#maxparallelfileops' - } - ] -}); diff --git a/test/function/samples/deprecated/max-parallel-file-reads/infinity/main.js b/test/function/samples/deprecated/max-parallel-file-reads/infinity/main.js deleted file mode 100644 index 5f0a705e4..000000000 --- a/test/function/samples/deprecated/max-parallel-file-reads/infinity/main.js +++ /dev/null @@ -1,5 +0,0 @@ -export * from './1'; -export * from './2'; -export * from './3'; -export * from './4'; -export * from './5'; diff --git a/test/function/samples/deprecated/max-parallel-file-reads/set/1.js b/test/function/samples/deprecated/max-parallel-file-reads/set/1.js deleted file mode 100644 index 877dd1fbb..000000000 --- a/test/function/samples/deprecated/max-parallel-file-reads/set/1.js +++ /dev/null @@ -1 +0,0 @@ -export const x1 = 1; diff --git a/test/function/samples/deprecated/max-parallel-file-reads/set/2.js b/test/function/samples/deprecated/max-parallel-file-reads/set/2.js deleted file mode 100644 index c269ae0d2..000000000 --- a/test/function/samples/deprecated/max-parallel-file-reads/set/2.js +++ /dev/null @@ -1 +0,0 @@ -export const x2 = 2; diff --git a/test/function/samples/deprecated/max-parallel-file-reads/set/3.js b/test/function/samples/deprecated/max-parallel-file-reads/set/3.js deleted file mode 100644 index 1c3235399..000000000 --- a/test/function/samples/deprecated/max-parallel-file-reads/set/3.js +++ /dev/null @@ -1 +0,0 @@ -export const x3 = 3; diff --git a/test/function/samples/deprecated/max-parallel-file-reads/set/4.js b/test/function/samples/deprecated/max-parallel-file-reads/set/4.js deleted file mode 100644 index 1b01b419a..000000000 --- a/test/function/samples/deprecated/max-parallel-file-reads/set/4.js +++ /dev/null @@ -1 +0,0 @@ -export const x4 = 4; diff --git a/test/function/samples/deprecated/max-parallel-file-reads/set/5.js b/test/function/samples/deprecated/max-parallel-file-reads/set/5.js deleted file mode 100644 index 734bf3f6f..000000000 --- a/test/function/samples/deprecated/max-parallel-file-reads/set/5.js +++ /dev/null @@ -1 +0,0 @@ -export const x5 = 5; diff --git a/test/function/samples/deprecated/max-parallel-file-reads/set/_config.js b/test/function/samples/deprecated/max-parallel-file-reads/set/_config.js deleted file mode 100644 index 4f9d4e77b..000000000 --- a/test/function/samples/deprecated/max-parallel-file-reads/set/_config.js +++ /dev/null @@ -1,37 +0,0 @@ -const assert = require('node:assert'); -const { promises: fs } = require('node:fs'); -const { wait } = require('../../../../../utils'); - -const fsReadFile = fs.readFile; -let currentReads = 0; -let maxReads = 0; - -module.exports = defineTest({ - description: 'maxParallelFileReads set to 3', - options: { - strictDeprecations: false, - maxParallelFileReads: 3 - }, - before() { - fs.readFile = async (path, options) => { - currentReads++; - maxReads = Math.max(maxReads, currentReads); - const content = await fsReadFile(path, options); - await wait(50); - currentReads--; - return content; - }; - }, - after() { - fs.readFile = fsReadFile; - assert.strictEqual(maxReads, 3, 'Wrong number of parallel file reads: ' + maxReads); - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.', - url: 'https://rollupjs.org/configuration-options/#maxparallelfileops' - } - ] -}); diff --git a/test/function/samples/deprecated/max-parallel-file-reads/set/main.js b/test/function/samples/deprecated/max-parallel-file-reads/set/main.js deleted file mode 100644 index 5f0a705e4..000000000 --- a/test/function/samples/deprecated/max-parallel-file-reads/set/main.js +++ /dev/null @@ -1,5 +0,0 @@ -export * from './1'; -export * from './2'; -export * from './3'; -export * from './4'; -export * from './5'; diff --git a/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/1.js b/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/1.js deleted file mode 100644 index 877dd1fbb..000000000 --- a/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/1.js +++ /dev/null @@ -1 +0,0 @@ -export const x1 = 1; diff --git a/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/2.js b/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/2.js deleted file mode 100644 index c269ae0d2..000000000 --- a/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/2.js +++ /dev/null @@ -1 +0,0 @@ -export const x2 = 2; diff --git a/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/3.js b/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/3.js deleted file mode 100644 index 1c3235399..000000000 --- a/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/3.js +++ /dev/null @@ -1 +0,0 @@ -export const x3 = 3; diff --git a/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/4.js b/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/4.js deleted file mode 100644 index 1b01b419a..000000000 --- a/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/4.js +++ /dev/null @@ -1 +0,0 @@ -export const x4 = 4; diff --git a/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/5.js b/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/5.js deleted file mode 100644 index 734bf3f6f..000000000 --- a/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/5.js +++ /dev/null @@ -1 +0,0 @@ -export const x5 = 5; diff --git a/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/_config.js b/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/_config.js deleted file mode 100644 index b16cd3bf5..000000000 --- a/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/_config.js +++ /dev/null @@ -1,44 +0,0 @@ -const assert = require('node:assert'); -const { promises: fs } = require('node:fs'); -const { wait } = require('../../../../../utils'); - -const fsReadFile = fs.readFile; -let currentReads = 0; -let maxReads = 0; - -module.exports = defineTest({ - description: 'maxParallelFileReads with plugin', - options: { - strictDeprecations: false, - maxParallelFileReads: 3, - plugins: [ - { - load(id) { - return fs.readFile(id, 'utf8'); - } - } - ] - }, - before() { - fs.readFile = async (path, options) => { - currentReads++; - maxReads = Math.max(maxReads, currentReads); - const content = await fsReadFile(path, options); - await wait(50); - currentReads--; - return content; - }; - }, - after() { - fs.readFile = fsReadFile; - assert.strictEqual(maxReads, 3, 'Wrong number of parallel file reads: ' + maxReads); - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.', - url: 'https://rollupjs.org/configuration-options/#maxparallelfileops' - } - ] -}); diff --git a/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/main.js b/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/main.js deleted file mode 100644 index 5f0a705e4..000000000 --- a/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/main.js +++ /dev/null @@ -1,5 +0,0 @@ -export * from './1'; -export * from './2'; -export * from './3'; -export * from './4'; -export * from './5'; diff --git a/test/function/samples/deprecated/name-conflict-symbol/_config.js b/test/function/samples/deprecated/name-conflict-symbol/_config.js deleted file mode 100644 index e13f395ce..000000000 --- a/test/function/samples/deprecated/name-conflict-symbol/_config.js +++ /dev/null @@ -1,23 +0,0 @@ -const assert = require('node:assert'); - -module.exports = defineTest({ - description: 'avoids name conflicts with local variables named Symbol', - options: { - strictDeprecations: false, - output: { - namespaceToStringTag: true - } - }, - exports(exports) { - assert.strictEqual(exports.Symbol, null); - assert.strictEqual(exports.toString(), '[object Module]'); - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.', - url: 'https://rollupjs.org/configuration-options/#output-generatedcode-symbols' - } - ] -}); diff --git a/test/function/samples/deprecated/name-conflict-symbol/main.js b/test/function/samples/deprecated/name-conflict-symbol/main.js deleted file mode 100644 index 6b55d36f1..000000000 --- a/test/function/samples/deprecated/name-conflict-symbol/main.js +++ /dev/null @@ -1 +0,0 @@ -export const Symbol = null; diff --git a/test/function/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_config.js b/test/function/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_config.js deleted file mode 100644 index fdcc36cfa..000000000 --- a/test/function/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_config.js +++ /dev/null @@ -1,27 +0,0 @@ -const assert = require('node:assert'); - -module.exports = defineTest({ - description: - 'adds Symbol.toStringTag property to dynamic imports of entry chunks with default export mode', - options: { - strictDeprecations: false, - input: ['main', 'foo'], - output: { - namespaceToStringTag: true - } - }, - async exports(exports) { - const foo = await exports; - assert.strictEqual(foo[Symbol.toStringTag], 'Module'); - assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); - assert.strictEqual(foo.default, 42); - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.', - url: 'https://rollupjs.org/configuration-options/#output-generatedcode-symbols' - } - ] -}); diff --git a/test/function/samples/deprecated/namespace-tostring/dynamic-import-default-mode/foo.js b/test/function/samples/deprecated/namespace-tostring/dynamic-import-default-mode/foo.js deleted file mode 100644 index 7a4e8a723..000000000 --- a/test/function/samples/deprecated/namespace-tostring/dynamic-import-default-mode/foo.js +++ /dev/null @@ -1 +0,0 @@ -export default 42; diff --git a/test/function/samples/deprecated/namespace-tostring/dynamic-import-default-mode/main.js b/test/function/samples/deprecated/namespace-tostring/dynamic-import-default-mode/main.js deleted file mode 100644 index 88023eaa2..000000000 --- a/test/function/samples/deprecated/namespace-tostring/dynamic-import-default-mode/main.js +++ /dev/null @@ -1 +0,0 @@ -export default import('./foo'); diff --git a/test/function/samples/deprecated/namespace-tostring/dynamic-import/_config.js b/test/function/samples/deprecated/namespace-tostring/dynamic-import/_config.js deleted file mode 100644 index a7672c3e1..000000000 --- a/test/function/samples/deprecated/namespace-tostring/dynamic-import/_config.js +++ /dev/null @@ -1,30 +0,0 @@ -const assert = require('node:assert'); - -module.exports = defineTest({ - description: 'adds Symbol.toStringTag property to dynamic imports', - options: { - strictDeprecations: false, - output: { - namespaceToStringTag: true - } - }, - async exports(exports) { - const namespace = await exports; - assert.strictEqual(Object.prototype.toString.call(namespace), '[object Module]'); - assert.strictEqual(namespace[Symbol.toStringTag], 'Module'); - assert.strictEqual(namespace.bar, 42); - - const copied = { ...namespace }; - assert.deepStrictEqual(copied, { bar: 42 }); - assert.strictEqual(Object.prototype.toString.call(copied), '[object Object]'); - assert.strictEqual(copied[Symbol.toStringTag], undefined); - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.', - url: 'https://rollupjs.org/configuration-options/#output-generatedcode-symbols' - } - ] -}); diff --git a/test/function/samples/deprecated/namespace-tostring/dynamic-import/foo.js b/test/function/samples/deprecated/namespace-tostring/dynamic-import/foo.js deleted file mode 100644 index 308e102fe..000000000 --- a/test/function/samples/deprecated/namespace-tostring/dynamic-import/foo.js +++ /dev/null @@ -1 +0,0 @@ -export const bar = 42; diff --git a/test/function/samples/deprecated/namespace-tostring/dynamic-import/main.js b/test/function/samples/deprecated/namespace-tostring/dynamic-import/main.js deleted file mode 100644 index 88023eaa2..000000000 --- a/test/function/samples/deprecated/namespace-tostring/dynamic-import/main.js +++ /dev/null @@ -1 +0,0 @@ -export default import('./foo'); diff --git a/test/function/samples/deprecated/namespace-tostring/entry-default/_config.js b/test/function/samples/deprecated/namespace-tostring/entry-default/_config.js deleted file mode 100644 index bed1e2e5b..000000000 --- a/test/function/samples/deprecated/namespace-tostring/entry-default/_config.js +++ /dev/null @@ -1,25 +0,0 @@ -const assert = require('node:assert'); - -module.exports = defineTest({ - description: 'does not add Symbol.toStringTag property to entry chunks with default export mode', - options: { - strictDeprecations: false, - output: { - namespaceToStringTag: true, - exports: 'default' - } - }, - exports(exports) { - assert.strictEqual(exports[Symbol.toStringTag], undefined); - assert.strictEqual(Object.prototype.toString.call(exports), '[object Object]'); - assert.strictEqual(exports.foo, 42); - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.', - url: 'https://rollupjs.org/configuration-options/#output-generatedcode-symbols' - } - ] -}); diff --git a/test/function/samples/deprecated/namespace-tostring/entry-default/main.js b/test/function/samples/deprecated/namespace-tostring/entry-default/main.js deleted file mode 100644 index 407b3c24e..000000000 --- a/test/function/samples/deprecated/namespace-tostring/entry-default/main.js +++ /dev/null @@ -1 +0,0 @@ -export default { foo: 42 }; diff --git a/test/function/samples/deprecated/namespace-tostring/entry-named/_config.js b/test/function/samples/deprecated/namespace-tostring/entry-named/_config.js deleted file mode 100644 index 80242f61d..000000000 --- a/test/function/samples/deprecated/namespace-tostring/entry-named/_config.js +++ /dev/null @@ -1,30 +0,0 @@ -const assert = require('node:assert'); - -module.exports = defineTest({ - description: 'adds Symbol.toStringTag property to entry chunks with named exports', - options: { - strictDeprecations: false, - output: { - namespaceToStringTag: true, - exports: 'named' - } - }, - exports(exports) { - assert.strictEqual(Object.prototype.toString.call(exports), '[object Module]'); - assert.strictEqual(exports[Symbol.toStringTag], 'Module'); - assert.strictEqual(exports.foo, 42); - - const copied = { ...exports }; - assert.deepStrictEqual(copied, { foo: 42 }); - assert.strictEqual(Object.prototype.toString.call(copied), '[object Object]'); - assert.strictEqual(copied[Symbol.toStringTag], undefined); - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.', - url: 'https://rollupjs.org/configuration-options/#output-generatedcode-symbols' - } - ] -}); diff --git a/test/function/samples/deprecated/namespace-tostring/entry-named/main.js b/test/function/samples/deprecated/namespace-tostring/entry-named/main.js deleted file mode 100644 index 9d7381d29..000000000 --- a/test/function/samples/deprecated/namespace-tostring/entry-named/main.js +++ /dev/null @@ -1 +0,0 @@ -export const foo = 42; diff --git a/test/function/samples/deprecated/namespace-tostring/external-namespaces/_config.js b/test/function/samples/deprecated/namespace-tostring/external-namespaces/_config.js deleted file mode 100644 index f5f42bc9b..000000000 --- a/test/function/samples/deprecated/namespace-tostring/external-namespaces/_config.js +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = defineTest({ - description: 'adds Symbol.toStringTag property to external namespaces', - options: { - strictDeprecations: false, - external(id) { - return id.startsWith('external'); - }, - output: { - namespaceToStringTag: true, - interop(id) { - switch (id) { - case 'external-auto': { - return 'auto'; - } - case 'external-default': { - return 'default'; - } - case 'external-defaultOnly': { - return 'defaultOnly'; - } - default: { - throw new Error(`Unexpected require "${id}"`); - } - } - } - } - }, - context: { - require() { - return { foo: 42 }; - } - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.', - url: 'https://rollupjs.org/configuration-options/#output-generatedcode-symbols' - } - ] -}); diff --git a/test/function/samples/deprecated/namespace-tostring/external-namespaces/main.js b/test/function/samples/deprecated/namespace-tostring/external-namespaces/main.js deleted file mode 100644 index 978de6a2c..000000000 --- a/test/function/samples/deprecated/namespace-tostring/external-namespaces/main.js +++ /dev/null @@ -1,15 +0,0 @@ -import * as externalAuto from 'external-auto'; -import * as externalDefault from 'external-default'; -import * as externalDefaultOnly from 'external-defaultOnly'; - -assert.strictEqual(externalAuto[Symbol.toStringTag], 'Module'); -assert.strictEqual(Object.prototype.toString.call(externalAuto), '[object Module]'); -assert.strictEqual(externalAuto.foo, 42); - -assert.strictEqual(externalDefault[Symbol.toStringTag], 'Module'); -assert.strictEqual(Object.prototype.toString.call(externalDefault), '[object Module]'); -assert.strictEqual(externalDefault.foo, 42); - -assert.strictEqual(externalDefaultOnly[Symbol.toStringTag], 'Module'); -assert.strictEqual(Object.prototype.toString.call(externalDefaultOnly), '[object Module]'); -assert.deepStrictEqual(externalDefaultOnly.default, { foo: 42 }); diff --git a/test/function/samples/deprecated/namespace-tostring/inlined-namespace/_config.js b/test/function/samples/deprecated/namespace-tostring/inlined-namespace/_config.js deleted file mode 100644 index b13c2840c..000000000 --- a/test/function/samples/deprecated/namespace-tostring/inlined-namespace/_config.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = defineTest({ - description: 'adds Symbol.toStringTag property to inlined namespaces', - options: { - strictDeprecations: false, - output: { - namespaceToStringTag: true - } - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.', - url: 'https://rollupjs.org/configuration-options/#output-generatedcode-symbols' - } - ] -}); diff --git a/test/function/samples/deprecated/namespace-tostring/inlined-namespace/foo.js b/test/function/samples/deprecated/namespace-tostring/inlined-namespace/foo.js deleted file mode 100644 index 308e102fe..000000000 --- a/test/function/samples/deprecated/namespace-tostring/inlined-namespace/foo.js +++ /dev/null @@ -1 +0,0 @@ -export const bar = 42; diff --git a/test/function/samples/deprecated/namespace-tostring/inlined-namespace/main.js b/test/function/samples/deprecated/namespace-tostring/inlined-namespace/main.js deleted file mode 100644 index fb6b24345..000000000 --- a/test/function/samples/deprecated/namespace-tostring/inlined-namespace/main.js +++ /dev/null @@ -1,5 +0,0 @@ -import * as foo from './foo'; - -assert.strictEqual(foo[Symbol.toStringTag], 'Module'); -assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); -assert.strictEqual(foo.bar, 42); diff --git a/test/function/samples/deprecated/namespace-tostring/interop-property-descriptor/_config.js b/test/function/samples/deprecated/namespace-tostring/interop-property-descriptor/_config.js deleted file mode 100644 index 56a9227ac..000000000 --- a/test/function/samples/deprecated/namespace-tostring/interop-property-descriptor/_config.js +++ /dev/null @@ -1,28 +0,0 @@ -module.exports = defineTest({ - description: 'generated interop namespaces should have correct Symbol.toStringTag', - context: { - require() { - return { answer: 42 }; - } - }, - options: { - strictDeprecations: false, - external(id) { - return id.includes('external'); - }, - output: { - namespaceToStringTag: true, - interop(id) { - return id.split('-')[1]; - } - } - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.', - url: 'https://rollupjs.org/configuration-options/#output-generatedcode-symbols' - } - ] -}); diff --git a/test/function/samples/deprecated/namespace-tostring/interop-property-descriptor/dep.js b/test/function/samples/deprecated/namespace-tostring/interop-property-descriptor/dep.js deleted file mode 100644 index 123aa5a11..000000000 --- a/test/function/samples/deprecated/namespace-tostring/interop-property-descriptor/dep.js +++ /dev/null @@ -1,2 +0,0 @@ -export * from 'external-default'; -export const extra = 'extra'; diff --git a/test/function/samples/deprecated/namespace-tostring/interop-property-descriptor/main.js b/test/function/samples/deprecated/namespace-tostring/interop-property-descriptor/main.js deleted file mode 100644 index 7240b9002..000000000 --- a/test/function/samples/deprecated/namespace-tostring/interop-property-descriptor/main.js +++ /dev/null @@ -1,25 +0,0 @@ -import * as nsDefault from 'external-default'; -import * as nsDefaultOnly from 'external-defaultOnly'; -import * as nsMerged from './dep.js'; - -function verifyNamespace(ns, expected) { - assert.deepStrictEqual(Object.getOwnPropertyDescriptor(ns, Symbol.toStringTag), { - value: 'Module', - configurable: false, - enumerable: false, - writable: false - }); - - const assigned = Object.assign({}, ns); - const spreaded = { ...ns }; - - assert.deepStrictEqual(assigned, expected); - assert.strictEqual(assigned[Symbol.toStringTag], undefined); - - assert.deepStrictEqual(spreaded, expected); - assert.strictEqual(spreaded[Symbol.toStringTag], undefined); -} - -verifyNamespace(nsDefault, { answer: 42, default: { answer: 42 } }); -verifyNamespace(nsDefaultOnly, { default: { answer: 42 } }); -verifyNamespace(nsMerged, { answer: 42, extra: 'extra' }); diff --git a/test/function/samples/deprecated/namespace-tostring/property-descriptor/_config.js b/test/function/samples/deprecated/namespace-tostring/property-descriptor/_config.js deleted file mode 100644 index c0a08b6ee..000000000 --- a/test/function/samples/deprecated/namespace-tostring/property-descriptor/_config.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = defineTest({ - description: 'namespace export should have @@toStringTag with correct property descriptors #4336', - options: { - strictDeprecations: false, - output: { - namespaceToStringTag: true - } - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.', - url: 'https://rollupjs.org/configuration-options/#output-generatedcode-symbols' - } - ] -}); diff --git a/test/function/samples/deprecated/namespace-tostring/property-descriptor/foo.js b/test/function/samples/deprecated/namespace-tostring/property-descriptor/foo.js deleted file mode 100644 index c155820bf..000000000 --- a/test/function/samples/deprecated/namespace-tostring/property-descriptor/foo.js +++ /dev/null @@ -1 +0,0 @@ -export const foo = 'bar'; diff --git a/test/function/samples/deprecated/namespace-tostring/property-descriptor/main.js b/test/function/samples/deprecated/namespace-tostring/property-descriptor/main.js deleted file mode 100644 index 2743d20a1..000000000 --- a/test/function/samples/deprecated/namespace-tostring/property-descriptor/main.js +++ /dev/null @@ -1,22 +0,0 @@ -import * as ns from './foo.js'; - -const { assign, getOwnPropertyDescriptor } = Object; - -const { configurable, enumerable, value, writable } = getOwnPropertyDescriptor( - ns, - Symbol.toStringTag -); - -assert.strictEqual(value, 'Module', 'value'); -assert.strictEqual(configurable, false, 'configurable'); -assert.strictEqual(enumerable, false, 'enumerable'); -assert.strictEqual(writable, false, 'writable'); - -const a = assign({}, ns); -const b = { ...ns }; - -assert.deepStrictEqual(a, { foo: 'bar' }); -assert.strictEqual(a[Symbol.toStringTag], undefined); - -assert.deepStrictEqual(b, { foo: 'bar' }); -assert.strictEqual(b[Symbol.toStringTag], undefined); diff --git a/test/function/samples/deprecated/nested-inlined-dynamic-import-1/_config.js b/test/function/samples/deprecated/nested-inlined-dynamic-import-1/_config.js deleted file mode 100644 index 8d567dff2..000000000 --- a/test/function/samples/deprecated/nested-inlined-dynamic-import-1/_config.js +++ /dev/null @@ -1,21 +0,0 @@ -const assert = require('node:assert'); - -module.exports = defineTest({ - description: - 'deconflicts variables when nested dynamic imports are inlined via inlineDynamicImports', - options: { - strictDeprecations: false, - inlineDynamicImports: true - }, - exports(exports) { - return exports().then(result => assert.strictEqual(result, 43)); - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', - url: 'https://rollupjs.org/configuration-options/#output-inlinedynamicimports' - } - ] -}); diff --git a/test/function/samples/deprecated/nested-inlined-dynamic-import-1/foo.js b/test/function/samples/deprecated/nested-inlined-dynamic-import-1/foo.js deleted file mode 100644 index 46d3ca8c6..000000000 --- a/test/function/samples/deprecated/nested-inlined-dynamic-import-1/foo.js +++ /dev/null @@ -1 +0,0 @@ -export const value = 42; diff --git a/test/function/samples/deprecated/nested-inlined-dynamic-import-1/main.js b/test/function/samples/deprecated/nested-inlined-dynamic-import-1/main.js deleted file mode 100644 index 24dfcc33b..000000000 --- a/test/function/samples/deprecated/nested-inlined-dynamic-import-1/main.js +++ /dev/null @@ -1,4 +0,0 @@ -export default () => { - const foo = 1; - return import('./foo.js').then(ns => ns.value + foo); -}; diff --git a/test/function/samples/deprecated/plugin-module-ids/_config.js b/test/function/samples/deprecated/plugin-module-ids/_config.js deleted file mode 100644 index 576b77cc4..000000000 --- a/test/function/samples/deprecated/plugin-module-ids/_config.js +++ /dev/null @@ -1,36 +0,0 @@ -const assert = require('node:assert'); -const path = require('node:path'); - -let rendered = false; - -module.exports = defineTest({ - description: 'provides all module ids on the plugin context', - options: { - strictDeprecations: false, - external: ['path'], - plugins: [ - { - renderStart() { - rendered = true; - assert.deepStrictEqual([...this.moduleIds].sort(), [ - path.join(__dirname, 'foo.js'), - path.join(__dirname, 'main.js'), - 'path' - ]); - } - } - ] - }, - bundle() { - assert.ok(rendered); - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'Accessing "this.moduleIds" on the plugin context by plugin at position 1 is deprecated. The "this.getModuleIds" plugin context function should be used instead.', - plugin: 'at position 1', - url: 'https://rollupjs.org/plugin-development/#this-getmoduleids' - } - ] -}); diff --git a/test/function/samples/deprecated/plugin-module-ids/foo.js b/test/function/samples/deprecated/plugin-module-ids/foo.js deleted file mode 100644 index cb4875a0a..000000000 --- a/test/function/samples/deprecated/plugin-module-ids/foo.js +++ /dev/null @@ -1,3 +0,0 @@ -import path from 'path'; - -export const foo = path.resolve('foo'); diff --git a/test/function/samples/deprecated/plugin-module-ids/main.js b/test/function/samples/deprecated/plugin-module-ids/main.js deleted file mode 100644 index 9fbe8414a..000000000 --- a/test/function/samples/deprecated/plugin-module-ids/main.js +++ /dev/null @@ -1,2 +0,0 @@ -export { foo } from './foo.js'; -export const path = import('path'); diff --git a/test/function/samples/deprecated/preserveModules/inline-dynamic-imports/_config.js b/test/function/samples/deprecated/preserveModules/inline-dynamic-imports/_config.js deleted file mode 100644 index f72dfda5b..000000000 --- a/test/function/samples/deprecated/preserveModules/inline-dynamic-imports/_config.js +++ /dev/null @@ -1,15 +0,0 @@ -module.exports = defineTest({ - description: 'Inlining dynamic imports is not supported when preserving modules', - options: { - strictDeprecations: false, - input: ['main.js'], - preserveModules: true, - inlineDynamicImports: true - }, - generateError: { - code: 'INVALID_OPTION', - message: - 'Invalid value for option "output.inlineDynamicImports" - this option is not supported for "output.preserveModules".', - url: 'https://rollupjs.org/configuration-options/#output-inlinedynamicimports' - } -}); diff --git a/test/function/samples/deprecated/preserveModules/inline-dynamic-imports/lib.js b/test/function/samples/deprecated/preserveModules/inline-dynamic-imports/lib.js deleted file mode 100644 index 46d3ca8c6..000000000 --- a/test/function/samples/deprecated/preserveModules/inline-dynamic-imports/lib.js +++ /dev/null @@ -1 +0,0 @@ -export const value = 42; diff --git a/test/function/samples/deprecated/preserveModules/inline-dynamic-imports/main.js b/test/function/samples/deprecated/preserveModules/inline-dynamic-imports/main.js deleted file mode 100644 index 4869dc82f..000000000 --- a/test/function/samples/deprecated/preserveModules/inline-dynamic-imports/main.js +++ /dev/null @@ -1 +0,0 @@ -import('./lib').then(({value}) => assert.equal(value, 42)); diff --git a/test/function/samples/deprecated/preserveModules/invalid-default-export-mode/_config.js b/test/function/samples/deprecated/preserveModules/invalid-default-export-mode/_config.js deleted file mode 100644 index de7fd9305..000000000 --- a/test/function/samples/deprecated/preserveModules/invalid-default-export-mode/_config.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = defineTest({ - description: 'throws when using default export mode with named exports', - options: { - strictDeprecations: false, - input: ['main.js'], - preserveModules: true, - output: { - exports: 'default' - } - }, - generateError: { - code: 'INVALID_EXPORT_OPTION', - message: - '"default" was specified for "output.exports", but entry module "lib.js" has the following exports: "value"', - url: 'https://rollupjs.org/configuration-options/#output-exports' - } -}); diff --git a/test/function/samples/deprecated/preserveModules/invalid-default-export-mode/lib.js b/test/function/samples/deprecated/preserveModules/invalid-default-export-mode/lib.js deleted file mode 100644 index 46d3ca8c6..000000000 --- a/test/function/samples/deprecated/preserveModules/invalid-default-export-mode/lib.js +++ /dev/null @@ -1 +0,0 @@ -export const value = 42; diff --git a/test/function/samples/deprecated/preserveModules/invalid-default-export-mode/main.js b/test/function/samples/deprecated/preserveModules/invalid-default-export-mode/main.js deleted file mode 100644 index c379b667d..000000000 --- a/test/function/samples/deprecated/preserveModules/invalid-default-export-mode/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import { value } from './lib.js'; -assert.equal(value, 42); -export default 43; diff --git a/test/function/samples/deprecated/preserveModules/invalid-no-preserve-entry-signatures/_config.js b/test/function/samples/deprecated/preserveModules/invalid-no-preserve-entry-signatures/_config.js deleted file mode 100644 index c3fbb2273..000000000 --- a/test/function/samples/deprecated/preserveModules/invalid-no-preserve-entry-signatures/_config.js +++ /dev/null @@ -1,15 +0,0 @@ -module.exports = defineTest({ - description: 'throws when setting preserveEntrySignatures to false', - options: { - strictDeprecations: false, - input: ['main.js'], - preserveModules: true, - preserveEntrySignatures: false - }, - generateError: { - code: 'INVALID_OPTION', - message: - 'Invalid value for option "preserveEntrySignatures" - setting this option to false is not supported for "output.preserveModules".', - url: 'https://rollupjs.org/configuration-options/#preserveentrysignatures' - } -}); diff --git a/test/function/samples/deprecated/preserveModules/invalid-no-preserve-entry-signatures/main.js b/test/function/samples/deprecated/preserveModules/invalid-no-preserve-entry-signatures/main.js deleted file mode 100644 index 46d3ca8c6..000000000 --- a/test/function/samples/deprecated/preserveModules/invalid-no-preserve-entry-signatures/main.js +++ /dev/null @@ -1 +0,0 @@ -export const value = 42; diff --git a/test/function/samples/deprecated/preserveModules/invalid-none-export-mode/_config.js b/test/function/samples/deprecated/preserveModules/invalid-none-export-mode/_config.js deleted file mode 100644 index d8b428008..000000000 --- a/test/function/samples/deprecated/preserveModules/invalid-none-export-mode/_config.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = defineTest({ - description: 'throws when using none export mode with named exports', - options: { - strictDeprecations: false, - input: ['main.js'], - preserveModules: true, - output: { - exports: 'none' - } - }, - generateError: { - code: 'INVALID_EXPORT_OPTION', - message: - '"none" was specified for "output.exports", but entry module "lib.js" has the following exports: "value"', - url: 'https://rollupjs.org/configuration-options/#output-exports' - } -}); diff --git a/test/function/samples/deprecated/preserveModules/invalid-none-export-mode/lib.js b/test/function/samples/deprecated/preserveModules/invalid-none-export-mode/lib.js deleted file mode 100644 index 46d3ca8c6..000000000 --- a/test/function/samples/deprecated/preserveModules/invalid-none-export-mode/lib.js +++ /dev/null @@ -1 +0,0 @@ -export const value = 42; diff --git a/test/function/samples/deprecated/preserveModules/invalid-none-export-mode/main.js b/test/function/samples/deprecated/preserveModules/invalid-none-export-mode/main.js deleted file mode 100644 index f26e8d860..000000000 --- a/test/function/samples/deprecated/preserveModules/invalid-none-export-mode/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import { value } from './lib.js'; - -assert.equal(value, 42); diff --git a/test/function/samples/deprecated/preserveModules/manual-chunks/_config.js b/test/function/samples/deprecated/preserveModules/manual-chunks/_config.js deleted file mode 100644 index f5a3018c9..000000000 --- a/test/function/samples/deprecated/preserveModules/manual-chunks/_config.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = defineTest({ - description: 'Assigning manual chunks fails when preserving modules', - options: { - strictDeprecations: false, - input: ['main.js'], - preserveModules: true, - output: { - manualChunks: { - lib: ['lib.js'] - } - } - }, - generateError: { - code: 'INVALID_OPTION', - message: - 'Invalid value for option "output.manualChunks" - this option is not supported for "output.preserveModules".', - url: 'https://rollupjs.org/configuration-options/#output-manualchunks' - } -}); diff --git a/test/function/samples/deprecated/preserveModules/manual-chunks/lib.js b/test/function/samples/deprecated/preserveModules/manual-chunks/lib.js deleted file mode 100644 index 46d3ca8c6..000000000 --- a/test/function/samples/deprecated/preserveModules/manual-chunks/lib.js +++ /dev/null @@ -1 +0,0 @@ -export const value = 42; diff --git a/test/function/samples/deprecated/preserveModules/manual-chunks/main.js b/test/function/samples/deprecated/preserveModules/manual-chunks/main.js deleted file mode 100644 index 0786352d0..000000000 --- a/test/function/samples/deprecated/preserveModules/manual-chunks/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import { value } from './lib'; - -assert.equal(value, 42); diff --git a/test/function/samples/deprecated/preserveModules/mixed-exports/_config.js b/test/function/samples/deprecated/preserveModules/mixed-exports/_config.js deleted file mode 100644 index a8b3919de..000000000 --- a/test/function/samples/deprecated/preserveModules/mixed-exports/_config.js +++ /dev/null @@ -1,34 +0,0 @@ -const path = require('node:path'); -const ID_MAIN = path.join(__dirname, 'main.js'); -const ID_LIB1 = path.join(__dirname, 'lib1.js'); - -module.exports = defineTest({ - description: 'warns for mixed exports in all chunks when preserving modules', - options: { - strictDeprecations: false, - input: ['main.js'], - preserveModules: true - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.', - url: 'https://rollupjs.org/configuration-options/#output-preservemodules' - }, - { - code: 'MIXED_EXPORTS', - id: ID_MAIN, - message: - 'Entry module "main.js" is using named and default exports together. Consumers of your bundle will have to use `chunk.default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.', - url: 'https://rollupjs.org/configuration-options/#output-exports' - }, - { - code: 'MIXED_EXPORTS', - id: ID_LIB1, - message: - 'Entry module "lib1.js" is using named and default exports together. Consumers of your bundle will have to use `chunk.default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.', - url: 'https://rollupjs.org/configuration-options/#output-exports' - } - ] -}); diff --git a/test/function/samples/deprecated/preserveModules/mixed-exports/lib1.js b/test/function/samples/deprecated/preserveModules/mixed-exports/lib1.js deleted file mode 100644 index fea73e2bf..000000000 --- a/test/function/samples/deprecated/preserveModules/mixed-exports/lib1.js +++ /dev/null @@ -1,2 +0,0 @@ -export const value1 = 42; -export default 42; diff --git a/test/function/samples/deprecated/preserveModules/mixed-exports/lib2.js b/test/function/samples/deprecated/preserveModules/mixed-exports/lib2.js deleted file mode 100644 index 7a4e8a723..000000000 --- a/test/function/samples/deprecated/preserveModules/mixed-exports/lib2.js +++ /dev/null @@ -1 +0,0 @@ -export default 42; diff --git a/test/function/samples/deprecated/preserveModules/mixed-exports/lib3.js b/test/function/samples/deprecated/preserveModules/mixed-exports/lib3.js deleted file mode 100644 index baeef4a82..000000000 --- a/test/function/samples/deprecated/preserveModules/mixed-exports/lib3.js +++ /dev/null @@ -1 +0,0 @@ -export const value3 = 42; diff --git a/test/function/samples/deprecated/preserveModules/mixed-exports/main.js b/test/function/samples/deprecated/preserveModules/mixed-exports/main.js deleted file mode 100644 index 0bd873754..000000000 --- a/test/function/samples/deprecated/preserveModules/mixed-exports/main.js +++ /dev/null @@ -1,11 +0,0 @@ -import lib1, { value1 } from './lib1'; -import lib2 from './lib2'; -import { value3 } from './lib3'; - -assert.equal(lib1, 42); -assert.equal(value1, 42); -assert.equal(lib2, 42); -assert.equal(value3, 42); - -export const value = 42; -export default 42; diff --git a/test/function/samples/deprecated/preserveModules/virtual-modules-conflict/_config.js b/test/function/samples/deprecated/preserveModules/virtual-modules-conflict/_config.js deleted file mode 100644 index 3210239e8..000000000 --- a/test/function/samples/deprecated/preserveModules/virtual-modules-conflict/_config.js +++ /dev/null @@ -1,41 +0,0 @@ -const assert = require('node:assert'); - -module.exports = defineTest({ - description: 'Generates actual files for virtual modules when preserving modules', - options: { - strictDeprecations: false, - input: ['main.js'], - preserveModules: true, - plugins: [ - { - resolveId(id) { - if (id === '\0virtualModule.js') return id; - }, - load(id) { - if (id !== '\0virtualModule.js') return null; - return 'export const virtual = "Virtual!";\n'; - }, - transform(code, id) { - if (id === '\0virtualModule.js') return null; - return 'import {virtual} from "\0virtualModule.js";\n' + code; - } - } - ] - }, - bundle(bundle) { - return bundle.generate({ format: 'es' }).then(generated => - assert.deepEqual( - generated.output.map(chunk => chunk.fileName), - ['main.js', '_virtual/_virtualModule.js', '_virtual/_virtualModule2.js'] - ) - ); - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.', - url: 'https://rollupjs.org/configuration-options/#output-preservemodules' - } - ] -}); diff --git a/test/function/samples/deprecated/preserveModules/virtual-modules-conflict/_virtual/_virtualModule.js b/test/function/samples/deprecated/preserveModules/virtual-modules-conflict/_virtual/_virtualModule.js deleted file mode 100644 index 3901a31bd..000000000 --- a/test/function/samples/deprecated/preserveModules/virtual-modules-conflict/_virtual/_virtualModule.js +++ /dev/null @@ -1,3 +0,0 @@ -export const notSoVirtual = 'real'; - -assert.equal(virtual, 'Virtual!'); diff --git a/test/function/samples/deprecated/preserveModules/virtual-modules-conflict/main.js b/test/function/samples/deprecated/preserveModules/virtual-modules-conflict/main.js deleted file mode 100644 index 7653b3548..000000000 --- a/test/function/samples/deprecated/preserveModules/virtual-modules-conflict/main.js +++ /dev/null @@ -1,4 +0,0 @@ -import { notSoVirtual } from './_virtual/_virtualModule'; - -assert.equal(virtual, 'Virtual!'); -assert.equal(notSoVirtual, 'real'); diff --git a/test/function/samples/deprecated/preserveModules/virtual-modules/_config.js b/test/function/samples/deprecated/preserveModules/virtual-modules/_config.js deleted file mode 100644 index 8aecc53f5..000000000 --- a/test/function/samples/deprecated/preserveModules/virtual-modules/_config.js +++ /dev/null @@ -1,41 +0,0 @@ -const assert = require('node:assert'); - -module.exports = defineTest({ - description: 'Generates actual files for virtual modules when preserving modules', - options: { - strictDeprecations: false, - input: ['main.js'], - preserveModules: true, - plugins: [ - { - resolveId(id) { - if (id === '\0virtualModule') return id; - }, - load(id) { - if (id !== '\0virtualModule') return null; - return 'export const virtual = "Virtual!";\n'; - }, - transform(code, id) { - if (id === '\0virtualModule') return null; - return 'import {virtual} from "\0virtualModule";\n' + code; - } - } - ] - }, - bundle(bundle) { - return bundle.generate({ format: 'es' }).then(generated => - assert.deepEqual( - generated.output.map(chunk => chunk.fileName), - ['main.js', '_virtual/_virtualModule.js', 'lib/lib.js'] - ) - ); - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.', - url: 'https://rollupjs.org/configuration-options/#output-preservemodules' - } - ] -}); diff --git a/test/function/samples/deprecated/preserveModules/virtual-modules/lib/lib.js b/test/function/samples/deprecated/preserveModules/virtual-modules/lib/lib.js deleted file mode 100644 index 505982998..000000000 --- a/test/function/samples/deprecated/preserveModules/virtual-modules/lib/lib.js +++ /dev/null @@ -1 +0,0 @@ -assert.equal(virtual, 'Virtual!'); diff --git a/test/function/samples/deprecated/preserveModules/virtual-modules/main.js b/test/function/samples/deprecated/preserveModules/virtual-modules/main.js deleted file mode 100644 index f983b2526..000000000 --- a/test/function/samples/deprecated/preserveModules/virtual-modules/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import './lib/lib.js'; - -assert.equal(virtual, 'Virtual!'); diff --git a/test/function/samples/deprecated/reexport-ns/_config.js b/test/function/samples/deprecated/reexport-ns/_config.js deleted file mode 100644 index 24750619e..000000000 --- a/test/function/samples/deprecated/reexport-ns/_config.js +++ /dev/null @@ -1,25 +0,0 @@ -const assert = require('node:assert'); - -module.exports = defineTest({ - description: 'external namespace reexport', - options: { - strictDeprecations: false, - external: ['external'], - output: { - namespaceToStringTag: true - } - }, - exports(exports) { - assert.strictEqual(typeof exports.maths, 'object'); - assert.strictEqual(exports[Symbol.toStringTag], 'Module'); - assert.strictEqual(exports.maths.external, true); - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.', - url: 'https://rollupjs.org/configuration-options/#output-generatedcode-symbols' - } - ] -}); diff --git a/test/function/samples/deprecated/reexport-ns/main.js b/test/function/samples/deprecated/reexport-ns/main.js deleted file mode 100644 index 240d9f00f..000000000 --- a/test/function/samples/deprecated/reexport-ns/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import * as maths from './maths.js'; - -export default maths; diff --git a/test/function/samples/deprecated/reexport-ns/maths.js b/test/function/samples/deprecated/reexport-ns/maths.js deleted file mode 100644 index 5089bebae..000000000 --- a/test/function/samples/deprecated/reexport-ns/maths.js +++ /dev/null @@ -1 +0,0 @@ -export { default as maths } from './square.js'; diff --git a/test/function/samples/deprecated/reexport-ns/square.js b/test/function/samples/deprecated/reexport-ns/square.js deleted file mode 100644 index b3725dbd9..000000000 --- a/test/function/samples/deprecated/reexport-ns/square.js +++ /dev/null @@ -1,2 +0,0 @@ -import * as m from 'external'; -export default m; diff --git a/test/function/samples/deprecated/resolve-id-external/_config.js b/test/function/samples/deprecated/resolve-id-external/_config.js deleted file mode 100644 index fc6c913dc..000000000 --- a/test/function/samples/deprecated/resolve-id-external/_config.js +++ /dev/null @@ -1,89 +0,0 @@ -const assert = require('node:assert'); -const path = require('node:path'); -const sideEffects = []; -const { getObject } = require('../../../../utils'); - -module.exports = defineTest({ - description: 'does not include modules without used exports if moduleSideEffect is false', - context: { - require(id) { - sideEffects.push(id); - return { value: id }; - } - }, - exports() { - assert.deepStrictEqual(sideEffects, [ - 'sideeffects-false-usereffects-false-used-import', - 'sideeffects-null-usereffects-false-used-import', - 'sideeffects-true-usereffects-false', - 'sideeffects-true-usereffects-false-unused-import', - 'sideeffects-true-usereffects-false-used-import', - 'sideeffects-false-usereffects-true-used-import', - 'sideeffects-null-usereffects-true', - 'sideeffects-null-usereffects-true-unused-import', - 'sideeffects-null-usereffects-true-used-import', - 'sideeffects-true-usereffects-true', - 'sideeffects-true-usereffects-true-unused-import', - 'sideeffects-true-usereffects-true-used-import' - ]); - }, - options: { - strictDeprecations: false, - treeshake: { - moduleSideEffects(id) { - if (id.includes('main')) return true; - return JSON.parse(id.split('-')[3]); - } - }, - plugins: [ - { - name: 'test-plugin', - resolveId(id) { - if (!path.isAbsolute(id)) { - return { - id, - external: true, - moduleSideEffects: JSON.parse(id.split('-')[1]) - }; - } - }, - buildEnd() { - assert.deepStrictEqual( - getObject( - [...this.getModuleIds()] - .filter(id => !path.isAbsolute(id)) - .map(id => [id, this.getModuleInfo(id).hasModuleSideEffects]) - ), - { - 'sideeffects-false-usereffects-false': false, - 'sideeffects-false-usereffects-false-unused-import': false, - 'sideeffects-false-usereffects-false-used-import': false, - 'sideeffects-false-usereffects-true': false, - 'sideeffects-false-usereffects-true-unused-import': false, - 'sideeffects-false-usereffects-true-used-import': false, - 'sideeffects-null-usereffects-false': false, - 'sideeffects-null-usereffects-false-unused-import': false, - 'sideeffects-null-usereffects-false-used-import': false, - 'sideeffects-null-usereffects-true': true, - 'sideeffects-null-usereffects-true-unused-import': true, - 'sideeffects-null-usereffects-true-used-import': true, - 'sideeffects-true-usereffects-false': true, - 'sideeffects-true-usereffects-false-unused-import': true, - 'sideeffects-true-usereffects-false-used-import': true, - 'sideeffects-true-usereffects-true': true, - 'sideeffects-true-usereffects-true-unused-import': true, - 'sideeffects-true-usereffects-true-used-import': true - } - ); - } - } - ] - }, - warnings(warnings) { - for (const warning of warnings) { - if (warning.code !== 'UNUSED_EXTERNAL_IMPORT' && warning.code !== 'DEPRECATED_FEATURE') { - throw new Error(`Unexpected warning code "${warning.code}"`); - } - } - } -}); diff --git a/test/function/samples/deprecated/resolve-id-external/main.js b/test/function/samples/deprecated/resolve-id-external/main.js deleted file mode 100644 index dba6f1c07..000000000 --- a/test/function/samples/deprecated/resolve-id-external/main.js +++ /dev/null @@ -1,25 +0,0 @@ -import 'sideeffects-false-usereffects-false'; -import { value as unusedValue1 } from 'sideeffects-false-usereffects-false-unused-import'; -import { value as usedValue1 } from 'sideeffects-false-usereffects-false-used-import'; - -import 'sideeffects-null-usereffects-false'; -import { value as unusedValue2 } from 'sideeffects-null-usereffects-false-unused-import'; -import { value as usedValue2 } from 'sideeffects-null-usereffects-false-used-import'; - -import 'sideeffects-true-usereffects-false'; -import { value as unusedValue3 } from 'sideeffects-true-usereffects-false-unused-import'; -import { value as usedValue3 } from 'sideeffects-true-usereffects-false-used-import'; - -import 'sideeffects-false-usereffects-true'; -import { value as unusedValue4 } from 'sideeffects-false-usereffects-true-unused-import'; -import { value as usedValue4 } from 'sideeffects-false-usereffects-true-used-import'; - -import 'sideeffects-null-usereffects-true'; -import { value as unusedValue5 } from 'sideeffects-null-usereffects-true-unused-import'; -import { value as usedValue5 } from 'sideeffects-null-usereffects-true-used-import'; - -import 'sideeffects-true-usereffects-true'; -import { value as unusedValue6 } from 'sideeffects-true-usereffects-true-unused-import'; -import { value as usedValue6 } from 'sideeffects-true-usereffects-true-used-import'; - -export const values = [usedValue1, usedValue2, usedValue3, usedValue4, usedValue5, usedValue6]; diff --git a/test/function/samples/deprecated/resolve-id/_config.js b/test/function/samples/deprecated/resolve-id/_config.js deleted file mode 100644 index c7f4077a8..000000000 --- a/test/function/samples/deprecated/resolve-id/_config.js +++ /dev/null @@ -1,96 +0,0 @@ -const assert = require('node:assert'); -const path = require('node:path'); -const { getObject } = require('../../../../utils'); - -const sideEffects = []; - -module.exports = defineTest({ - description: 'does not include modules without used exports if moduleSideEffect is false', - context: { - sideEffects - }, - exports() { - assert.deepStrictEqual(sideEffects, [ - 'sideeffects-false-usereffects-false-used-import', - 'sideeffects-null-usereffects-false-used-import', - 'sideeffects-true-usereffects-false', - 'sideeffects-true-usereffects-false-unused-import', - 'sideeffects-true-usereffects-false-used-import', - 'sideeffects-false-usereffects-true-used-import', - 'sideeffects-null-usereffects-true', - 'sideeffects-null-usereffects-true-unused-import', - 'sideeffects-null-usereffects-true-used-import', - 'sideeffects-true-usereffects-true', - 'sideeffects-true-usereffects-true-unused-import', - 'sideeffects-true-usereffects-true-used-import' - ]); - }, - options: { - strictDeprecations: false, - treeshake: { - moduleSideEffects(id) { - if (id.includes('main')) return true; - return JSON.parse(id.split('-')[3]); - } - }, - plugins: [ - { - name: 'test-plugin', - resolveId(id) { - if (!path.isAbsolute(id)) { - return { - id, - external: false, - moduleSideEffects: JSON.parse(id.split('-')[1]) - }; - } - }, - load(id) { - if (!path.isAbsolute(id)) { - const sideEffects = JSON.parse(id.split('-')[1]); - const userEffects = JSON.parse(id.split('-')[3]); - assert.strictEqual( - this.getModuleInfo(id).hasModuleSideEffects, - typeof sideEffects === 'boolean' ? sideEffects : userEffects - ); - return `export const value = '${id}'; sideEffects.push(value);`; - } - }, - buildEnd() { - assert.deepStrictEqual( - getObject( - [...this.getModuleIds()] - .filter(id => !path.isAbsolute(id)) - .map(id => [id, this.getModuleInfo(id).hasModuleSideEffects]) - ), - { - 'sideeffects-false-usereffects-false': false, - 'sideeffects-false-usereffects-false-unused-import': false, - 'sideeffects-false-usereffects-false-used-import': false, - 'sideeffects-false-usereffects-true': false, - 'sideeffects-false-usereffects-true-unused-import': false, - 'sideeffects-false-usereffects-true-used-import': false, - 'sideeffects-null-usereffects-false': false, - 'sideeffects-null-usereffects-false-unused-import': false, - 'sideeffects-null-usereffects-false-used-import': false, - 'sideeffects-null-usereffects-true': true, - 'sideeffects-null-usereffects-true-unused-import': true, - 'sideeffects-null-usereffects-true-used-import': true, - 'sideeffects-true-usereffects-false': true, - 'sideeffects-true-usereffects-false-unused-import': true, - 'sideeffects-true-usereffects-false-used-import': true, - 'sideeffects-true-usereffects-true': true, - 'sideeffects-true-usereffects-true-unused-import': true, - 'sideeffects-true-usereffects-true-used-import': true - } - ); - } - } - ] - }, - warnings(warnings) { - for (const warning of warnings) { - assert.strictEqual(warning.code, 'DEPRECATED_FEATURE'); - } - } -}); diff --git a/test/function/samples/deprecated/resolve-id/main.js b/test/function/samples/deprecated/resolve-id/main.js deleted file mode 100644 index dba6f1c07..000000000 --- a/test/function/samples/deprecated/resolve-id/main.js +++ /dev/null @@ -1,25 +0,0 @@ -import 'sideeffects-false-usereffects-false'; -import { value as unusedValue1 } from 'sideeffects-false-usereffects-false-unused-import'; -import { value as usedValue1 } from 'sideeffects-false-usereffects-false-used-import'; - -import 'sideeffects-null-usereffects-false'; -import { value as unusedValue2 } from 'sideeffects-null-usereffects-false-unused-import'; -import { value as usedValue2 } from 'sideeffects-null-usereffects-false-used-import'; - -import 'sideeffects-true-usereffects-false'; -import { value as unusedValue3 } from 'sideeffects-true-usereffects-false-unused-import'; -import { value as usedValue3 } from 'sideeffects-true-usereffects-false-used-import'; - -import 'sideeffects-false-usereffects-true'; -import { value as unusedValue4 } from 'sideeffects-false-usereffects-true-unused-import'; -import { value as usedValue4 } from 'sideeffects-false-usereffects-true-used-import'; - -import 'sideeffects-null-usereffects-true'; -import { value as unusedValue5 } from 'sideeffects-null-usereffects-true-unused-import'; -import { value as usedValue5 } from 'sideeffects-null-usereffects-true-used-import'; - -import 'sideeffects-true-usereffects-true'; -import { value as unusedValue6 } from 'sideeffects-true-usereffects-true-unused-import'; -import { value as usedValue6 } from 'sideeffects-true-usereffects-true-used-import'; - -export const values = [usedValue1, usedValue2, usedValue3, usedValue4, usedValue5, usedValue6]; diff --git a/test/function/samples/deprecations/dynamicImportFunction/_config.js b/test/function/samples/deprecations/dynamicImportFunction/_config.js deleted file mode 100644 index e143d84cf..000000000 --- a/test/function/samples/deprecations/dynamicImportFunction/_config.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = defineTest({ - description: 'marks the "output.dynamicImportFunction" option as deprecated', - options: { - output: { - dynamicImportFunction: 'foo' - } - }, - generateError: { - code: 'DEPRECATED_FEATURE', - message: - 'The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.', - url: 'https://rollupjs.org/plugin-development/#renderdynamicimport' - } -}); diff --git a/test/function/samples/deprecations/dynamicImportFunction/main.js b/test/function/samples/deprecations/dynamicImportFunction/main.js deleted file mode 100644 index cc1d88a24..000000000 --- a/test/function/samples/deprecations/dynamicImportFunction/main.js +++ /dev/null @@ -1 +0,0 @@ -assert.ok(true); diff --git a/test/function/samples/deprecations/experimentalDeepDynamicChunkOptimization/_config.js b/test/function/samples/deprecations/experimentalDeepDynamicChunkOptimization/_config.js deleted file mode 100644 index 55497278e..000000000 --- a/test/function/samples/deprecations/experimentalDeepDynamicChunkOptimization/_config.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = defineTest({ - description: 'marks the "output.experimentalDeepDynamicChunkOptimization" option as deprecated', - options: { - output: { - experimentalDeepDynamicChunkOptimization: true - } - }, - generateError: { - code: 'DEPRECATED_FEATURE', - message: - 'The "output.experimentalDeepDynamicChunkOptimization" option is deprecated as Rollup always runs the full chunking algorithm now. The option should be removed.', - url: 'https://rollupjs.org/configuration-options/#output-experimentaldeepdynamicchunkoptimization' - } -}); diff --git a/test/function/samples/deprecations/experimentalDeepDynamicChunkOptimization/main.js b/test/function/samples/deprecations/experimentalDeepDynamicChunkOptimization/main.js deleted file mode 100644 index cc1d88a24..000000000 --- a/test/function/samples/deprecations/experimentalDeepDynamicChunkOptimization/main.js +++ /dev/null @@ -1 +0,0 @@ -assert.ok(true); diff --git a/test/function/samples/deprecations/hasModuleSideEffects/_config.js b/test/function/samples/deprecations/hasModuleSideEffects/_config.js deleted file mode 100644 index a711e73a9..000000000 --- a/test/function/samples/deprecations/hasModuleSideEffects/_config.js +++ /dev/null @@ -1,27 +0,0 @@ -const assert = require('node:assert'); -const path = require('node:path'); - -module.exports = defineTest({ - description: 'warns that accessing "ModuleInfo.hasModuleSideEffects" is deprecated', - options: { - strictDeprecations: true, - plugins: [ - { - name: 'test', - moduleParsed({ hasModuleSideEffects }) { - assert.ok(hasModuleSideEffects); - } - } - ] - }, - error: { - code: 'PLUGIN_ERROR', - hook: 'moduleParsed', - message: - 'Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', - plugin: 'test', - pluginCode: 'DEPRECATED_FEATURE', - url: 'https://rollupjs.org/plugin-development/#this-getmoduleinfo', - watchFiles: [path.join(__dirname, 'main.js')] - } -}); diff --git a/test/function/samples/deprecations/hasModuleSideEffects/main.js b/test/function/samples/deprecations/hasModuleSideEffects/main.js deleted file mode 100644 index cc1d88a24..000000000 --- a/test/function/samples/deprecations/hasModuleSideEffects/main.js +++ /dev/null @@ -1 +0,0 @@ -assert.ok(true); diff --git a/test/function/samples/deprecations/inlineDynamicImports/_config.js b/test/function/samples/deprecations/inlineDynamicImports/_config.js deleted file mode 100644 index cb5956690..000000000 --- a/test/function/samples/deprecations/inlineDynamicImports/_config.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = defineTest({ - description: 'marks the "inlineDynamicImports" input option as deprecated', - options: { - inlineDynamicImports: true - }, - error: { - code: 'DEPRECATED_FEATURE', - message: - 'The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', - url: 'https://rollupjs.org/configuration-options/#output-inlinedynamicimports' - } -}); diff --git a/test/function/samples/deprecations/inlineDynamicImports/main.js b/test/function/samples/deprecations/inlineDynamicImports/main.js deleted file mode 100644 index 7a4e8a723..000000000 --- a/test/function/samples/deprecations/inlineDynamicImports/main.js +++ /dev/null @@ -1 +0,0 @@ -export default 42; diff --git a/test/function/samples/deprecations/manualChunks/_config.js b/test/function/samples/deprecations/manualChunks/_config.js deleted file mode 100644 index be135218f..000000000 --- a/test/function/samples/deprecations/manualChunks/_config.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = defineTest({ - description: 'marks the "manualChunks" input option as deprecated', - options: { - manualChunks() { - return 'manual'; - } - }, - error: { - code: 'DEPRECATED_FEATURE', - message: - 'The "manualChunks" option is deprecated. Use the "output.manualChunks" option instead.', - url: 'https://rollupjs.org/configuration-options/#output-manualchunks' - } -}); diff --git a/test/function/samples/deprecations/manualChunks/main.js b/test/function/samples/deprecations/manualChunks/main.js deleted file mode 100644 index 7a4e8a723..000000000 --- a/test/function/samples/deprecations/manualChunks/main.js +++ /dev/null @@ -1 +0,0 @@ -export default 42; diff --git a/test/function/samples/deprecations/maxParallelFileReads/_config.js b/test/function/samples/deprecations/maxParallelFileReads/_config.js deleted file mode 100644 index 3fb15c6e4..000000000 --- a/test/function/samples/deprecations/maxParallelFileReads/_config.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = defineTest({ - description: 'marks the "maxParallelFileReads" option as deprecated', - options: { - maxParallelFileReads: 3 - }, - error: { - code: 'DEPRECATED_FEATURE', - message: - 'The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.', - url: 'https://rollupjs.org/configuration-options/#maxparallelfileops' - } -}); diff --git a/test/function/samples/deprecations/maxParallelFileReads/main.js b/test/function/samples/deprecations/maxParallelFileReads/main.js deleted file mode 100644 index cc1d88a24..000000000 --- a/test/function/samples/deprecations/maxParallelFileReads/main.js +++ /dev/null @@ -1 +0,0 @@ -assert.ok(true); diff --git a/test/function/samples/deprecations/namespaceToStringTag/_config.js b/test/function/samples/deprecations/namespaceToStringTag/_config.js deleted file mode 100644 index 79b151732..000000000 --- a/test/function/samples/deprecations/namespaceToStringTag/_config.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = defineTest({ - description: 'marks the "output.namespaceToStringTag" option as deprecated', - options: { - output: { - namespaceToStringTag: true - } - }, - generateError: { - code: 'DEPRECATED_FEATURE', - message: - 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.', - url: 'https://rollupjs.org/configuration-options/#output-generatedcode-symbols' - } -}); diff --git a/test/function/samples/deprecations/namespaceToStringTag/main.js b/test/function/samples/deprecations/namespaceToStringTag/main.js deleted file mode 100644 index cc1d88a24..000000000 --- a/test/function/samples/deprecations/namespaceToStringTag/main.js +++ /dev/null @@ -1 +0,0 @@ -assert.ok(true); diff --git a/test/function/samples/deprecations/plugin-module-ids/_config.js b/test/function/samples/deprecations/plugin-module-ids/_config.js deleted file mode 100644 index 627a5c399..000000000 --- a/test/function/samples/deprecations/plugin-module-ids/_config.js +++ /dev/null @@ -1,23 +0,0 @@ -module.exports = defineTest({ - description: 'provides all module ids on the plugin context', - options: { - external: ['path'], - plugins: [ - { - name: 'test', - renderStart() { - console.log([...this.moduleIds]); - } - } - ] - }, - generateError: { - code: 'PLUGIN_ERROR', - hook: 'renderStart', - message: - 'Accessing "this.moduleIds" on the plugin context by plugin test is deprecated. The "this.getModuleIds" plugin context function should be used instead.', - plugin: 'test', - pluginCode: 'DEPRECATED_FEATURE', - url: 'https://rollupjs.org/plugin-development/#this-getmoduleids' - } -}); diff --git a/test/function/samples/deprecations/plugin-module-ids/foo.js b/test/function/samples/deprecations/plugin-module-ids/foo.js deleted file mode 100644 index cb4875a0a..000000000 --- a/test/function/samples/deprecations/plugin-module-ids/foo.js +++ /dev/null @@ -1,3 +0,0 @@ -import path from 'path'; - -export const foo = path.resolve('foo'); diff --git a/test/function/samples/deprecations/plugin-module-ids/main.js b/test/function/samples/deprecations/plugin-module-ids/main.js deleted file mode 100644 index 4ffe2d41c..000000000 --- a/test/function/samples/deprecations/plugin-module-ids/main.js +++ /dev/null @@ -1 +0,0 @@ -export { foo } from './foo.js'; diff --git a/test/function/samples/deprecations/prefer-const/_config.js b/test/function/samples/deprecations/prefer-const/_config.js deleted file mode 100644 index 0e9a06f92..000000000 --- a/test/function/samples/deprecations/prefer-const/_config.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = defineTest({ - description: 'marks the "output.preferConst" option as deprecated', - options: { - output: { - preferConst: true - } - }, - generateError: { - code: 'DEPRECATED_FEATURE', - message: - 'The "output.preferConst" option is deprecated. Use the "output.generatedCode.constBindings" option instead.', - url: 'https://rollupjs.org/configuration-options/#output-generatedcode-constbindings' - } -}); diff --git a/test/function/samples/deprecations/prefer-const/main.js b/test/function/samples/deprecations/prefer-const/main.js deleted file mode 100644 index 7a4e8a723..000000000 --- a/test/function/samples/deprecations/prefer-const/main.js +++ /dev/null @@ -1 +0,0 @@ -export default 42; diff --git a/test/function/samples/deprecations/preserveModules/_config.js b/test/function/samples/deprecations/preserveModules/_config.js deleted file mode 100644 index 0bb0d2140..000000000 --- a/test/function/samples/deprecations/preserveModules/_config.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = defineTest({ - description: 'marks the "preserveModules" input option as deprecated', - options: { - preserveModules: true - }, - error: { - code: 'DEPRECATED_FEATURE', - message: - 'The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.', - url: 'https://rollupjs.org/configuration-options/#output-preservemodules' - } -}); diff --git a/test/function/samples/deprecations/preserveModules/main.js b/test/function/samples/deprecations/preserveModules/main.js deleted file mode 100644 index 7a4e8a723..000000000 --- a/test/function/samples/deprecations/preserveModules/main.js +++ /dev/null @@ -1 +0,0 @@ -export default 42; diff --git a/test/function/samples/options-hook/_config.js b/test/function/samples/options-hook/_config.js index c428caf5c..72badede7 100644 --- a/test/function/samples/options-hook/_config.js +++ b/test/function/samples/options-hook/_config.js @@ -18,7 +18,6 @@ module.exports = defineTest({ logLevel: 'info', makeAbsoluteExternalsRelative: 'ifRelativeSource', maxParallelFileOps: 20, - maxParallelFileReads: 20, perf: false, plugins: [ { diff --git a/test/function/samples/output-options-hook/_config.js b/test/function/samples/output-options-hook/_config.js index 5c3d6e338..2027c44a8 100644 --- a/test/function/samples/output-options-hook/_config.js +++ b/test/function/samples/output-options-hook/_config.js @@ -28,7 +28,6 @@ module.exports = defineTest({ dynamicImportInCjs: true, entryFileNames: '[name].js', esModule: 'if-default-prop', - experimentalDeepDynamicChunkOptimization: false, experimentalMinChunkSize: 1, exports: 'auto', extend: false, @@ -50,11 +49,9 @@ module.exports = defineTest({ inlineDynamicImports: false, manualChunks: {}, minifyInternalExports: false, - namespaceToStringTag: false, noConflict: false, paths: {}, plugins: [], - preferConst: false, preserveModules: false, sourcemap: false, sourcemapExcludeSources: false, diff --git a/test/misc/optionList.js b/test/misc/optionList.js index b869f7e7b..2c507465f 100644 --- a/test/misc/optionList.js +++ b/test/misc/optionList.js @@ -1,6 +1,6 @@ exports.input = - 'cache, context, experimentalCacheExpiry, experimentalLogSideEffects, external, inlineDynamicImports, input, logLevel, makeAbsoluteExternalsRelative, manualChunks, maxParallelFileOps, maxParallelFileReads, moduleContext, onLog, onwarn, perf, plugins, preserveEntrySignatures, preserveModules, preserveSymlinks, shimMissingExports, strictDeprecations, treeshake, watch'; + 'cache, context, experimentalCacheExpiry, experimentalLogSideEffects, external, input, logLevel, makeAbsoluteExternalsRelative, maxParallelFileOps, moduleContext, onLog, onwarn, perf, plugins, preserveEntrySignatures, preserveSymlinks, shimMissingExports, strictDeprecations, treeshake, watch'; exports.flags = - 'amd, assetFileNames, banner, bundleConfigAsCjs, c, cache, chunkFileNames, compact, config, configPlugin, context, d, dir, dynamicImportFunction, dynamicImportInCjs, e, entryFileNames, environment, esModule, experimentalCacheExpiry, experimentalDeepDynamicChunkOptimization, experimentalLogSideEffects, experimentalMinChunkSize, exports, extend, external, externalImportAssertions, externalImportAttributes, externalLiveBindings, f, failAfterWarnings, file, filterLogs, footer, format, freeze, g, generatedCode, globals, h, hoistTransitiveImports, i, indent, inlineDynamicImports, input, interop, intro, logLevel, m, makeAbsoluteExternalsRelative, manualChunks, maxParallelFileOps, maxParallelFileReads, minifyInternalExports, moduleContext, n, name, namespaceToStringTag, noConflict, o, onLog, onwarn, outro, p, paths, perf, plugin, plugins, preferConst, preserveEntrySignatures, preserveModules, preserveModulesRoot, preserveSymlinks, sanitizeFileName, shimMissingExports, silent, sourcemap, sourcemapBaseUrl, sourcemapExcludeSources, sourcemapFile, sourcemapFileNames, stdin, strict, strictDeprecations, systemNullSetters, treeshake, v, validate, w, waitForBundleInput, watch'; + 'amd, assetFileNames, banner, bundleConfigAsCjs, c, cache, chunkFileNames, compact, config, configPlugin, context, d, dir, dynamicImportInCjs, e, entryFileNames, environment, esModule, experimentalCacheExpiry, experimentalLogSideEffects, experimentalMinChunkSize, exports, extend, external, externalImportAssertions, externalImportAttributes, externalLiveBindings, f, failAfterWarnings, file, filterLogs, footer, format, freeze, g, generatedCode, globals, h, hoistTransitiveImports, i, indent, inlineDynamicImports, input, interop, intro, logLevel, m, makeAbsoluteExternalsRelative, manualChunks, maxParallelFileOps, minifyInternalExports, moduleContext, n, name, noConflict, o, onLog, onwarn, outro, p, paths, perf, plugin, plugins, preserveEntrySignatures, preserveModules, preserveModulesRoot, preserveSymlinks, sanitizeFileName, shimMissingExports, silent, sourcemap, sourcemapBaseUrl, sourcemapExcludeSources, sourcemapFile, sourcemapFileNames, stdin, strict, strictDeprecations, systemNullSetters, treeshake, v, validate, w, waitForBundleInput, watch'; exports.output = - 'amd, assetFileNames, banner, chunkFileNames, compact, dir, dynamicImportFunction, dynamicImportInCjs, entryFileNames, esModule, experimentalDeepDynamicChunkOptimization, experimentalMinChunkSize, exports, extend, externalImportAssertions, externalImportAttributes, externalLiveBindings, file, footer, format, freeze, generatedCode, globals, hoistTransitiveImports, indent, inlineDynamicImports, interop, intro, manualChunks, minifyInternalExports, name, namespaceToStringTag, noConflict, outro, paths, plugins, preferConst, preserveModules, preserveModulesRoot, sanitizeFileName, sourcemap, sourcemapBaseUrl, sourcemapExcludeSources, sourcemapFile, sourcemapFileNames, sourcemapIgnoreList, sourcemapPathTransform, strict, systemNullSetters, validate'; + 'amd, assetFileNames, banner, chunkFileNames, compact, dir, dynamicImportInCjs, entryFileNames, esModule, experimentalMinChunkSize, exports, extend, externalImportAssertions, externalImportAttributes, externalLiveBindings, file, footer, format, freeze, generatedCode, globals, hoistTransitiveImports, indent, inlineDynamicImports, interop, intro, manualChunks, minifyInternalExports, name, noConflict, outro, paths, plugins, preserveModules, preserveModulesRoot, sanitizeFileName, sourcemap, sourcemapBaseUrl, sourcemapExcludeSources, sourcemapFile, sourcemapFileNames, sourcemapIgnoreList, sourcemapPathTransform, strict, systemNullSetters, validate'; From accd66a4247dfdb4d7f2605b399d12d001e5a3ed Mon Sep 17 00:00:00 2001 From: XiaoPi <530257315@qq.com> Date: Sun, 24 Sep 2023 13:26:09 +0800 Subject: [PATCH 06/44] [v4.0] feat: Do not watch files anymore if their content is returned by the load hook (#5150) * feat: Do not watch files anymore if their content is returned by the load hook * tweak test --- src/ModuleLoader.ts | 11 ++++++----- .../samples/missing-dependency-resolution/_config.js | 3 +-- test/function/samples/external-conflict/_config.js | 2 +- .../samples/load-module-error/load/_config.js | 2 +- .../samples/load-returns-string-or-null/_config.js | 4 ---- .../max-parallel-file-operations/error/_config.js | 2 +- test/function/samples/plugin-error/load/_config.js | 3 +-- 7 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/ModuleLoader.ts b/src/ModuleLoader.ts index 2c8a5442b..7b49af180 100644 --- a/src/ModuleLoader.ts +++ b/src/ModuleLoader.ts @@ -271,10 +271,12 @@ export class ModuleLoader { ): Promise { let source: LoadResult; try { - source = await this.graph.fileOperationQueue.run( - async () => - (await this.pluginDriver.hookFirst('load', [id])) ?? (await readFile(id, 'utf8')) - ); + source = await this.graph.fileOperationQueue.run(async () => { + const content = await this.pluginDriver.hookFirst('load', [id]); + if (content !== null) return content; + this.graph.watchFiles[id] = true; + return await readFile(id, 'utf8'); + }); } catch (error_: any) { let message = `Could not load ${id}`; if (importer) message += ` (imported by ${relativeId(importer)})`; @@ -403,7 +405,6 @@ export class ModuleLoader { attributes ); this.modulesById.set(id, module); - this.graph.watchFiles[id] = true; const loadPromise: LoadModulePromise = this.addModuleSource(id, importer, module).then(() => [ this.getResolveStaticDependencyPromises(module), this.getResolveDynamicImportPromises(module), diff --git a/test/browser/samples/missing-dependency-resolution/_config.js b/test/browser/samples/missing-dependency-resolution/_config.js index 07da69ed0..ea2e64b18 100644 --- a/test/browser/samples/missing-dependency-resolution/_config.js +++ b/test/browser/samples/missing-dependency-resolution/_config.js @@ -12,7 +12,6 @@ console.log(foo);` code: 'NO_FS_IN_BROWSER', message: 'Cannot access the file system (via "path.resolve") when using the browser build of Rollup. Make sure you supply a plugin with custom resolveId and load hooks to Rollup.', - url: 'https://rollupjs.org/plugin-development/#a-simple-example', - watchFiles: ['main'] + url: 'https://rollupjs.org/plugin-development/#a-simple-example' } }); diff --git a/test/function/samples/external-conflict/_config.js b/test/function/samples/external-conflict/_config.js index 372c4c7c5..47837de32 100644 --- a/test/function/samples/external-conflict/_config.js +++ b/test/function/samples/external-conflict/_config.js @@ -18,7 +18,7 @@ module.exports = defineTest({ }, error: { code: 'INVALID_EXTERNAL_ID', - watchFiles: [ID_MAIN, 'dep'], + watchFiles: [ID_MAIN], message: '"dep" is imported as an external by "dep", but is already an existing non-external module id.' } diff --git a/test/function/samples/load-module-error/load/_config.js b/test/function/samples/load-module-error/load/_config.js index 298a54b9b..195843d54 100644 --- a/test/function/samples/load-module-error/load/_config.js +++ b/test/function/samples/load-module-error/load/_config.js @@ -24,6 +24,6 @@ module.exports = defineTest({ hook: 'load', message: `Could not load broken (imported by main.js): It's broken!`, plugin: 'test', - watchFiles: [path.join(__dirname, 'main.js'), 'broken'] + watchFiles: [path.join(__dirname, 'main.js')] } }); diff --git a/test/function/samples/load-returns-string-or-null/_config.js b/test/function/samples/load-returns-string-or-null/_config.js index fb5a74390..56315fcec 100644 --- a/test/function/samples/load-returns-string-or-null/_config.js +++ b/test/function/samples/load-returns-string-or-null/_config.js @@ -1,6 +1,3 @@ -const path = require('node:path'); -const ID_MAIN = path.join(__dirname, 'main.js'); - module.exports = defineTest({ description: 'throws error if load returns something wacky', options: { @@ -15,7 +12,6 @@ module.exports = defineTest({ }, error: { code: 'BAD_LOADER', - watchFiles: [ID_MAIN], message: 'Error loading "main.js": plugin load hook should return a string, a { code, map } object, or nothing/null.' } diff --git a/test/function/samples/max-parallel-file-operations/error/_config.js b/test/function/samples/max-parallel-file-operations/error/_config.js index ad0dba875..0283412b7 100644 --- a/test/function/samples/max-parallel-file-operations/error/_config.js +++ b/test/function/samples/max-parallel-file-operations/error/_config.js @@ -26,6 +26,6 @@ module.exports = defineTest({ }, error: { message: `Could not load ${join(__dirname, 'dep.js')} (imported by main): broken`, - watchFiles: [join(__dirname, 'dep.js'), 'main'] + watchFiles: [join(__dirname, 'dep.js')] } }); diff --git a/test/function/samples/plugin-error/load/_config.js b/test/function/samples/plugin-error/load/_config.js index 270ef537b..a5de941a7 100644 --- a/test/function/samples/plugin-error/load/_config.js +++ b/test/function/samples/plugin-error/load/_config.js @@ -16,7 +16,6 @@ module.exports = defineTest({ code: 'PLUGIN_ERROR', plugin: 'test', message: `Could not load ${path.join(__dirname, 'main.js')}: nope`, - hook: 'load', - watchFiles: [path.join(__dirname, 'main.js')] + hook: 'load' } }); From 7325320ad95955540e1bb38dab9d600f569d915c Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Sun, 24 Sep 2023 07:28:49 +0200 Subject: [PATCH 07/44] [v4.0] Remove onwarn from normalized input options (#5147) Remove onwarn from normalized input options Also remove the RollupWarning type --- .github/workflows/build-and-tests.yml | 2 + browser/package.json | 2 +- package-lock.json | 4 +- package.json | 2 +- scripts/postpublish.js | 50 ++++++++++--------- src/rollup/types.d.ts | 3 -- src/utils/options/mergeOptions.ts | 8 +-- src/utils/options/normalizeInputOptions.ts | 5 +- .../_config.js | 18 +------ .../log-from-plugin-options-onlog/_config.js | 13 +---- .../log-from-plugin-options-onwarn/_config.js | 13 +---- .../log-from-plugin-options-simple/_config.js | 7 +-- 12 files changed, 44 insertions(+), 83 deletions(-) diff --git a/.github/workflows/build-and-tests.yml b/.github/workflows/build-and-tests.yml index bdef57256..5164c9960 100644 --- a/.github/workflows/build-and-tests.yml +++ b/.github/workflows/build-and-tests.yml @@ -289,6 +289,8 @@ jobs: publish: permissions: pull-requests: write # for writing comments + issues: write # for writing comments + contents: write # for creating a release name: Publish runs-on: ubuntu-latest timeout-minutes: 15 diff --git a/browser/package.json b/browser/package.json index 0b03a6a38..d36e550b6 100644 --- a/browser/package.json +++ b/browser/package.json @@ -1,6 +1,6 @@ { "name": "@rollup/browser", - "version": "4.0.0-19", + "version": "4.0.0-21", "description": "Next-generation ES module bundler browser build", "main": "dist/rollup.browser.js", "module": "dist/es/rollup.browser.js", diff --git a/package-lock.json b/package-lock.json index 11e70f240..615f782bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rollup", - "version": "4.0.0-19", + "version": "4.0.0-21", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rollup", - "version": "4.0.0-19", + "version": "4.0.0-21", "license": "MIT", "bin": { "rollup": "dist/bin/rollup" diff --git a/package.json b/package.json index f7b063869..947c3bfc8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rollup", - "version": "4.0.0-19", + "version": "4.0.0-21", "description": "Next-generation ES module bundler", "main": "dist/rollup.js", "module": "dist/es/rollup.js", diff --git a/scripts/postpublish.js b/scripts/postpublish.js index aab24b9a9..572ac69ef 100644 --- a/scripts/postpublish.js +++ b/scripts/postpublish.js @@ -63,29 +63,33 @@ function createReleaseNotes(changelog, tag) { }); } -function postReleaseComments(includedPRs, issues, version) { - const isPreRelease = semverPreRelease(version); - const installNote = isPreRelease +async function postReleaseComments(includedPRs, issues, version) { + const installNote = semverPreRelease(version) ? `Note that this is a pre-release, so to test it, you need to install Rollup via \`npm install rollup@${version}\` or \`npm install rollup@beta\`. It will likely become part of a regular release later.` : 'You can test it via `npm install rollup`.'; - return Promise.all( - includedPRs.map(({ pr, closed }) => - Promise.all([ - issues - .createIssueComment( - pr, - `This PR has been released as part of rollup@${version}. ${installNote}` - ) - .then(() => console.log(cyan(`Added release comment to #${pr}.`))), - ...closed.map(closedPr => - issues - .createIssueComment( - closedPr, - `This issue has been resolved via #${pr} as part of rollup@${version}. ${installNote}` - ) - .then(() => console.log(cyan(`Added fix comment to #${closedPr} via #${pr}.`))) - ) - ]) - ) - ); + + let caughtError = null; + const addComment = (issueNumber, comment) => + // Add a small timeout to avoid rate limiting issues + new Promise(resolve => setTimeout(resolve, 500)).then(() => + issues + .createIssueComment(issueNumber, `${comment} as part of rollup@${version}. ${installNote}`) + .catch(error => { + console.error(error); + caughtError ||= error; + }) + ); + + for (const { pr, closed } of includedPRs) { + await addComment(pr, 'This PR has been released'); + console.log(cyan(`Added release comment to #${pr}.`)); + + for (const closedIssue of closed) { + await addComment(closedIssue, `This issue has been resolved via #${pr}`); + console.log(cyan(`Added fix comment to #${closedIssue} via #${pr}.`)); + } + } + if (caughtError) { + throw caughtError; + } } diff --git a/src/rollup/types.d.ts b/src/rollup/types.d.ts index aeeb213da..3dcd8ab02 100644 --- a/src/rollup/types.d.ts +++ b/src/rollup/types.d.ts @@ -15,8 +15,6 @@ export interface RollupError extends RollupLog { watchFiles?: string[]; } -export type RollupWarning = RollupLog; - export interface RollupLog { binding?: string; cause?: unknown; @@ -598,7 +596,6 @@ export interface NormalizedInputOptions { maxParallelFileOps: number; moduleContext: (id: string) => string; onLog: LogHandler; - onwarn: (warning: RollupLog) => void; perf: boolean; plugins: Plugin[]; preserveEntrySignatures: PreserveEntrySignaturesOption; diff --git a/src/utils/options/mergeOptions.ts b/src/utils/options/mergeOptions.ts index a77e3ad93..9e5448880 100644 --- a/src/utils/options/mergeOptions.ts +++ b/src/utils/options/mergeOptions.ts @@ -53,7 +53,7 @@ export async function mergeOptions( const logLevel = config.logLevel || LOGLEVEL_INFO; const onLog = getOnLog(config, logLevel, printLog); const log = getLogger(plugins, onLog, watchMode, logLevel); - const inputOptions = await mergeInputOptions(config, command, plugins, log, onLog); + const inputOptions = mergeInputOptions(config, command, plugins, log, onLog); if (command.output) { Object.assign(command, command.output); } @@ -75,14 +75,14 @@ export async function mergeOptions( ...Object.keys(commandAliases), 'bundleConfigAsCjs', 'config', + 'configPlugin', 'environment', + 'failAfterWarnings', 'filterLogs', 'plugin', 'silent', - 'failAfterWarnings', 'stdin', - 'waitForBundleInput', - 'configPlugin' + 'waitForBundleInput' ], 'CLI flags', log, diff --git a/src/utils/options/normalizeInputOptions.ts b/src/utils/options/normalizeInputOptions.ts index 18b9b59fa..9ba2c640b 100644 --- a/src/utils/options/normalizeInputOptions.ts +++ b/src/utils/options/normalizeInputOptions.ts @@ -8,7 +8,7 @@ import type { import { EMPTY_ARRAY } from '../blank'; import { ensureArray } from '../ensureArray'; import { getLogger } from '../logger'; -import { LOGLEVEL_INFO, LOGLEVEL_WARN } from '../logging'; +import { LOGLEVEL_INFO } from '../logging'; import { error, logInvalidOption } from '../logs'; import { resolve } from '../path'; import { URL_TREESHAKE, URL_TREESHAKE_MODULESIDEEFFECTS } from '../urls'; @@ -55,7 +55,6 @@ export async function normalizeInputOptions( maxParallelFileOps, moduleContext: getModuleContext(config, context), onLog, - onwarn: warning => onLog(LOGLEVEL_WARN, warning), perf: config.perf || false, plugins, preserveEntrySignatures: config.preserveEntrySignatures ?? 'exports-only', @@ -67,7 +66,7 @@ export async function normalizeInputOptions( warnUnknownOptions( config, - [...Object.keys(options), 'watch'], + [...Object.keys(options), 'onwarn', 'watch'], 'input options', onLog, /^(output)$/ diff --git a/test/function/samples/logging/log-from-plugin-options-onlog-onwarn/_config.js b/test/function/samples/logging/log-from-plugin-options-onlog-onwarn/_config.js index d52c01164..7e1762a9a 100644 --- a/test/function/samples/logging/log-from-plugin-options-onlog-onwarn/_config.js +++ b/test/function/samples/logging/log-from-plugin-options-onlog-onwarn/_config.js @@ -36,18 +36,7 @@ module.exports = defineTest({ ['onLog', 'info', { message: 'infoLog' }], ['info', 'infoLog'], ['onLog', 'debug', { message: 'debugLog' }], - ['debug', 'debugLog'], - ['onLog', 'warn', { message: 'warnWarn' }], - ['onwarn', { message: 'warnWarn' }], - ['warn', 'warnWarn'], - ['onLog', 'warn', { message: 'warnWarn=' }], - ['onwarn', { message: 'warnWarn=' }], - ['onLog', 'warn', { message: 'warnWarn+=' }], - ['onwarn', { message: 'warnWarn+=' }], - ['warn', 'log was replaced'], - ['onLog', 'warn', { message: 'warnWarn-' }], - ['onLog', 'warn', { message: 'warnWarn+-' }], - ['info', 'log was replaced'] + ['debug', 'debugLog'] ]); assert.strictEqual(logs[0][2].toString(), 'warnLog'); assert.strictEqual(logs[1][1].toString(), 'warnLog'); @@ -88,11 +77,6 @@ module.exports = defineTest({ options.onLog('warn', { message: 'warnLog+-' }); options.onLog('info', { message: 'infoLog' }); options.onLog('debug', { message: 'debugLog' }); - options.onwarn({ message: 'warnWarn' }); - options.onwarn({ message: 'warnWarn=' }); - options.onwarn({ message: 'warnWarn+=' }); - options.onwarn({ message: 'warnWarn-' }); - options.onwarn({ message: 'warnWarn+-' }); } } ] diff --git a/test/function/samples/logging/log-from-plugin-options-onlog/_config.js b/test/function/samples/logging/log-from-plugin-options-onlog/_config.js index 5afdcc302..c133d5916 100644 --- a/test/function/samples/logging/log-from-plugin-options-onlog/_config.js +++ b/test/function/samples/logging/log-from-plugin-options-onlog/_config.js @@ -28,14 +28,7 @@ module.exports = defineTest({ ['onLog', 'info', { message: 'infoLog' }], ['info', 'infoLog'], ['onLog', 'debug', { message: 'debugLog' }], - ['debug', 'debugLog'], - ['onLog', 'warn', { message: 'warnWarn' }], - ['warn', 'warnWarn'], - ['onLog', 'warn', { message: 'warnWarn-' }], - ['onLog', 'warn', { message: 'warnWarn+-' }], - ['debug', 'log was replaced'], - ['onLog', 'warn', { message: 'warnWarn*-' }], - ['info', 'log was replaced with string'] + ['debug', 'debugLog'] ]); assert.strictEqual(logs[0][2].toString(), 'warnLog'); assert.strictEqual(logs[2][2].toString(), '(fooPlugin plugin) fooFile (1:2) warnLog'); @@ -68,10 +61,6 @@ module.exports = defineTest({ options.onLog('warn', { message: 'warnLog*-' }); options.onLog('info', { message: 'infoLog' }); options.onLog('debug', { message: 'debugLog' }); - options.onwarn({ message: 'warnWarn' }); - options.onwarn({ message: 'warnWarn-' }); - options.onwarn({ message: 'warnWarn+-' }); - options.onwarn({ message: 'warnWarn*-' }); } } ] diff --git a/test/function/samples/logging/log-from-plugin-options-onwarn/_config.js b/test/function/samples/logging/log-from-plugin-options-onwarn/_config.js index d06b2fc89..7e7c98bf7 100644 --- a/test/function/samples/logging/log-from-plugin-options-onwarn/_config.js +++ b/test/function/samples/logging/log-from-plugin-options-onwarn/_config.js @@ -25,14 +25,7 @@ module.exports = defineTest({ ['onwarn', { message: 'warnLog*-' }], ['warn', 'log was replaced with string'], ['info', 'infoLog'], - ['debug', 'debugLog'], - ['onwarn', { message: 'warnWarn' }], - ['warn', 'warnWarn'], - ['onwarn', { message: 'warnWarn-' }], - ['onwarn', { message: 'warnWarn+-' }], - ['warn', 'log was replaced'], - ['onwarn', { message: 'warnWarn*-' }], - ['warn', 'log was replaced with string'] + ['debug', 'debugLog'] ]); assert.strictEqual(logs[0][1].toString(), 'warnLog'); assert.strictEqual(logs[2][1].toString(), '(fooPlugin plugin) fooFile (1:2) warnLog'); @@ -65,10 +58,6 @@ module.exports = defineTest({ options.onLog('warn', { message: 'warnLog*-' }); options.onLog('info', { message: 'infoLog' }); options.onLog('debug', { message: 'debugLog' }); - options.onwarn({ message: 'warnWarn' }); - options.onwarn({ message: 'warnWarn-' }); - options.onwarn({ message: 'warnWarn+-' }); - options.onwarn({ message: 'warnWarn*-' }); } } ] diff --git a/test/function/samples/logging/log-from-plugin-options-simple/_config.js b/test/function/samples/logging/log-from-plugin-options-simple/_config.js index 434e571dc..607548a57 100644 --- a/test/function/samples/logging/log-from-plugin-options-simple/_config.js +++ b/test/function/samples/logging/log-from-plugin-options-simple/_config.js @@ -15,14 +15,12 @@ module.exports = defineTest({ assert.deepStrictEqual(logs, [ ['warn', 'warnLog'], ['info', 'infoLog'], - ['debug', 'debugLog'], - ['warn', 'warnWarn'] + ['debug', 'debugLog'] ]); assert.deepStrictEqual(pluginLogs, [ ['warn', { message: 'warnLog' }], ['info', { message: 'infoLog' }], - ['debug', { message: 'debugLog' }], - ['warn', { message: 'warnWarn' }] + ['debug', { message: 'debugLog' }] ]); }, options: { @@ -36,7 +34,6 @@ module.exports = defineTest({ options.onLog('warn', { message: 'warnLog' }); options.onLog('info', { message: 'infoLog' }); options.onLog('debug', { message: 'debugLog' }); - options.onwarn({ message: 'warnWarn' }); }, onLog(level, log) { pluginLogs.push([level, log]); From fda977bb38ab31638c3a4a18e0c4f8b9c8482e6c Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Tue, 26 Sep 2023 17:43:18 +0200 Subject: [PATCH 08/44] [v4.0] Add parse option to allow return outside function (#5154) Allow return outside functions --- browser/package.json | 2 +- docs/plugin-development/index.md | 18 ++++-- native.d.ts | 2 +- package-lock.json | 4 +- package.json | 2 +- rust/bindings_napi/src/lib.rs | 4 +- rust/bindings_wasm/src/lib.rs | 4 +- rust/parse_ast/src/lib.rs | 3 +- src/Graph.ts | 7 ++- src/rollup/types.d.ts | 2 +- .../parse-return-outside-function/_config.js | 56 +++++++++++++++++++ .../parse-return-outside-function/main.js | 13 +++++ test/utils.js | 3 + 13 files changed, 102 insertions(+), 18 deletions(-) create mode 100644 test/function/samples/parse-return-outside-function/_config.js create mode 100644 test/function/samples/parse-return-outside-function/main.js diff --git a/browser/package.json b/browser/package.json index d36e550b6..6e4703a0b 100644 --- a/browser/package.json +++ b/browser/package.json @@ -1,6 +1,6 @@ { "name": "@rollup/browser", - "version": "4.0.0-21", + "version": "4.0.0-22", "description": "Next-generation ES module bundler browser build", "main": "dist/rollup.browser.js", "module": "dist/es/rollup.browser.js", diff --git a/docs/plugin-development/index.md b/docs/plugin-development/index.md index ad4cc6554..53be2a707 100644 --- a/docs/plugin-development/index.md +++ b/docs/plugin-development/index.md @@ -311,7 +311,7 @@ interface SourceDescription { } ``` -Defines a custom loader. Returning `null` defers to other `load` functions (and eventually the default behavior of loading from the file system). To prevent additional parsing overhead in case e.g. this hook already used `this.parse` to generate an AST for some reason, this hook can optionally return a `{ code, ast, map }` object. The `ast` must be a standard ESTree AST with `start` and `end` properties for each node. If the transformation does not move code, you can preserve existing sourcemaps by setting `map` to `null`. Otherwise, you might need to generate the source map. See the section on [source code transformations](#source-code-transformations). +Defines a custom loader. Returning `null` defers to other `load` functions (and eventually the default behavior of loading from the file system). To prevent additional parsing overhead in case e.g. this hook already used [`this.parse`](#this-parse) to generate an AST for some reason, this hook can optionally return a `{ code, ast, map }` object. The `ast` must be a standard ESTree AST with `start` and `end` properties for each node. If the transformation does not move code, you can preserve existing sourcemaps by setting `map` to `null`. Otherwise, you might need to generate the source map. See the section on [source code transformations](#source-code-transformations). If `false` is returned for `moduleSideEffects` and no other module imports anything from this module, then this module will not be included in the bundle even if the module would have side effects. If `true` is returned, Rollup will use its default algorithm to include all statements in the module that have side effects (such as modifying a global or exported variable). If `"no-treeshake"` is returned, treeshaking will be turned off for this module and it will also be included in one of the generated chunks even if it is empty. If `null` is returned or the flag is omitted, then `moduleSideEffects` will be determined by the first `resolveId` hook that resolved this module, the [`treeshake.moduleSideEffects`](../configuration-options/index.md#treeshake-modulesideeffects) option, or eventually default to `true`. The `transform` hook can override this. @@ -647,7 +647,7 @@ interface SourceDescription { } ``` -Can be used to transform individual modules. To prevent additional parsing overhead in case e.g. this hook already used `this.parse` to generate an AST for some reason, this hook can optionally return a `{ code, ast, map }` object. The `ast` must be a standard ESTree AST with `start` and `end` properties for each node. If the transformation does not move code, you can preserve existing sourcemaps by setting `map` to `null`. Otherwise, you might need to generate the source map. See [the section on source code transformations](#source-code-transformations). +Can be used to transform individual modules. To prevent additional parsing overhead in case e.g. this hook already used [`this.parse`](#this-parse) to generate an AST for some reason, this hook can optionally return a `{ code, ast, map }` object. The `ast` must be a standard ESTree AST with `start` and `end` properties for each node. If the transformation does not move code, you can preserve existing sourcemaps by setting `map` to `null`. Otherwise, you might need to generate the source map. See [the section on source code transformations](#source-code-transformations). Note that in watch mode or when using the cache explicitly, the result of this hook is cached when rebuilding and the hook is only triggered again for a module `id` if either the `code` of the module has changed or a file has changed that was added via `this.addWatchFile` the last time the hook was triggered for this module. @@ -1659,12 +1659,20 @@ An object containing potentially useful Rollup metadata: ### this.parse -| | | -| ----: | :--------------------------------- | -| Type: | `(code: string) => ESTree.Program` | +| | | +| ----: | :--------------------------------------------------------- | +| Type: | `(code: string, options?: ParseOptions) => ESTree.Program` | + +```typescript +interface ParseOptions { + allowReturnOutsideFunction?: boolean; +} +``` Use Rollup's internal SWC-based parser to parse code to an AST. +- `allowReturnOutsideFunction`: When `true` this allows return statements to be outside functions to e.g. support parsing CommonJS code. + ### this.resolve | | | diff --git a/native.d.ts b/native.d.ts index 6976f78bb..d96365261 100644 --- a/native.d.ts +++ b/native.d.ts @@ -3,4 +3,4 @@ /* auto-generated by NAPI-RS */ -export function parse(code: string): Buffer +export function parse(code: string, allowReturnOutsideFunction: boolean): Buffer diff --git a/package-lock.json b/package-lock.json index 615f782bb..6ff70c06d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rollup", - "version": "4.0.0-21", + "version": "4.0.0-22", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rollup", - "version": "4.0.0-21", + "version": "4.0.0-22", "license": "MIT", "bin": { "rollup": "dist/bin/rollup" diff --git a/package.json b/package.json index 947c3bfc8..995285525 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rollup", - "version": "4.0.0-21", + "version": "4.0.0-22", "description": "Next-generation ES module bundler", "main": "dist/rollup.js", "module": "dist/es/rollup.js", diff --git a/rust/bindings_napi/src/lib.rs b/rust/bindings_napi/src/lib.rs index 2a0087abf..295c404b3 100644 --- a/rust/bindings_napi/src/lib.rs +++ b/rust/bindings_napi/src/lib.rs @@ -5,6 +5,6 @@ use napi_derive::napi; use parse_ast::parse_ast; #[napi] -pub fn parse(code: String) -> Buffer { - parse_ast(code).into() +pub fn parse(code: String, allow_return_outside_function: bool) -> Buffer { + parse_ast(code, allow_return_outside_function).into() } diff --git a/rust/bindings_wasm/src/lib.rs b/rust/bindings_wasm/src/lib.rs index f75a62ab3..bc2c05455 100644 --- a/rust/bindings_wasm/src/lib.rs +++ b/rust/bindings_wasm/src/lib.rs @@ -2,6 +2,6 @@ use parse_ast::parse_ast; use wasm_bindgen::prelude::*; #[wasm_bindgen] -pub fn parse(code: String) -> Vec { - parse_ast(code) +pub fn parse(code: String, allow_return_outside_function: bool) -> Vec { + parse_ast(code, allow_return_outside_function) } diff --git a/rust/parse_ast/src/lib.rs b/rust/parse_ast/src/lib.rs index 2138546b3..02061d427 100644 --- a/rust/parse_ast/src/lib.rs +++ b/rust/parse_ast/src/lib.rs @@ -23,10 +23,11 @@ fn get_compiler() -> Arc { Arc::new(Compiler::new(cm)) } -pub fn parse_ast(code: String) -> Vec { +pub fn parse_ast(code: String, allow_return_outside_function: bool) -> Vec { let compiler = get_compiler(); let compiler_options = ParseOptions { syntax: Syntax::Es(EsConfig { + allow_return_outside_function, import_attributes: true, ..Default::default() }), diff --git a/src/Graph.ts b/src/Graph.ts index 80bf42a46..c61a2f7b6 100644 --- a/src/Graph.ts +++ b/src/Graph.ts @@ -123,8 +123,11 @@ export default class Graph { this.phase = BuildPhase.GENERATE; } - contextParse(code: string): AstNode { - const astBuffer = native.parse(code); + contextParse( + code: string, + { allowReturnOutsideFunction = false }: { allowReturnOutsideFunction?: boolean } = {} + ): AstNode { + const astBuffer = native.parse(code, allowReturnOutsideFunction); const readString = getReadStringFunction(astBuffer); return convertProgram(astBuffer.buffer, readString); } diff --git a/src/rollup/types.d.ts b/src/rollup/types.d.ts index 3dcd8ab02..907d1df32 100644 --- a/src/rollup/types.d.ts +++ b/src/rollup/types.d.ts @@ -215,7 +215,7 @@ export interface PluginContext extends MinimalPluginContext { load: ( options: { id: string; resolveDependencies?: boolean } & Partial> ) => Promise; - parse: (input: string) => AstNode; + parse: (input: string, options?: { allowReturnOutsideFunction?: boolean }) => AstNode; resolve: ( source: string, importer?: string, diff --git a/test/function/samples/parse-return-outside-function/_config.js b/test/function/samples/parse-return-outside-function/_config.js new file mode 100644 index 000000000..862bda7d7 --- /dev/null +++ b/test/function/samples/parse-return-outside-function/_config.js @@ -0,0 +1,56 @@ +const assert = require('node:assert'); +const { compareError } = require('../../../utils'); + +module.exports = defineTest({ + description: 'supports parsing return statements outside functions via options', + options: { + plugins: [ + { + name: 'test', + buildStart() { + assert.deepStrictEqual( + this.parse('return foo', { + allowReturnOutsideFunction: true + }), + { + type: 'Program', + start: 0, + end: 10, + body: [ + { + type: 'ReturnStatement', + start: 0, + end: 10, + argument: { type: 'Identifier', start: 7, end: 10, name: 'foo' } + } + ], + sourceType: 'module' + } + ); + let expectedError = null; + try { + this.parse('return foo', { + allowReturnOutsideFunction: false + }); + } catch (error) { + expectedError = error; + } + compareError(expectedError, { + message: 'Return statement is not allowed here', + pos: 0 + }); + expectedError = null; + try { + this.parse('return foo'); + } catch (error) { + expectedError = error; + } + compareError(expectedError, { + message: 'Return statement is not allowed here', + pos: 0 + }); + } + } + ] + } +}); diff --git a/test/function/samples/parse-return-outside-function/main.js b/test/function/samples/parse-return-outside-function/main.js new file mode 100644 index 000000000..69b8f8f79 --- /dev/null +++ b/test/function/samples/parse-return-outside-function/main.js @@ -0,0 +1,13 @@ +let effect = false; + +var b = { + get a() { + effect = true; + } +}; + +function X() {} +X.prototype = b; +new X().a; + +assert.ok(effect); diff --git a/test/utils.js b/test/utils.js index fdd1433a4..d44e2e677 100644 --- a/test/utils.js +++ b/test/utils.js @@ -39,6 +39,9 @@ exports.wait = function wait(ms) { }; function normaliseError(error) { + if (!error) { + throw new Error(`Expected an error but got ${JSON.stringify(error)}`); + } const clone = { ...error, message: error.message }; delete clone.stack; delete clone.toString; From 0b0eabd8cd93de7c6b69c95a4cac24559c040b80 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Tue, 26 Sep 2023 21:49:17 +0200 Subject: [PATCH 09/44] [v4.0] Handle empty exports (#5157) Handle empty exports --- browser/package.json | 2 +- package-lock.json | 10 +++++----- package.json | 2 +- rust/parse_ast/src/convert_ast/converter.rs | 19 ++++++++++--------- test/form/samples/empty-export/_config.js | 3 +++ .../samples/empty-export/_expected/amd.js | 5 +++++ .../samples/empty-export/_expected/cjs.js | 3 +++ .../form/samples/empty-export/_expected/es.js | 1 + .../samples/empty-export/_expected/iife.js | 6 ++++++ .../samples/empty-export/_expected/system.js | 10 ++++++++++ .../samples/empty-export/_expected/umd.js | 8 ++++++++ test/form/samples/empty-export/main.js | 2 ++ 12 files changed, 55 insertions(+), 16 deletions(-) create mode 100644 test/form/samples/empty-export/_config.js create mode 100644 test/form/samples/empty-export/_expected/amd.js create mode 100644 test/form/samples/empty-export/_expected/cjs.js create mode 100644 test/form/samples/empty-export/_expected/es.js create mode 100644 test/form/samples/empty-export/_expected/iife.js create mode 100644 test/form/samples/empty-export/_expected/system.js create mode 100644 test/form/samples/empty-export/_expected/umd.js create mode 100644 test/form/samples/empty-export/main.js diff --git a/browser/package.json b/browser/package.json index 6e4703a0b..1e66f1b45 100644 --- a/browser/package.json +++ b/browser/package.json @@ -1,6 +1,6 @@ { "name": "@rollup/browser", - "version": "4.0.0-22", + "version": "4.0.0-23", "description": "Next-generation ES module bundler browser build", "main": "dist/rollup.browser.js", "module": "dist/es/rollup.browser.js", diff --git a/package-lock.json b/package-lock.json index 6ff70c06d..08a4c95b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rollup", - "version": "4.0.0-22", + "version": "4.0.0-23", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rollup", - "version": "4.0.0-22", + "version": "4.0.0-23", "license": "MIT", "bin": { "rollup": "dist/bin/rollup" @@ -2000,9 +2000,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "14.18.63", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.63.tgz", - "integrity": "sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==", + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.0.0.tgz", + "integrity": "sha512-cHlGmko4gWLVI27cGJntjs/Sj8th9aYwplmZFwmmgYQQvL5NUsgVJG7OddLvNfLqYS31KFN0s3qlaD9qCaxACA==", "dev": true }, "node_modules/@types/normalize-package-data": { diff --git a/package.json b/package.json index 995285525..2906e1120 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rollup", - "version": "4.0.0-22", + "version": "4.0.0-23", "description": "Next-generation ES module bundler", "main": "dist/rollup.js", "module": "dist/es/rollup.js", diff --git a/rust/parse_ast/src/convert_ast/converter.rs b/rust/parse_ast/src/convert_ast/converter.rs index 0f65625d6..bd41fa03b 100644 --- a/rust/parse_ast/src/convert_ast/converter.rs +++ b/rust/parse_ast/src/convert_ast/converter.rs @@ -674,14 +674,15 @@ impl<'a> AstConverter<'a> { } fn convert_export_named_declaration(&mut self, export_named_declaration: &NamedExport) { - match export_named_declaration.specifiers.first().unwrap() { - ExportSpecifier::Namespace(export_namespace_specifier) => self.store_export_all_declaration( - &export_named_declaration.span, - export_named_declaration.src.as_ref().unwrap(), - &export_named_declaration.with, - Some(&export_namespace_specifier.name), - ), - ExportSpecifier::Named(_) => self.store_export_named_declaration( + match export_named_declaration.specifiers.first() { + Some(ExportSpecifier::Namespace(export_namespace_specifier)) => self + .store_export_all_declaration( + &export_named_declaration.span, + export_named_declaration.src.as_ref().unwrap(), + &export_named_declaration.with, + Some(&export_namespace_specifier.name), + ), + None | Some(ExportSpecifier::Named(_)) => self.store_export_named_declaration( &export_named_declaration.span, &export_named_declaration.specifiers, export_named_declaration @@ -691,7 +692,7 @@ impl<'a> AstConverter<'a> { None, &export_named_declaration.with, ), - ExportSpecifier::Default(_) => panic!("Unexpected default export specifier"), + Some(ExportSpecifier::Default(_)) => panic!("Unexpected default export specifier"), } } diff --git a/test/form/samples/empty-export/_config.js b/test/form/samples/empty-export/_config.js new file mode 100644 index 000000000..ea67178e3 --- /dev/null +++ b/test/form/samples/empty-export/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'handles empty exports' +}); diff --git a/test/form/samples/empty-export/_expected/amd.js b/test/form/samples/empty-export/_expected/amd.js new file mode 100644 index 000000000..49540b44d --- /dev/null +++ b/test/form/samples/empty-export/_expected/amd.js @@ -0,0 +1,5 @@ +define((function () { 'use strict'; + + console.log('main'); + +})); diff --git a/test/form/samples/empty-export/_expected/cjs.js b/test/form/samples/empty-export/_expected/cjs.js new file mode 100644 index 000000000..d0ed06d8c --- /dev/null +++ b/test/form/samples/empty-export/_expected/cjs.js @@ -0,0 +1,3 @@ +'use strict'; + +console.log('main'); diff --git a/test/form/samples/empty-export/_expected/es.js b/test/form/samples/empty-export/_expected/es.js new file mode 100644 index 000000000..c0b933d7b --- /dev/null +++ b/test/form/samples/empty-export/_expected/es.js @@ -0,0 +1 @@ +console.log('main'); diff --git a/test/form/samples/empty-export/_expected/iife.js b/test/form/samples/empty-export/_expected/iife.js new file mode 100644 index 000000000..455edee6a --- /dev/null +++ b/test/form/samples/empty-export/_expected/iife.js @@ -0,0 +1,6 @@ +(function () { + 'use strict'; + + console.log('main'); + +})(); diff --git a/test/form/samples/empty-export/_expected/system.js b/test/form/samples/empty-export/_expected/system.js new file mode 100644 index 000000000..35e269337 --- /dev/null +++ b/test/form/samples/empty-export/_expected/system.js @@ -0,0 +1,10 @@ +System.register([], (function () { + 'use strict'; + return { + execute: (function () { + + console.log('main'); + + }) + }; +})); diff --git a/test/form/samples/empty-export/_expected/umd.js b/test/form/samples/empty-export/_expected/umd.js new file mode 100644 index 000000000..c8ba7daa8 --- /dev/null +++ b/test/form/samples/empty-export/_expected/umd.js @@ -0,0 +1,8 @@ +(function (factory) { + typeof define === 'function' && define.amd ? define(factory) : + factory(); +})((function () { 'use strict'; + + console.log('main'); + +})); diff --git a/test/form/samples/empty-export/main.js b/test/form/samples/empty-export/main.js new file mode 100644 index 000000000..40f1e1d7b --- /dev/null +++ b/test/form/samples/empty-export/main.js @@ -0,0 +1,2 @@ +console.log('main'); +export {}; From fbc25afcc2e494b562358479524a88ab8fe0f1bf Mon Sep 17 00:00:00 2001 From: XiaoPi <530257315@qq.com> Date: Sat, 30 Sep 2023 22:10:07 +0800 Subject: [PATCH 10/44] [v4.0] feat: implement hashing content in Rust (#5155) --- browser/LICENSE.md | 51 +------------------ browser/src/crypto.ts | 6 --- browser/src/wasm.ts | 6 +-- build-plugins/replace-browser-modules.ts | 1 - native.d.ts | 1 + native.js | 3 +- rust/Cargo.lock | 27 +++++++++- rust/Cargo.toml | 1 + rust/bindings_napi/Cargo.toml | 1 + rust/bindings_napi/src/lib.rs | 6 +++ rust/bindings_wasm/Cargo.toml | 2 + rust/bindings_wasm/src/lib.rs | 7 +++ rust/parse_ast/src/lib.rs | 3 +- rust/xxhash/Cargo.toml | 10 ++++ rust/xxhash/src/lib.rs | 7 +++ src/Graph.ts | 4 +- src/utils/FileEmitter.ts | 12 ++--- src/utils/crypto.ts | 18 ++++++- src/utils/hashPlaceholders.ts | 4 +- src/utils/renderChunks.ts | 21 ++++---- .../{dep-bd733981.js => dep-KkHNeB29.js} | 0 .../_expected/main-70712c1f.js | 3 -- .../_expected/main-pNv0QjL6.js | 3 ++ .../{b94d27b9-test.txt => x7YVzHWH-test.txt} | 0 .../{b94d27b9-test.txt => x7YVzHWH-test.txt} | 0 .../{b94d27b9-test.txt => x7YVzHWH-test.txt} | 0 .../{b94d27b9-test.txt => x7YVzHWH-test.txt} | 0 .../emit-file/deduplicate-assets/_config.js | 18 +++---- ...uffer-d0ca8c2a.txt => buffer-fV9J_shM.txt} | 0 ...-e8d9b528.txt => otherBuffer-Oh78Hjdg.txt} | 0 ...-e296c1ca.txt => otherString-PiT4klzx.txt} | 0 ...ing1-473287f8.txt => string1-PAAt4eb8.txt} | 0 ...uffer-d0ca8c2a.txt => buffer-fV9J_shM.txt} | 0 ...-e8d9b528.txt => otherBuffer-Oh78Hjdg.txt} | 0 ...-e296c1ca.txt => otherString-PiT4klzx.txt} | 0 ...ing1-473287f8.txt => string1-PAAt4eb8.txt} | 0 ...uffer-d0ca8c2a.txt => buffer-fV9J_shM.txt} | 0 ...-e8d9b528.txt => otherBuffer-Oh78Hjdg.txt} | 0 ...-e296c1ca.txt => otherString-PiT4klzx.txt} | 0 ...ing1-473287f8.txt => string1-PAAt4eb8.txt} | 0 ...uffer-d0ca8c2a.txt => buffer-fV9J_shM.txt} | 0 ...-e8d9b528.txt => otherBuffer-Oh78Hjdg.txt} | 0 ...-e296c1ca.txt => otherString-PiT4klzx.txt} | 0 ...ing1-473287f8.txt => string1-PAAt4eb8.txt} | 0 .../assets/{asset-b94d27b9 => asset-x7YVzHWH} | 0 .../assets/{asset-b94d27b9 => asset-x7YVzHWH} | 0 .../assets/{asset-b94d27b9 => asset-x7YVzHWH} | 0 .../assets/{asset-b94d27b9 => asset-x7YVzHWH} | 0 ...anner-8c7ed2d9.txt => banner-Pqjybijy.txt} | 0 ...End-6e08d992.txt => buildEnd-bjZfkWaR.txt} | 0 ...t-db9421f6.txt => buildStart-jUsAaHhv.txt} | 0 ...ooter-0301844c.txt => footer-lepGH7ft.txt} | 0 ...9a4e56.txt => generateBundle-YC5K5IqI.txt} | 0 ...{intro-c432b372.txt => intro-NT6UL-Ie.txt} | 0 .../{load-0cf67fc7.txt => load-f5EgoTqv.txt} | 0 ...{outro-1e5fe046.txt => outro-_McFrfAR.txt} | 0 ...-aa9e49b7.txt => renderChunk-DMYyTWqj.txt} | 0 ...-981aa2ea.txt => renderStart-eFzm3QZM.txt} | 0 ...Id-dd9bb7f8.txt => resolveId-go8NkbCx.txt} | 0 ...rm-aa214ea3.txt => transform-PQ2olIjk.txt} | 0 ...anner-8c7ed2d9.txt => banner-Pqjybijy.txt} | 0 ...End-6e08d992.txt => buildEnd-bjZfkWaR.txt} | 0 ...t-db9421f6.txt => buildStart-jUsAaHhv.txt} | 0 ...ooter-0301844c.txt => footer-lepGH7ft.txt} | 0 ...9a4e56.txt => generateBundle-YC5K5IqI.txt} | 0 ...{intro-c432b372.txt => intro-NT6UL-Ie.txt} | 0 .../{load-0cf67fc7.txt => load-f5EgoTqv.txt} | 0 ...{outro-1e5fe046.txt => outro-_McFrfAR.txt} | 0 ...-aa9e49b7.txt => renderChunk-DMYyTWqj.txt} | 0 ...-981aa2ea.txt => renderStart-eFzm3QZM.txt} | 0 ...Id-dd9bb7f8.txt => resolveId-go8NkbCx.txt} | 0 ...rm-aa214ea3.txt => transform-PQ2olIjk.txt} | 0 ...anner-8c7ed2d9.txt => banner-Pqjybijy.txt} | 0 ...End-6e08d992.txt => buildEnd-bjZfkWaR.txt} | 0 ...t-db9421f6.txt => buildStart-jUsAaHhv.txt} | 0 ...ooter-0301844c.txt => footer-lepGH7ft.txt} | 0 ...9a4e56.txt => generateBundle-YC5K5IqI.txt} | 0 ...{intro-c432b372.txt => intro-NT6UL-Ie.txt} | 0 .../{load-0cf67fc7.txt => load-f5EgoTqv.txt} | 0 ...{outro-1e5fe046.txt => outro-_McFrfAR.txt} | 0 ...-aa9e49b7.txt => renderChunk-DMYyTWqj.txt} | 0 ...-981aa2ea.txt => renderStart-eFzm3QZM.txt} | 0 ...Id-dd9bb7f8.txt => resolveId-go8NkbCx.txt} | 0 ...rm-aa214ea3.txt => transform-PQ2olIjk.txt} | 0 ...anner-8c7ed2d9.txt => banner-Pqjybijy.txt} | 0 ...End-6e08d992.txt => buildEnd-bjZfkWaR.txt} | 0 ...t-db9421f6.txt => buildStart-jUsAaHhv.txt} | 0 ...ooter-0301844c.txt => footer-lepGH7ft.txt} | 0 ...9a4e56.txt => generateBundle-YC5K5IqI.txt} | 0 ...{intro-c432b372.txt => intro-NT6UL-Ie.txt} | 0 .../{load-0cf67fc7.txt => load-f5EgoTqv.txt} | 0 ...{outro-1e5fe046.txt => outro-_McFrfAR.txt} | 0 ...-aa9e49b7.txt => renderChunk-DMYyTWqj.txt} | 0 ...-981aa2ea.txt => renderStart-eFzm3QZM.txt} | 0 ...Id-dd9bb7f8.txt => resolveId-go8NkbCx.txt} | 0 ...rm-aa214ea3.txt => transform-PQ2olIjk.txt} | 0 .../{test-b94d27b9.txt => test-x7YVzHWH.txt} | 0 .../{test-b94d27b9.txt => test-x7YVzHWH.txt} | 0 .../{test-b94d27b9.txt => test-x7YVzHWH.txt} | 0 .../{test-b94d27b9.txt => test-x7YVzHWH.txt} | 0 ...e45a9-amd.js => chunk-deb-9YxNr2n5-amd.js} | 0 ...024b-amd.js => entry-main-2WHbe7ly-amd.js} | 2 +- .../{b94d27b9-test.txt => x7YVzHWH-test.txt} | 0 ...05607-cjs.js => chunk-deb-KO3me1q0-cjs.js} | 0 ...66d3-cjs.js => entry-main-GKdCatel-cjs.js} | 2 +- .../{b94d27b9-test.txt => x7YVzHWH-test.txt} | 0 ...f85baf7-es.js => chunk-deb-3ItlXRQy-es.js} | 0 .../_expected/es/entry-main-080ad38c-es.js | 2 - .../_expected/es/entry-main-mA3J9obY-es.js | 2 + .../{b94d27b9-test.txt => x7YVzHWH-test.txt} | 0 ...system.js => chunk-deb-BJKR2fPr-system.js} | 0 ...ystem.js => entry-main-ljrLE_qG-system.js} | 2 +- .../{b94d27b9-test.txt => x7YVzHWH-test.txt} | 0 ...{logo1-60bc15c4.svg => logo1-BarkEXVd.svg} | 0 ...{logo2-fdaa7478.svg => logo2-yX706C0w.svg} | 0 .../reference-files/_expected/amd/main.js | 2 +- .../_expected/amd/nested/chunk.js | 2 +- ...{logo1-60bc15c4.svg => logo1-BarkEXVd.svg} | 0 ...{logo2-fdaa7478.svg => logo2-yX706C0w.svg} | 0 .../reference-files/_expected/cjs/main.js | 2 +- .../_expected/cjs/nested/chunk.js | 2 +- ...{logo1-60bc15c4.svg => logo1-BarkEXVd.svg} | 0 ...{logo2-fdaa7478.svg => logo2-yX706C0w.svg} | 0 .../reference-files/_expected/es/main.js | 2 +- .../_expected/es/nested/chunk.js | 2 +- ...{logo1-60bc15c4.svg => logo1-BarkEXVd.svg} | 0 ...{logo2-fdaa7478.svg => logo2-yX706C0w.svg} | 0 .../reference-files/_expected/system/main.js | 2 +- .../_expected/system/nested/chunk.js | 2 +- ...anner-8c7ed2d9.txt => banner-Pqjybijy.txt} | 0 ...ooter-0301844c.txt => footer-lepGH7ft.txt} | 0 .../amd/assets/generateBundle-6922b0a1.txt | 1 - .../amd/assets/generateBundle-KcqLI9cb.txt | 1 + ...txt => generateBundle-format-5jVvk-26.txt} | 0 ...{intro-c432b372.txt => intro-NT6UL-Ie.txt} | 0 ...{outro-1e5fe046.txt => outro-_McFrfAR.txt} | 0 ...-aa9e49b7.txt => renderChunk-DMYyTWqj.txt} | 0 ...-981aa2ea.txt => renderStart-eFzm3QZM.txt} | 0 .../_expected/amd/generateBundle.txt | 2 +- .../set-asset-source/_expected/amd/main.js | 2 +- ...anner-8c7ed2d9.txt => banner-Pqjybijy.txt} | 0 ...ooter-0301844c.txt => footer-lepGH7ft.txt} | 0 .../cjs/assets/generateBundle-b1a5f14c.txt | 1 - ...txt => generateBundle-format-9Z73n2OP.txt} | 0 .../cjs/assets/generateBundle-yF5Q0doc.txt | 1 + ...{intro-c432b372.txt => intro-NT6UL-Ie.txt} | 0 ...{outro-1e5fe046.txt => outro-_McFrfAR.txt} | 0 ...-aa9e49b7.txt => renderChunk-DMYyTWqj.txt} | 0 ...-981aa2ea.txt => renderStart-eFzm3QZM.txt} | 0 .../_expected/cjs/generateBundle.txt | 2 +- .../set-asset-source/_expected/cjs/main.js | 2 +- ...anner-8c7ed2d9.txt => banner-Pqjybijy.txt} | 0 ...ooter-0301844c.txt => footer-lepGH7ft.txt} | 0 .../es/assets/generateBundle-668db42d.txt | 1 - .../es/assets/generateBundle-9uv4IgKv.txt | 1 + ...txt => generateBundle-format-en7tITil.txt} | 0 ...{intro-c432b372.txt => intro-NT6UL-Ie.txt} | 0 ...{outro-1e5fe046.txt => outro-_McFrfAR.txt} | 0 ...-aa9e49b7.txt => renderChunk-DMYyTWqj.txt} | 0 ...-981aa2ea.txt => renderStart-eFzm3QZM.txt} | 0 .../_expected/es/generateBundle.txt | 2 +- .../set-asset-source/_expected/es/main.js | 2 +- ...anner-8c7ed2d9.txt => banner-Pqjybijy.txt} | 0 ...ooter-0301844c.txt => footer-lepGH7ft.txt} | 0 .../system/assets/generateBundle-WoWY_GTC.txt | 1 + .../system/assets/generateBundle-b0505b8f.txt | 1 - ...txt => generateBundle-format-XDhKOEdw.txt} | 0 ...{intro-c432b372.txt => intro-NT6UL-Ie.txt} | 0 ...{outro-1e5fe046.txt => outro-_McFrfAR.txt} | 0 ...-aa9e49b7.txt => renderChunk-DMYyTWqj.txt} | 0 ...-981aa2ea.txt => renderStart-eFzm3QZM.txt} | 0 .../_expected/system/generateBundle.txt | 2 +- .../set-asset-source/_expected/system/main.js | 2 +- ...db6-amd.js => chunk-main2-cf881rtr-amd.js} | 0 .../_expected/amd/entry-main1-94fe149e-amd.js | 5 -- .../_expected/amd/entry-main1-CBKFi7eG-amd.js | 5 ++ .../_expected/amd/entry-main2-16bafa95-amd.js | 7 --- .../_expected/amd/entry-main2-U19f7Kkv-amd.js | 7 +++ ...5fc-cjs.js => chunk-main2-2eAijmim-cjs.js} | 0 .../_expected/cjs/entry-main1-2934d4fa-cjs.js | 5 -- .../_expected/cjs/entry-main1-i42FQ2i5-cjs.js | 5 ++ .../_expected/cjs/entry-main2-523204ff-cjs.js | 7 --- .../_expected/cjs/entry-main2-e914JHZ0-cjs.js | 7 +++ ...fce1a-es.js => chunk-main2-IiSmXREe-es.js} | 0 .../_expected/es/entry-main1-6f12c5b2-es.js | 3 -- .../_expected/es/entry-main1-JQIS3SKF-es.js | 3 ++ .../_expected/es/entry-main2-6DNkLKmG-es.js | 1 + .../_expected/es/entry-main2-a9b323b4-es.js | 1 - ...stem.js => chunk-main2-cN2LIF0L-system.js} | 0 ...stem.js => entry-main1-3xo1S8a0-system.js} | 2 +- ...stem.js => entry-main2-RI9cN2Cj-system.js} | 2 +- .../{entry-7061c38c.js => entry-BjVZZvuI.js} | 0 .../{entry-82a5a8a4.js => entry-_kM9k9Bx.js} | 0 .../{entry-8011025d.js => entry-BAMj_W0O.js} | 0 .../{entry-fc7b26ff.js => entry-ivriA37N.js} | 0 .../{entry-2b8647b5.js => entry-Gs557UIb.js} | 0 .../{entry-369b04c8.js => entry-Y0flmsE_.js} | 0 .../{entry-54240e14.js => entry-aiNN2RB-.js} | 0 .../{entry-ed8fdbb3.js => entry-yZdFXPRq.js} | 0 .../entry-_kM9k9Bx.js} | 0 .../entry-ivriA37N.js} | 0 .../entry-Y0flmsE_.js} | 0 .../entry-yZdFXPRq.js} | 0 ...905830720d5f3.js => dep-eCO4iyaHEVP2U2.js} | 0 .../hash-size/_expected/amd/main1-9bGLbd-q.js | 5 ++ .../hash-size/_expected/amd/main1-eb0f074f.js | 5 -- .../_expected/amd/main2-5gkbLhN4J6.js | 5 ++ .../_expected/amd/main2-b24fb22e7f.js | 5 -- ...7d659a.txt => test-uF-4QoZ1HtBY01G94-.txt} | 0 ...f12b4bf62a634.js => dep-YVivKZa3-xWdJj.js} | 0 .../{main1-87405ba3.js => main1-hNgwlFpU.js} | 2 +- ...ain2-b2c59bdf14.js => main2-VmtfVxsamQ.js} | 2 +- ...7d659a.txt => test-uF-4QoZ1HtBY01G94-.txt} | 0 ...d6f5744f7fc9c.js => dep-zBY_VBiSge8Mj4.js} | 0 .../hash-size/_expected/es/main1-bcca55a1.js | 3 -- .../hash-size/_expected/es/main1-fjlEGKoF.js | 3 ++ .../_expected/es/main2-83d7b451fa.js | 3 -- .../_expected/es/main2-_s3jGKh5RD.js | 3 ++ ...7d659a.txt => test-uF-4QoZ1HtBY01G94-.txt} | 0 ...26bb5df3105f7.js => dep-hy-CAAd7JeW4I2.js} | 0 .../{main1-c5eecf00.js => main1-YgtCdyy2.js} | 2 +- ...ain2-842e475e5e.js => main2-dDGqHpvMDz.js} | 2 +- ...7d659a.txt => test-uF-4QoZ1HtBY01G94-.txt} | 0 ...js => entry-1UjYC2I--1UjYC2I--!~{123}~.js} | 2 +- ...js => entry-r0OE6QqP-r0OE6QqP-!~{123}~.js} | 2 +- ...js => entry-0i8gYiAL-0i8gYiAL-!~{123}~.js} | 2 +- ...js => entry-uj5cAyaj-uj5cAyaj-!~{123}~.js} | 2 +- .../amd/{09da348a.js => H3l_crHv.js} | 0 .../cjs/{b99f90f4.js => -4vUgP94.js} | 0 .../_expected/es/{55aeacf8.js => A-tvJWOc.js} | 0 .../system/{e65da870.js => ia0SgqCA.js} | 0 ...-amd-f73e15b9.js => b.str-amd-hhqXr9WW.js} | 0 .../{c-amd-c1bed163.js => c-amd-TDR2LH-3.js} | 0 .../{d-amd-f5c92c04.js => d-amd-VrgHm0xN.js} | 0 .../{e-amd-f393b98d.js => e-amd-zwUdnnpR.js} | 0 .../{f-amd-df81ac71.js => f-amd-6N1j88Mb.js} | 0 .../{g-amd-1f750b5c.js => g-amd-bhx6veTY.js} | 0 .../{h-amd-a60c0f22.js => h-amd-wseWVa4P.js} | 0 .../_expected/amd/main-amd-7vxzdx0k.js | 15 ++++++ .../_expected/amd/main-amd-addffa50.js | 15 ------ .../{a-amd-5dc7856c.js => a-amd-skgc70zk.js} | 0 ...amd-9d2c6ef6.js => no-ext-amd-KDE3R3Gg.js} | 0 ...-cjs-6703f3b2.js => b.str-cjs-oMtv8QPW.js} | 0 .../{c-cjs-71ac0098.js => c-cjs-5n06CuHC.js} | 0 .../{d-cjs-9b009b8f.js => d-cjs-Gz2CiPX0.js} | 0 .../{e-cjs-831dad1f.js => e-cjs-WOU85U0_.js} | 0 .../{f-cjs-39905a99.js => f-cjs-WoWuXuZP.js} | 0 .../{g-cjs-3328e22b.js => g-cjs-ZcQtf4ii.js} | 0 .../{h-cjs-d8541d4b.js => h-cjs-8Kljj-VE.js} | 0 .../_expected/cjs/main-cjs-JyKGpmTa.js | 23 +++++++++ .../_expected/cjs/main-cjs-cb43c6df.js | 23 --------- .../{a-cjs-80f9b8c3.js => a-cjs-kvZ4_FEE.js} | 0 ...cjs-500f8f81.js => no-ext-cjs-bp5EbIHi.js} | 0 ...tr-es-3ce883b1.js => b.str-es-Ja5UDcox.js} | 0 .../es/{c-es-7b7256f9.js => c-es-kgE3BpZP.js} | 0 .../es/{d-es-1616849c.js => d-es-aJHyMhkA.js} | 0 .../es/{e-es-e18089fa.js => e-es-L3xdJkDr.js} | 0 .../es/{f-es-c1646e12.js => f-es--VxedyqQ.js} | 0 .../es/{g-es-968f87d2.js => g-es-spweQtsO.js} | 0 .../es/{h-es-05491bfa.js => h-es-TRi7J9bn.js} | 0 .../_expected/es/main-es-N06cocRH.js | 9 ++++ .../_expected/es/main-es-f8350081.js | 9 ---- .../{a-es-125ea65c.js => a-es-NSAVj3lN.js} | 0 ...t-es-1f34b6e8.js => no-ext-es-C7qwrbcM.js} | 0 ...m-2fa3160e.js => b.str-system-7-uTx9xs.js} | 0 ...ystem-9442eacd.js => c-system-3c7Uwjh3.js} | 0 ...ystem-1a05eeda.js => d-system-bygti7CV.js} | 0 ...ystem-f73caf6a.js => e-system-Ol7HNm3k.js} | 0 ...ystem-b3b06e3f.js => f-system-WkQAXb4K.js} | 0 ...ystem-9b3ad652.js => g-system-7SjE1oVU.js} | 0 ...ystem-6c6b48ca.js => h-system-2b9bPI4v.js} | 0 ...em-d08bfef5.js => main-system-awzr_ZZt.js} | 2 +- ...ystem-db94ffc0.js => a-system-Sq4jqhxz.js} | 0 ...-0cf938a8.js => no-ext-system-KaJN8U9x.js} | 0 ...5c.mjs => _virtualModule-amd-dkCUmZZM.mjs} | 0 ..._virtualWithAssetExt.str-amd-ZmgZpO4v.mjs} | 0 ...e.mjs => _virtualWithExt-amd-fYdXqg2l.mjs} | 0 ...amd-30156411.mjs => main-amd-bdsEo1jf.mjs} | 2 +- ...5e.mjs => _virtualModule-cjs-vsfTWOJ4.mjs} | 0 ..._virtualWithAssetExt.str-cjs-C3etvDA-.mjs} | 0 ...3.mjs => _virtualWithExt-cjs-Q5dP1jbm.mjs} | 0 ...cjs-23637a85.mjs => main-cjs-6wpvmYGP.mjs} | 6 +-- ...f19.mjs => _virtualModule-es-0lAsaDxt.mjs} | 0 ... _virtualWithAssetExt.str-es-i4KuU6IN.mjs} | 0 ...37.mjs => _virtualWithExt-es-0H_6dNOV.mjs} | 0 ...n-es-956265de.mjs => main-es-qKNN2CuL.mjs} | 6 +-- ...mjs => _virtualModule-system-QemGjyyq.mjs} | 0 ...rtualWithAssetExt.str-system-i71mo7go.mjs} | 0 ...js => _virtualWithExt-system-m-4Ec4Ay.mjs} | 0 ...-36e9b93b.mjs => main-system-vB0aGC5C.mjs} | 2 +- .../samples/render-chunk-transform/_config.js | 2 +- ...n1-31ed1903.js => entry-main1-kZfhqQ-c.js} | 0 ...n2-4c3da82f.js => entry-main2-HAN3t8tF.js} | 2 +- ...n1-c6673fa5.js => entry-main1-vmW_xTy-.js} | 0 ...n2-a3a04675.js => entry-main2-Nn78jd3g.js} | 2 +- ...n1-56d7d368.js => entry-main1-NHE3CPgw.js} | 0 .../_expected/es/entry-main2-7827261c.js | 3 -- .../_expected/es/entry-main2-bcI4ej2q.js | 3 ++ ...n1-d7dc9358.js => entry-main1-ulqZAx1e.js} | 0 ...n2-f1bbcc21.js => entry-main2-9TMBLN6w.js} | 2 +- ...sset-test-9f86d081 => asset-test-uF-4QoZ1} | 0 ...ep2-af768b5f.js => chunk-dep2-_bTcBm_f.js} | 12 ++--- ...n1-62378d9a.js => entry-main1-n5Rl5PjH.js} | 22 ++++---- ...n2-d26bed01.js => entry-main2-ne4fysq0.js} | 22 ++++---- ...sset-test-9f86d081 => asset-test-uF-4QoZ1} | 0 ...ep2-8d89c265.js => chunk-dep2-XPNbbDh-.js} | 12 ++--- ...n1-5be92ae4.js => entry-main1-zV-9xTLy.js} | 22 ++++---- ...n2-20c5a0f4.js => entry-main2-urBx_vfo.js} | 22 ++++---- ...sset-test-9f86d081 => asset-test-uF-4QoZ1} | 0 ...ep2-0da9d5f1.js => chunk-dep2-P6jMk6bJ.js} | 12 ++--- ...n1-f3f64fb9.js => entry-main1--LupZW-p.js} | 22 ++++---- ...n2-d0add96f.js => entry-main2-wXJ52_9X.js} | 22 ++++---- ...sset-test-9f86d081 => asset-test-uF-4QoZ1} | 0 ...ep2-be1287c1.js => chunk-dep2-tTS3nOMy.js} | 12 ++--- ...n1-f0891ef8.js => entry-main1-j8-hK8pw.js} | 22 ++++---- ...n2-ef5991ab.js => entry-main2-Y97yXNTt.js} | 22 ++++---- ...0f7ca5.txt => asset-resolved-7pLh6Sdd.txt} | 0 ...230ecafd.txt => asset-solved-0oyI4hTT.txt} | 0 ...e86c.txt => asset-unresolved-e0Iev6TZ.txt} | 0 .../resolve-file-url/_expected/amd/main.js | 2 +- .../_expected/amd/nested/chunk.js | 4 +- ...0f7ca5.txt => asset-resolved-7pLh6Sdd.txt} | 0 ...230ecafd.txt => asset-solved-0oyI4hTT.txt} | 0 ...e86c.txt => asset-unresolved-e0Iev6TZ.txt} | 0 .../resolve-file-url/_expected/cjs/main.js | 2 +- .../_expected/cjs/nested/chunk.js | 4 +- ...0f7ca5.txt => asset-resolved-7pLh6Sdd.txt} | 0 ...230ecafd.txt => asset-solved-0oyI4hTT.txt} | 0 ...e86c.txt => asset-unresolved-e0Iev6TZ.txt} | 0 .../resolve-file-url/_expected/es/main.js | 2 +- .../_expected/es/nested/chunk.js | 4 +- ...0f7ca5.txt => asset-resolved-7pLh6Sdd.txt} | 0 ...230ecafd.txt => asset-solved-0oyI4hTT.txt} | 0 ...e86c.txt => asset-unresolved-e0Iev6TZ.txt} | 0 .../resolve-file-url/_expected/system/main.js | 2 +- .../_expected/system/nested/chunk.js | 4 +- ...p => dynamic-HgyWTd0RHPMm-Z5LV91eZ.js.map} | 2 +- ...5ec8d44f.js => dynamic-hashed-Z5LV91eZ.js} | 2 +- ...ynamic-a0f7e361.js => dynamic-kWEjd9Su.js} | 0 .../_expected/amd/dynamic.js.map | 2 +- .../_expected/amd/main.js | 4 +- ...p => dynamic-Bj3iqQlUJnPN-DzdWIGlX.js.map} | 2 +- ...ynamic-03a87e17.js => dynamic-Q4C4Dm_h.js} | 0 .../_expected/cjs/dynamic-hashed-DzdWIGlX.js | 4 ++ .../_expected/cjs/dynamic-hashed-e21b9079.js | 4 -- .../_expected/cjs/dynamic.js.map | 2 +- .../_expected/cjs/main.js | 4 +- ...ynamic-c7ad594d.js => dynamic-APUNg5Yg.js} | 0 .../_expected/es/dynamic-hashed-4b06902b.js | 2 - .../_expected/es/dynamic-hashed-T4V3Rnvr.js | 2 + ...p => dynamic-kETnNCzeTm-o-T4V3Rnvr.js.map} | 2 +- .../_expected/es/dynamic.js.map | 2 +- .../_expected/es/main.js | 4 +- ...ynamic-ef271780.js => dynamic-VkfTWHgI.js} | 0 ...c0b30ec8.js => dynamic-hashed-BFee68z_.js} | 2 +- ...p => dynamic-sDZez62fO5oL-BFee68z_.js.map} | 2 +- .../_expected/system/dynamic.js.map | 2 +- .../_expected/system/main.js | 4 +- ....map => main-DrgsaZFk-amd-af4XjAqa.js.map} | 2 +- ...n-543232e9-amd.js => main-DrgsaZFk-amd.js} | 2 +- .../_expected/cjs/main-3fddaf82-cjs.js | 4 -- ....map => main-R9n-8tvV-cjs-AkG5wfAe.js.map} | 2 +- .../_expected/cjs/main-R9n-8tvV-cjs.js | 4 ++ .../_expected/es/main-824894f4-es.js | 2 - ...s.map => main-bXxLNi2H-es-8pqe0w5c.js.map} | 2 +- .../_expected/es/main-bXxLNi2H-es.js | 2 + ...p => main-c5ZQparC-system-mgjP6dBa.js.map} | 2 +- ...746c-system.js => main-c5ZQparC-system.js} | 2 +- .../_config.js | 6 +-- .../code-splitting-named-inputs/_config.js | 6 +-- .../samples/stdout-code-splitting/_config.js | 2 +- .../configure-file-url/_expected/amd.js | 4 +- ...0f7ca5.txt => asset-resolved-7pLh6Sdd.txt} | 0 ...230ecafd.txt => asset-solved-0oyI4hTT.txt} | 0 ...e86c.txt => asset-unresolved-e0Iev6TZ.txt} | 0 .../configure-file-url/_expected/cjs.js | 4 +- .../configure-file-url/_expected/es.js | 4 +- .../configure-file-url/_expected/iife.js | 4 +- .../configure-file-url/_expected/system.js | 4 +- .../configure-file-url/_expected/umd.js | 4 +- test/form/samples/emit-asset-file/_config.js | 4 +- .../samples/emit-asset-file/_expected/amd.js | 2 +- .../{logo-a2a2cdc4.svg => logo-Mw5Zq12q.svg} | 0 .../samples/emit-asset-file/_expected/cjs.js | 2 +- .../samples/emit-asset-file/_expected/es.js | 2 +- .../samples/emit-asset-file/_expected/iife.js | 2 +- .../emit-asset-file/_expected/system.js | 2 +- .../samples/emit-asset-file/_expected/umd.js | 2 +- .../{logo-a2a2cdc4.svg => logo-Mw5Zq12q.svg} | 0 .../_expected/amd.js | 6 +-- .../assets/{asset-60cc5dc9 => asset-PPyJ5YHr} | 0 .../assets/{asset-75590fc1 => asset-rVqBj9gL} | 0 .../assets/{asset-8e3dd2ea => asset-tb9uIT4z} | 0 .../_expected/cjs.js | 6 +-- .../emit-uint8array-no-buffer/_expected/es.js | 6 +-- .../_expected/iife.js | 6 +-- .../_expected/system.js | 6 +-- .../_expected/umd.js | 6 +-- .../samples/emit-chunk-hash/_config.js | 2 +- .../emit-chunk-manual-asset-source/_config.js | 2 +- .../samples/emit-chunk-manual/_config.js | 2 +- .../asset-source-invalid3/_config.js | 2 +- .../asset-source-missing2/_config.js | 2 +- .../asset-source-missing4/_config.js | 2 +- .../set-asset-source-chunk/_config.js | 2 +- .../set-asset-source-twice2/_config.js | 2 +- .../hashing/maximum-hash-size/_config.js | 4 +- test/hooks/index.js | 38 +++++++------- test/misc/bundle-information.js | 12 ++--- test/misc/misc.js | 2 +- wasm/bindings_wasm.d.ts | 11 +++- wasm/bindings_wasm_bg.wasm.d.ts | 3 +- 412 files changed, 504 insertions(+), 491 deletions(-) delete mode 100644 browser/src/crypto.ts create mode 100644 rust/xxhash/Cargo.toml create mode 100644 rust/xxhash/src/lib.rs rename test/browser/samples/supports-hashes/_expected/{dep-bd733981.js => dep-KkHNeB29.js} (100%) delete mode 100644 test/browser/samples/supports-hashes/_expected/main-70712c1f.js create mode 100644 test/browser/samples/supports-hashes/_expected/main-pNv0QjL6.js rename test/chunking-form/samples/emit-file/asset-file-names/_expected/amd/txt/{b94d27b9-test.txt => x7YVzHWH-test.txt} (100%) rename test/chunking-form/samples/emit-file/asset-file-names/_expected/cjs/txt/{b94d27b9-test.txt => x7YVzHWH-test.txt} (100%) rename test/chunking-form/samples/emit-file/asset-file-names/_expected/es/txt/{b94d27b9-test.txt => x7YVzHWH-test.txt} (100%) rename test/chunking-form/samples/emit-file/asset-file-names/_expected/system/txt/{b94d27b9-test.txt => x7YVzHWH-test.txt} (100%) rename test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assets/{buffer-d0ca8c2a.txt => buffer-fV9J_shM.txt} (100%) rename test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assets/{otherBuffer-e8d9b528.txt => otherBuffer-Oh78Hjdg.txt} (100%) rename test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assets/{otherString-e296c1ca.txt => otherString-PiT4klzx.txt} (100%) rename test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assets/{string1-473287f8.txt => string1-PAAt4eb8.txt} (100%) rename test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assets/{buffer-d0ca8c2a.txt => buffer-fV9J_shM.txt} (100%) rename test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assets/{otherBuffer-e8d9b528.txt => otherBuffer-Oh78Hjdg.txt} (100%) rename test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assets/{otherString-e296c1ca.txt => otherString-PiT4klzx.txt} (100%) rename test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assets/{string1-473287f8.txt => string1-PAAt4eb8.txt} (100%) rename test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assets/{buffer-d0ca8c2a.txt => buffer-fV9J_shM.txt} (100%) rename test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assets/{otherBuffer-e8d9b528.txt => otherBuffer-Oh78Hjdg.txt} (100%) rename test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assets/{otherString-e296c1ca.txt => otherString-PiT4klzx.txt} (100%) rename test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assets/{string1-473287f8.txt => string1-PAAt4eb8.txt} (100%) rename test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assets/{buffer-d0ca8c2a.txt => buffer-fV9J_shM.txt} (100%) rename test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assets/{otherBuffer-e8d9b528.txt => otherBuffer-Oh78Hjdg.txt} (100%) rename test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assets/{otherString-e296c1ca.txt => otherString-PiT4klzx.txt} (100%) rename test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assets/{string1-473287f8.txt => string1-PAAt4eb8.txt} (100%) rename test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/amd/assets/{asset-b94d27b9 => asset-x7YVzHWH} (100%) rename test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/cjs/assets/{asset-b94d27b9 => asset-x7YVzHWH} (100%) rename test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/es/assets/{asset-b94d27b9 => asset-x7YVzHWH} (100%) rename test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/system/assets/{asset-b94d27b9 => asset-x7YVzHWH} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/{banner-8c7ed2d9.txt => banner-Pqjybijy.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/{buildEnd-6e08d992.txt => buildEnd-bjZfkWaR.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/{buildStart-db9421f6.txt => buildStart-jUsAaHhv.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/{footer-0301844c.txt => footer-lepGH7ft.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/{generateBundle-5b9a4e56.txt => generateBundle-YC5K5IqI.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/{intro-c432b372.txt => intro-NT6UL-Ie.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/{load-0cf67fc7.txt => load-f5EgoTqv.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/{outro-1e5fe046.txt => outro-_McFrfAR.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/{renderChunk-aa9e49b7.txt => renderChunk-DMYyTWqj.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/{renderStart-981aa2ea.txt => renderStart-eFzm3QZM.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/{resolveId-dd9bb7f8.txt => resolveId-go8NkbCx.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/{transform-aa214ea3.txt => transform-PQ2olIjk.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/{banner-8c7ed2d9.txt => banner-Pqjybijy.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/{buildEnd-6e08d992.txt => buildEnd-bjZfkWaR.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/{buildStart-db9421f6.txt => buildStart-jUsAaHhv.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/{footer-0301844c.txt => footer-lepGH7ft.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/{generateBundle-5b9a4e56.txt => generateBundle-YC5K5IqI.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/{intro-c432b372.txt => intro-NT6UL-Ie.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/{load-0cf67fc7.txt => load-f5EgoTqv.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/{outro-1e5fe046.txt => outro-_McFrfAR.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/{renderChunk-aa9e49b7.txt => renderChunk-DMYyTWqj.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/{renderStart-981aa2ea.txt => renderStart-eFzm3QZM.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/{resolveId-dd9bb7f8.txt => resolveId-go8NkbCx.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/{transform-aa214ea3.txt => transform-PQ2olIjk.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/{banner-8c7ed2d9.txt => banner-Pqjybijy.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/{buildEnd-6e08d992.txt => buildEnd-bjZfkWaR.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/{buildStart-db9421f6.txt => buildStart-jUsAaHhv.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/{footer-0301844c.txt => footer-lepGH7ft.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/{generateBundle-5b9a4e56.txt => generateBundle-YC5K5IqI.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/{intro-c432b372.txt => intro-NT6UL-Ie.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/{load-0cf67fc7.txt => load-f5EgoTqv.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/{outro-1e5fe046.txt => outro-_McFrfAR.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/{renderChunk-aa9e49b7.txt => renderChunk-DMYyTWqj.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/{renderStart-981aa2ea.txt => renderStart-eFzm3QZM.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/{resolveId-dd9bb7f8.txt => resolveId-go8NkbCx.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/{transform-aa214ea3.txt => transform-PQ2olIjk.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/{banner-8c7ed2d9.txt => banner-Pqjybijy.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/{buildEnd-6e08d992.txt => buildEnd-bjZfkWaR.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/{buildStart-db9421f6.txt => buildStart-jUsAaHhv.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/{footer-0301844c.txt => footer-lepGH7ft.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/{generateBundle-5b9a4e56.txt => generateBundle-YC5K5IqI.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/{intro-c432b372.txt => intro-NT6UL-Ie.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/{load-0cf67fc7.txt => load-f5EgoTqv.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/{outro-1e5fe046.txt => outro-_McFrfAR.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/{renderChunk-aa9e49b7.txt => renderChunk-DMYyTWqj.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/{renderStart-981aa2ea.txt => renderStart-eFzm3QZM.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/{resolveId-dd9bb7f8.txt => resolveId-go8NkbCx.txt} (100%) rename test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/{transform-aa214ea3.txt => transform-PQ2olIjk.txt} (100%) rename test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/amd/assets/{test-b94d27b9.txt => test-x7YVzHWH.txt} (100%) rename test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/cjs/assets/{test-b94d27b9.txt => test-x7YVzHWH.txt} (100%) rename test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/es/assets/{test-b94d27b9.txt => test-x7YVzHWH.txt} (100%) rename test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/system/assets/{test-b94d27b9.txt => test-x7YVzHWH.txt} (100%) rename test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/{chunk-deb-87ce45a9-amd.js => chunk-deb-9YxNr2n5-amd.js} (100%) rename test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/{entry-main-70ac024b-amd.js => entry-main-2WHbe7ly-amd.js} (72%) rename test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/txt/{b94d27b9-test.txt => x7YVzHWH-test.txt} (100%) rename test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/{chunk-deb-69905607-cjs.js => chunk-deb-KO3me1q0-cjs.js} (100%) rename test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/{entry-main-780766d3-cjs.js => entry-main-GKdCatel-cjs.js} (70%) rename test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/txt/{b94d27b9-test.txt => x7YVzHWH-test.txt} (100%) rename test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/es/{chunk-deb-9f85baf7-es.js => chunk-deb-3ItlXRQy-es.js} (100%) delete mode 100644 test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/es/entry-main-080ad38c-es.js create mode 100644 test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/es/entry-main-mA3J9obY-es.js rename test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/es/txt/{b94d27b9-test.txt => x7YVzHWH-test.txt} (100%) rename test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/system/{chunk-deb-467d682b-system.js => chunk-deb-BJKR2fPr-system.js} (100%) rename test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/system/{entry-main-5d41b5c4-system.js => entry-main-ljrLE_qG-system.js} (69%) rename test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/system/txt/{b94d27b9-test.txt => x7YVzHWH-test.txt} (100%) rename test/chunking-form/samples/emit-file/reference-files/_expected/amd/assets/{logo1-60bc15c4.svg => logo1-BarkEXVd.svg} (100%) rename test/chunking-form/samples/emit-file/reference-files/_expected/amd/assets/{logo2-fdaa7478.svg => logo2-yX706C0w.svg} (100%) rename test/chunking-form/samples/emit-file/reference-files/_expected/cjs/assets/{logo1-60bc15c4.svg => logo1-BarkEXVd.svg} (100%) rename test/chunking-form/samples/emit-file/reference-files/_expected/cjs/assets/{logo2-fdaa7478.svg => logo2-yX706C0w.svg} (100%) rename test/chunking-form/samples/emit-file/reference-files/_expected/es/assets/{logo1-60bc15c4.svg => logo1-BarkEXVd.svg} (100%) rename test/chunking-form/samples/emit-file/reference-files/_expected/es/assets/{logo2-fdaa7478.svg => logo2-yX706C0w.svg} (100%) rename test/chunking-form/samples/emit-file/reference-files/_expected/system/assets/{logo1-60bc15c4.svg => logo1-BarkEXVd.svg} (100%) rename test/chunking-form/samples/emit-file/reference-files/_expected/system/assets/{logo2-fdaa7478.svg => logo2-yX706C0w.svg} (100%) rename test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/{banner-8c7ed2d9.txt => banner-Pqjybijy.txt} (100%) rename test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/{footer-0301844c.txt => footer-lepGH7ft.txt} (100%) delete mode 100644 test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/generateBundle-6922b0a1.txt create mode 100644 test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/generateBundle-KcqLI9cb.txt rename test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/{generateBundle-format-240389f4.txt => generateBundle-format-5jVvk-26.txt} (100%) rename test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/{intro-c432b372.txt => intro-NT6UL-Ie.txt} (100%) rename test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/{outro-1e5fe046.txt => outro-_McFrfAR.txt} (100%) rename test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/{renderChunk-aa9e49b7.txt => renderChunk-DMYyTWqj.txt} (100%) rename test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/{renderStart-981aa2ea.txt => renderStart-eFzm3QZM.txt} (100%) rename test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/{banner-8c7ed2d9.txt => banner-Pqjybijy.txt} (100%) rename test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/{footer-0301844c.txt => footer-lepGH7ft.txt} (100%) delete mode 100644 test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/generateBundle-b1a5f14c.txt rename test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/{generateBundle-format-4efb05bc.txt => generateBundle-format-9Z73n2OP.txt} (100%) create mode 100644 test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/generateBundle-yF5Q0doc.txt rename test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/{intro-c432b372.txt => intro-NT6UL-Ie.txt} (100%) rename test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/{outro-1e5fe046.txt => outro-_McFrfAR.txt} (100%) rename test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/{renderChunk-aa9e49b7.txt => renderChunk-DMYyTWqj.txt} (100%) rename test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/{renderStart-981aa2ea.txt => renderStart-eFzm3QZM.txt} (100%) rename test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/{banner-8c7ed2d9.txt => banner-Pqjybijy.txt} (100%) rename test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/{footer-0301844c.txt => footer-lepGH7ft.txt} (100%) delete mode 100644 test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/generateBundle-668db42d.txt create mode 100644 test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/generateBundle-9uv4IgKv.txt rename test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/{generateBundle-format-c0bc1e08.txt => generateBundle-format-en7tITil.txt} (100%) rename test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/{intro-c432b372.txt => intro-NT6UL-Ie.txt} (100%) rename test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/{outro-1e5fe046.txt => outro-_McFrfAR.txt} (100%) rename test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/{renderChunk-aa9e49b7.txt => renderChunk-DMYyTWqj.txt} (100%) rename test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/{renderStart-981aa2ea.txt => renderStart-eFzm3QZM.txt} (100%) rename test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/{banner-8c7ed2d9.txt => banner-Pqjybijy.txt} (100%) rename test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/{footer-0301844c.txt => footer-lepGH7ft.txt} (100%) create mode 100644 test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/generateBundle-WoWY_GTC.txt delete mode 100644 test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/generateBundle-b0505b8f.txt rename test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/{generateBundle-format-bbc5e661.txt => generateBundle-format-XDhKOEdw.txt} (100%) rename test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/{intro-c432b372.txt => intro-NT6UL-Ie.txt} (100%) rename test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/{outro-1e5fe046.txt => outro-_McFrfAR.txt} (100%) rename test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/{renderChunk-aa9e49b7.txt => renderChunk-DMYyTWqj.txt} (100%) rename test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/{renderStart-981aa2ea.txt => renderStart-eFzm3QZM.txt} (100%) rename test/chunking-form/samples/filenames-patterns/_expected/amd/{chunk-main2-a7baadb6-amd.js => chunk-main2-cf881rtr-amd.js} (100%) delete mode 100644 test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main1-94fe149e-amd.js create mode 100644 test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main1-CBKFi7eG-amd.js delete mode 100644 test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main2-16bafa95-amd.js create mode 100644 test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main2-U19f7Kkv-amd.js rename test/chunking-form/samples/filenames-patterns/_expected/cjs/{chunk-main2-399c15fc-cjs.js => chunk-main2-2eAijmim-cjs.js} (100%) delete mode 100644 test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main1-2934d4fa-cjs.js create mode 100644 test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main1-i42FQ2i5-cjs.js delete mode 100644 test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main2-523204ff-cjs.js create mode 100644 test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main2-e914JHZ0-cjs.js rename test/chunking-form/samples/filenames-patterns/_expected/es/{chunk-main2-c42fce1a-es.js => chunk-main2-IiSmXREe-es.js} (100%) delete mode 100644 test/chunking-form/samples/filenames-patterns/_expected/es/entry-main1-6f12c5b2-es.js create mode 100644 test/chunking-form/samples/filenames-patterns/_expected/es/entry-main1-JQIS3SKF-es.js create mode 100644 test/chunking-form/samples/filenames-patterns/_expected/es/entry-main2-6DNkLKmG-es.js delete mode 100644 test/chunking-form/samples/filenames-patterns/_expected/es/entry-main2-a9b323b4-es.js rename test/chunking-form/samples/filenames-patterns/_expected/system/{chunk-main2-9cc03624-system.js => chunk-main2-cN2LIF0L-system.js} (100%) rename test/chunking-form/samples/filenames-patterns/_expected/system/{entry-main1-720299cf-system.js => entry-main1-3xo1S8a0-system.js} (73%) rename test/chunking-form/samples/filenames-patterns/_expected/system/{entry-main2-c3cb1622-system.js => entry-main2-RI9cN2Cj-system.js} (70%) rename test/chunking-form/samples/hashing/deconflict-hashes/_expected/amd/{entry-7061c38c.js => entry-BjVZZvuI.js} (100%) rename test/chunking-form/samples/hashing/deconflict-hashes/_expected/amd/{entry-82a5a8a4.js => entry-_kM9k9Bx.js} (100%) rename test/chunking-form/samples/hashing/deconflict-hashes/_expected/cjs/{entry-8011025d.js => entry-BAMj_W0O.js} (100%) rename test/chunking-form/samples/hashing/deconflict-hashes/_expected/cjs/{entry-fc7b26ff.js => entry-ivriA37N.js} (100%) rename test/chunking-form/samples/hashing/deconflict-hashes/_expected/es/{entry-2b8647b5.js => entry-Gs557UIb.js} (100%) rename test/chunking-form/samples/hashing/deconflict-hashes/_expected/es/{entry-369b04c8.js => entry-Y0flmsE_.js} (100%) rename test/chunking-form/samples/hashing/deconflict-hashes/_expected/system/{entry-54240e14.js => entry-aiNN2RB-.js} (100%) rename test/chunking-form/samples/hashing/deconflict-hashes/_expected/system/{entry-ed8fdbb3.js => entry-yZdFXPRq.js} (100%) rename test/chunking-form/samples/hashing/double-hash/_expected/amd/{7061c38c/entry-7061c38c.js => _kM9k9Bx/entry-_kM9k9Bx.js} (100%) rename test/chunking-form/samples/hashing/double-hash/_expected/cjs/{8011025d/entry-8011025d.js => ivriA37N/entry-ivriA37N.js} (100%) rename test/chunking-form/samples/hashing/double-hash/_expected/es/{2b8647b5/entry-2b8647b5.js => Y0flmsE_/entry-Y0flmsE_.js} (100%) rename test/chunking-form/samples/hashing/double-hash/_expected/system/{54240e14/entry-54240e14.js => yZdFXPRq/entry-yZdFXPRq.js} (100%) rename test/chunking-form/samples/hashing/hash-size/_expected/amd/{dep-5905830720d5f3.js => dep-eCO4iyaHEVP2U2.js} (100%) create mode 100644 test/chunking-form/samples/hashing/hash-size/_expected/amd/main1-9bGLbd-q.js delete mode 100644 test/chunking-form/samples/hashing/hash-size/_expected/amd/main1-eb0f074f.js create mode 100644 test/chunking-form/samples/hashing/hash-size/_expected/amd/main2-5gkbLhN4J6.js delete mode 100644 test/chunking-form/samples/hashing/hash-size/_expected/amd/main2-b24fb22e7f.js rename test/chunking-form/samples/hashing/hash-size/_expected/amd/{test-9f86d081884c7d659a.txt => test-uF-4QoZ1HtBY01G94-.txt} (100%) rename test/chunking-form/samples/hashing/hash-size/_expected/cjs/{dep-0f12b4bf62a634.js => dep-YVivKZa3-xWdJj.js} (100%) rename test/chunking-form/samples/hashing/hash-size/_expected/cjs/{main1-87405ba3.js => main1-hNgwlFpU.js} (51%) rename test/chunking-form/samples/hashing/hash-size/_expected/cjs/{main2-b2c59bdf14.js => main2-VmtfVxsamQ.js} (51%) rename test/chunking-form/samples/hashing/hash-size/_expected/cjs/{test-9f86d081884c7d659a.txt => test-uF-4QoZ1HtBY01G94-.txt} (100%) rename test/chunking-form/samples/hashing/hash-size/_expected/es/{dep-cd6f5744f7fc9c.js => dep-zBY_VBiSge8Mj4.js} (100%) delete mode 100644 test/chunking-form/samples/hashing/hash-size/_expected/es/main1-bcca55a1.js create mode 100644 test/chunking-form/samples/hashing/hash-size/_expected/es/main1-fjlEGKoF.js delete mode 100644 test/chunking-form/samples/hashing/hash-size/_expected/es/main2-83d7b451fa.js create mode 100644 test/chunking-form/samples/hashing/hash-size/_expected/es/main2-_s3jGKh5RD.js rename test/chunking-form/samples/hashing/hash-size/_expected/es/{test-9f86d081884c7d659a.txt => test-uF-4QoZ1HtBY01G94-.txt} (100%) rename test/chunking-form/samples/hashing/hash-size/_expected/system/{dep-626bb5df3105f7.js => dep-hy-CAAd7JeW4I2.js} (100%) rename test/chunking-form/samples/hashing/hash-size/_expected/system/{main1-c5eecf00.js => main1-YgtCdyy2.js} (64%) rename test/chunking-form/samples/hashing/hash-size/_expected/system/{main2-842e475e5e.js => main2-dDGqHpvMDz.js} (64%) rename test/chunking-form/samples/hashing/hash-size/_expected/system/{test-9f86d081884c7d659a.txt => test-uF-4QoZ1HtBY01G94-.txt} (100%) rename test/chunking-form/samples/hashing/random-match/_expected/amd/{entry-a38385ce-a38385ce-!~{123}~.js => entry-1UjYC2I--1UjYC2I--!~{123}~.js} (69%) rename test/chunking-form/samples/hashing/random-match/_expected/cjs/{entry-55937672-55937672-!~{123}~.js => entry-r0OE6QqP-r0OE6QqP-!~{123}~.js} (60%) rename test/chunking-form/samples/hashing/random-match/_expected/es/{entry-3e8c77bc-3e8c77bc-!~{123}~.js => entry-0i8gYiAL-0i8gYiAL-!~{123}~.js} (52%) rename test/chunking-form/samples/hashing/random-match/_expected/system/{entry-49c9800c-49c9800c-!~{123}~.js => entry-uj5cAyaj-uj5cAyaj-!~{123}~.js} (79%) rename test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/amd/{09da348a.js => H3l_crHv.js} (100%) rename test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/cjs/{b99f90f4.js => -4vUgP94.js} (100%) rename test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/es/{55aeacf8.js => A-tvJWOc.js} (100%) rename test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/system/{e65da870.js => ia0SgqCA.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/{b.str-amd-f73e15b9.js => b.str-amd-hhqXr9WW.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/{c-amd-c1bed163.js => c-amd-TDR2LH-3.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/{d-amd-f5c92c04.js => d-amd-VrgHm0xN.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/{e-amd-f393b98d.js => e-amd-zwUdnnpR.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/{f-amd-df81ac71.js => f-amd-6N1j88Mb.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/{g-amd-1f750b5c.js => g-amd-bhx6veTY.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/{h-amd-a60c0f22.js => h-amd-wseWVa4P.js} (100%) create mode 100644 test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/main-amd-7vxzdx0k.js delete mode 100644 test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/main-amd-addffa50.js rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/nested/{a-amd-5dc7856c.js => a-amd-skgc70zk.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/{no-ext-amd-9d2c6ef6.js => no-ext-amd-KDE3R3Gg.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/{b.str-cjs-6703f3b2.js => b.str-cjs-oMtv8QPW.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/{c-cjs-71ac0098.js => c-cjs-5n06CuHC.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/{d-cjs-9b009b8f.js => d-cjs-Gz2CiPX0.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/{e-cjs-831dad1f.js => e-cjs-WOU85U0_.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/{f-cjs-39905a99.js => f-cjs-WoWuXuZP.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/{g-cjs-3328e22b.js => g-cjs-ZcQtf4ii.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/{h-cjs-d8541d4b.js => h-cjs-8Kljj-VE.js} (100%) create mode 100644 test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/main-cjs-JyKGpmTa.js delete mode 100644 test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/main-cjs-cb43c6df.js rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/nested/{a-cjs-80f9b8c3.js => a-cjs-kvZ4_FEE.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/{no-ext-cjs-500f8f81.js => no-ext-cjs-bp5EbIHi.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/{b.str-es-3ce883b1.js => b.str-es-Ja5UDcox.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/{c-es-7b7256f9.js => c-es-kgE3BpZP.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/{d-es-1616849c.js => d-es-aJHyMhkA.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/{e-es-e18089fa.js => e-es-L3xdJkDr.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/{f-es-c1646e12.js => f-es--VxedyqQ.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/{g-es-968f87d2.js => g-es-spweQtsO.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/{h-es-05491bfa.js => h-es-TRi7J9bn.js} (100%) create mode 100644 test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/main-es-N06cocRH.js delete mode 100644 test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/main-es-f8350081.js rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/nested/{a-es-125ea65c.js => a-es-NSAVj3lN.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/{no-ext-es-1f34b6e8.js => no-ext-es-C7qwrbcM.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/{b.str-system-2fa3160e.js => b.str-system-7-uTx9xs.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/{c-system-9442eacd.js => c-system-3c7Uwjh3.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/{d-system-1a05eeda.js => d-system-bygti7CV.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/{e-system-f73caf6a.js => e-system-Ol7HNm3k.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/{f-system-b3b06e3f.js => f-system-WkQAXb4K.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/{g-system-9b3ad652.js => g-system-7SjE1oVU.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/{h-system-6c6b48ca.js => h-system-2b9bPI4v.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/{main-system-d08bfef5.js => main-system-awzr_ZZt.js} (67%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/nested/{a-system-db94ffc0.js => a-system-Sq4jqhxz.js} (100%) rename test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/{no-ext-system-0cf938a8.js => no-ext-system-KaJN8U9x.js} (100%) rename test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/_virtual/{_virtualModule-amd-03552e5c.mjs => _virtualModule-amd-dkCUmZZM.mjs} (100%) rename test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/_virtual/{_virtualWithAssetExt.str-amd-724c602d.mjs => _virtualWithAssetExt.str-amd-ZmgZpO4v.mjs} (100%) rename test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/_virtual/{_virtualWithExt-amd-e9dc1b7e.mjs => _virtualWithExt-amd-fYdXqg2l.mjs} (100%) rename test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/{main-amd-30156411.mjs => main-amd-bdsEo1jf.mjs} (53%) rename test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/_virtual/{_virtualModule-cjs-bbe1ad5e.mjs => _virtualModule-cjs-vsfTWOJ4.mjs} (100%) rename test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/_virtual/{_virtualWithAssetExt.str-cjs-0e561611.mjs => _virtualWithAssetExt.str-cjs-C3etvDA-.mjs} (100%) rename test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/_virtual/{_virtualWithExt-cjs-b148ca33.mjs => _virtualWithExt-cjs-Q5dP1jbm.mjs} (100%) rename test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/{main-cjs-23637a85.mjs => main-cjs-6wpvmYGP.mjs} (56%) rename test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/_virtual/{_virtualModule-es-22303f19.mjs => _virtualModule-es-0lAsaDxt.mjs} (100%) rename test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/_virtual/{_virtualWithAssetExt.str-es-07beb78c.mjs => _virtualWithAssetExt.str-es-i4KuU6IN.mjs} (100%) rename test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/_virtual/{_virtualWithExt-es-6330be37.mjs => _virtualWithExt-es-0H_6dNOV.mjs} (100%) rename test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/{main-es-956265de.mjs => main-es-qKNN2CuL.mjs} (56%) rename test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system/_virtual/{_virtualModule-system-26bc5070.mjs => _virtualModule-system-QemGjyyq.mjs} (100%) rename test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system/_virtual/{_virtualWithAssetExt.str-system-98927794.mjs => _virtualWithAssetExt.str-system-i71mo7go.mjs} (100%) rename test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system/_virtual/{_virtualWithExt-system-11e583df.mjs => _virtualWithExt-system-m-4Ec4Ay.mjs} (100%) rename test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system/{main-system-36e9b93b.mjs => main-system-vB0aGC5C.mjs} (67%) rename test/chunking-form/samples/render-chunk-transform/_expected/amd/{entry-main1-31ed1903.js => entry-main1-kZfhqQ-c.js} (100%) rename test/chunking-form/samples/render-chunk-transform/_expected/amd/{entry-main2-4c3da82f.js => entry-main2-HAN3t8tF.js} (62%) rename test/chunking-form/samples/render-chunk-transform/_expected/cjs/{entry-main1-c6673fa5.js => entry-main1-vmW_xTy-.js} (100%) rename test/chunking-form/samples/render-chunk-transform/_expected/cjs/{entry-main2-a3a04675.js => entry-main2-Nn78jd3g.js} (52%) rename test/chunking-form/samples/render-chunk-transform/_expected/es/{entry-main1-56d7d368.js => entry-main1-NHE3CPgw.js} (100%) delete mode 100644 test/chunking-form/samples/render-chunk-transform/_expected/es/entry-main2-7827261c.js create mode 100644 test/chunking-form/samples/render-chunk-transform/_expected/es/entry-main2-bcI4ej2q.js rename test/chunking-form/samples/render-chunk-transform/_expected/system/{entry-main1-d7dc9358.js => entry-main1-ulqZAx1e.js} (100%) rename test/chunking-form/samples/render-chunk-transform/_expected/system/{entry-main2-f1bbcc21.js => entry-main2-9TMBLN6w.js} (74%) rename test/chunking-form/samples/render-chunk/_expected/amd/{asset-test-9f86d081 => asset-test-uF-4QoZ1} (100%) rename test/chunking-form/samples/render-chunk/_expected/amd/{chunk-dep2-af768b5f.js => chunk-dep2-_bTcBm_f.js} (69%) rename test/chunking-form/samples/render-chunk/_expected/amd/{entry-main1-62378d9a.js => entry-main1-n5Rl5PjH.js} (65%) rename test/chunking-form/samples/render-chunk/_expected/amd/{entry-main2-d26bed01.js => entry-main2-ne4fysq0.js} (65%) rename test/chunking-form/samples/render-chunk/_expected/cjs/{asset-test-9f86d081 => asset-test-uF-4QoZ1} (100%) rename test/chunking-form/samples/render-chunk/_expected/cjs/{chunk-dep2-8d89c265.js => chunk-dep2-XPNbbDh-.js} (63%) rename test/chunking-form/samples/render-chunk/_expected/cjs/{entry-main1-5be92ae4.js => entry-main1-zV-9xTLy.js} (61%) rename test/chunking-form/samples/render-chunk/_expected/cjs/{entry-main2-20c5a0f4.js => entry-main2-urBx_vfo.js} (61%) rename test/chunking-form/samples/render-chunk/_expected/es/{asset-test-9f86d081 => asset-test-uF-4QoZ1} (100%) rename test/chunking-form/samples/render-chunk/_expected/es/{chunk-dep2-0da9d5f1.js => chunk-dep2-P6jMk6bJ.js} (64%) rename test/chunking-form/samples/render-chunk/_expected/es/{entry-main1-f3f64fb9.js => entry-main1--LupZW-p.js} (60%) rename test/chunking-form/samples/render-chunk/_expected/es/{entry-main2-d0add96f.js => entry-main2-wXJ52_9X.js} (60%) rename test/chunking-form/samples/render-chunk/_expected/system/{asset-test-9f86d081 => asset-test-uF-4QoZ1} (100%) rename test/chunking-form/samples/render-chunk/_expected/system/{chunk-dep2-be1287c1.js => chunk-dep2-tTS3nOMy.js} (67%) rename test/chunking-form/samples/render-chunk/_expected/system/{entry-main1-f0891ef8.js => entry-main1-j8-hK8pw.js} (63%) rename test/chunking-form/samples/render-chunk/_expected/system/{entry-main2-ef5991ab.js => entry-main2-Y97yXNTt.js} (63%) rename test/chunking-form/samples/resolve-file-url/_expected/amd/assets/{asset-resolved-9e0f7ca5.txt => asset-resolved-7pLh6Sdd.txt} (100%) rename test/chunking-form/samples/resolve-file-url/_expected/amd/assets/{asset-solved-230ecafd.txt => asset-solved-0oyI4hTT.txt} (100%) rename test/chunking-form/samples/resolve-file-url/_expected/amd/assets/{asset-unresolved-f4c1e86c.txt => asset-unresolved-e0Iev6TZ.txt} (100%) rename test/chunking-form/samples/resolve-file-url/_expected/cjs/assets/{asset-resolved-9e0f7ca5.txt => asset-resolved-7pLh6Sdd.txt} (100%) rename test/chunking-form/samples/resolve-file-url/_expected/cjs/assets/{asset-solved-230ecafd.txt => asset-solved-0oyI4hTT.txt} (100%) rename test/chunking-form/samples/resolve-file-url/_expected/cjs/assets/{asset-unresolved-f4c1e86c.txt => asset-unresolved-e0Iev6TZ.txt} (100%) rename test/chunking-form/samples/resolve-file-url/_expected/es/assets/{asset-resolved-9e0f7ca5.txt => asset-resolved-7pLh6Sdd.txt} (100%) rename test/chunking-form/samples/resolve-file-url/_expected/es/assets/{asset-solved-230ecafd.txt => asset-solved-0oyI4hTT.txt} (100%) rename test/chunking-form/samples/resolve-file-url/_expected/es/assets/{asset-unresolved-f4c1e86c.txt => asset-unresolved-e0Iev6TZ.txt} (100%) rename test/chunking-form/samples/resolve-file-url/_expected/system/assets/{asset-resolved-9e0f7ca5.txt => asset-resolved-7pLh6Sdd.txt} (100%) rename test/chunking-form/samples/resolve-file-url/_expected/system/assets/{asset-solved-230ecafd.txt => asset-solved-0oyI4hTT.txt} (100%) rename test/chunking-form/samples/resolve-file-url/_expected/system/assets/{asset-unresolved-f4c1e86c.txt => asset-unresolved-e0Iev6TZ.txt} (100%) rename test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/{dynamic-eea0ce30202b-5ec8d44f.js.map => dynamic-HgyWTd0RHPMm-Z5LV91eZ.js.map} (69%) rename test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/{dynamic-hashed-5ec8d44f.js => dynamic-hashed-Z5LV91eZ.js} (56%) rename test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/{dynamic-a0f7e361.js => dynamic-kWEjd9Su.js} (100%) rename test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/{dynamic-44faaace9dbc-e21b9079.js.map => dynamic-Bj3iqQlUJnPN-DzdWIGlX.js.map} (68%) rename test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/{dynamic-03a87e17.js => dynamic-Q4C4Dm_h.js} (100%) create mode 100644 test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/dynamic-hashed-DzdWIGlX.js delete mode 100644 test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/dynamic-hashed-e21b9079.js rename test/chunking-form/samples/sourcemap-file-names-function/_expected/es/{dynamic-c7ad594d.js => dynamic-APUNg5Yg.js} (100%) delete mode 100644 test/chunking-form/samples/sourcemap-file-names-function/_expected/es/dynamic-hashed-4b06902b.js create mode 100644 test/chunking-form/samples/sourcemap-file-names-function/_expected/es/dynamic-hashed-T4V3Rnvr.js rename test/chunking-form/samples/sourcemap-file-names-function/_expected/es/{dynamic-769057acb768-4b06902b.js.map => dynamic-kETnNCzeTm-o-T4V3Rnvr.js.map} (68%) rename test/chunking-form/samples/sourcemap-file-names-function/_expected/system/{dynamic-ef271780.js => dynamic-VkfTWHgI.js} (100%) rename test/chunking-form/samples/sourcemap-file-names-function/_expected/system/{dynamic-hashed-c0b30ec8.js => dynamic-hashed-BFee68z_.js} (70%) rename test/chunking-form/samples/sourcemap-file-names-function/_expected/system/{dynamic-883b8003cd49-c0b30ec8.js.map => dynamic-sDZez62fO5oL-BFee68z_.js.map} (70%) rename test/chunking-form/samples/sourcemap-file-names/_expected/amd/{main-543232e9-amd-af8f17da.js.map => main-DrgsaZFk-amd-af4XjAqa.js.map} (64%) rename test/chunking-form/samples/sourcemap-file-names/_expected/amd/{main-543232e9-amd.js => main-DrgsaZFk-amd.js} (53%) delete mode 100644 test/chunking-form/samples/sourcemap-file-names/_expected/cjs/main-3fddaf82-cjs.js rename test/chunking-form/samples/sourcemap-file-names/_expected/cjs/{main-3fddaf82-cjs-c64b742b.js.map => main-R9n-8tvV-cjs-AkG5wfAe.js.map} (63%) create mode 100644 test/chunking-form/samples/sourcemap-file-names/_expected/cjs/main-R9n-8tvV-cjs.js delete mode 100644 test/chunking-form/samples/sourcemap-file-names/_expected/es/main-824894f4-es.js rename test/chunking-form/samples/sourcemap-file-names/_expected/es/{main-824894f4-es-dbab040a.js.map => main-bXxLNi2H-es-8pqe0w5c.js.map} (62%) create mode 100644 test/chunking-form/samples/sourcemap-file-names/_expected/es/main-bXxLNi2H-es.js rename test/chunking-form/samples/sourcemap-file-names/_expected/system/{main-6186746c-system-bce3d2ab.js.map => main-c5ZQparC-system-mgjP6dBa.js.map} (65%) rename test/chunking-form/samples/sourcemap-file-names/_expected/system/{main-6186746c-system.js => main-c5ZQparC-system.js} (68%) rename test/form/samples/configure-file-url/_expected/assets/{asset-resolved-9e0f7ca5.txt => asset-resolved-7pLh6Sdd.txt} (100%) rename test/form/samples/configure-file-url/_expected/assets/{asset-solved-230ecafd.txt => asset-solved-0oyI4hTT.txt} (100%) rename test/form/samples/configure-file-url/_expected/assets/{asset-unresolved-f4c1e86c.txt => asset-unresolved-e0Iev6TZ.txt} (100%) rename test/form/samples/emit-asset-file/_expected/assets/{logo-a2a2cdc4.svg => logo-Mw5Zq12q.svg} (100%) rename test/form/samples/emit-file-tree-shaken-access/_expected/assets/{logo-a2a2cdc4.svg => logo-Mw5Zq12q.svg} (100%) rename test/form/samples/emit-uint8array-no-buffer/_expected/assets/{asset-60cc5dc9 => asset-PPyJ5YHr} (100%) rename test/form/samples/emit-uint8array-no-buffer/_expected/assets/{asset-75590fc1 => asset-rVqBj9gL} (100%) rename test/form/samples/emit-uint8array-no-buffer/_expected/assets/{asset-8e3dd2ea => asset-tb9uIT4z} (100%) diff --git a/browser/LICENSE.md b/browser/LICENSE.md index 98239aca4..bb6a72be4 100644 --- a/browser/LICENSE.md +++ b/browser/LICENSE.md @@ -13,7 +13,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI # Licenses of bundled dependencies The published Rollup artifact additionally contains code with the following licenses: -MIT, ISC +MIT # Bundled dependencies: ## @jridgewell/sourcemap-codec @@ -86,35 +86,6 @@ Repository: lukeed/flru --------------------------------------- -## hash.js -License: MIT -By: Fedor Indutny -Repository: git@github.com:indutny/hash.js - ---------------------------------------- - -## inherits -License: ISC -Repository: git://github.com/isaacs/inherits - -> The ISC License -> -> Copyright (c) Isaac Z. Schlueter -> -> Permission to use, copy, modify, and/or distribute this software for any -> purpose with or without fee is hereby granted, provided that the above -> copyright notice and this permission notice appear in all copies. -> -> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -> REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -> FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -> INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -> LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -> OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -> PERFORMANCE OF THIS SOFTWARE. - ---------------------------------------- - ## is-reference License: MIT By: Rich Harris @@ -141,23 +112,3 @@ Repository: https://github.com/rich-harris/magic-string > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ---------------------------------------- - -## minimalistic-assert -License: ISC -Repository: https://github.com/calvinmetcalf/minimalistic-assert.git - -> Copyright 2015 Calvin Metcalf -> -> Permission to use, copy, modify, and/or distribute this software for any purpose -> with or without fee is hereby granted, provided that the above copyright notice -> and this permission notice appear in all copies. -> -> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -> REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -> FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -> INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -> LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -> OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -> PERFORMANCE OF THIS SOFTWARE. diff --git a/browser/src/crypto.ts b/browser/src/crypto.ts deleted file mode 100644 index c104e6cca..000000000 --- a/browser/src/crypto.ts +++ /dev/null @@ -1,6 +0,0 @@ -import sha256 from 'hash.js/lib/hash/sha/256'; - -export const createHash = (): { - digest: (format: string) => string; - update: (data: unknown) => void; -} => sha256(); diff --git a/browser/src/wasm.ts b/browser/src/wasm.ts index 2e9f2391a..d57a0c823 100644 --- a/browser/src/wasm.ts +++ b/browser/src/wasm.ts @@ -1,6 +1,2 @@ // eslint-disable-next-line import/no-unresolved -import { parse } from '../../wasm/bindings_wasm.js'; - -export default { - parse -}; +export { parse, xxhash_base64_url as xxhashBase64Url } from '../../wasm/bindings_wasm.js'; diff --git a/build-plugins/replace-browser-modules.ts b/build-plugins/replace-browser-modules.ts index f8a8af2e9..ff6a3c730 100644 --- a/build-plugins/replace-browser-modules.ts +++ b/build-plugins/replace-browser-modules.ts @@ -5,7 +5,6 @@ import type { Plugin } from 'vite'; const resolve = (path: string) => fileURLToPath(new URL(`../${path}`, import.meta.url)); const JS_REPLACED_MODULES = [ - 'crypto', 'fs', 'hookActions', 'path', diff --git a/native.d.ts b/native.d.ts index d96365261..61a294a9f 100644 --- a/native.d.ts +++ b/native.d.ts @@ -4,3 +4,4 @@ /* auto-generated by NAPI-RS */ export function parse(code: string, allowReturnOutsideFunction: boolean): Buffer +export function xxhashBase64Url(input: Uint8Array): string diff --git a/native.js b/native.js index a16b23546..3c63511cc 100644 --- a/native.js +++ b/native.js @@ -252,6 +252,7 @@ if (!nativeBinding) { throw new Error(`Failed to load native binding`) } -const { parse } = nativeBinding +const { parse, xxhashBase64Url } = nativeBinding module.exports.parse = parse +module.exports.xxhashBase64Url = xxhashBase64Url diff --git a/rust/Cargo.lock b/rust/Cargo.lock index f6bb6ea8a..b902dd103 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -139,6 +139,12 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "base64" +version = "0.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" + [[package]] name = "better_scoped_tls" version = "0.1.1" @@ -156,14 +162,17 @@ dependencies = [ "napi-build", "napi-derive", "parse_ast", + "xxhash", ] [[package]] name = "bindings_wasm" version = "0.0.0" dependencies = [ + "js-sys", "parse_ast", "wasm-bindgen", + "xxhash", ] [[package]] @@ -1422,7 +1431,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0d5177297253ff4013d2730770b4d28d227d168dbb5b3d7bc9dd785d1b07dc0" dependencies = [ "anyhow", - "base64", + "base64 0.13.1", "dashmap", "either", "indexmap", @@ -1899,7 +1908,7 @@ version = "0.178.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2313ff98bf87985b16be2d6ca7a3a9988888b6a02550a0eaa2a74cf2d2c7347" dependencies = [ - "base64", + "base64 0.13.1", "dashmap", "indexmap", "once_cell", @@ -2450,3 +2459,17 @@ name = "windows_x86_64_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "xxhash" +version = "0.0.0" +dependencies = [ + "base64 0.21.4", + "xxhash-rust", +] + +[[package]] +name = "xxhash-rust" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9828b178da53440fa9c766a3d2f73f7cf5d0ac1fe3980c1e5018d899fd19e07b" diff --git a/rust/Cargo.toml b/rust/Cargo.toml index c6b84b979..d3a9a7145 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -7,4 +7,5 @@ members = [ "bindings_napi", "bindings_wasm", "parse_ast", + "xxhash" ] diff --git a/rust/bindings_napi/Cargo.toml b/rust/bindings_napi/Cargo.toml index 516950089..1d7203866 100644 --- a/rust/bindings_napi/Cargo.toml +++ b/rust/bindings_napi/Cargo.toml @@ -13,6 +13,7 @@ crate-type = ["cdylib"] napi = { version = "2.12.2", default-features = false, features = ["napi4"] } napi-derive = "2.12.2" parse_ast = { path = "../parse_ast" } +xxhash = { path = "../xxhash" } [build-dependencies] napi-build = "2.0.1" diff --git a/rust/bindings_napi/src/lib.rs b/rust/bindings_napi/src/lib.rs index 295c404b3..ee4b8657c 100644 --- a/rust/bindings_napi/src/lib.rs +++ b/rust/bindings_napi/src/lib.rs @@ -3,8 +3,14 @@ use napi::bindgen_prelude::*; use napi_derive::napi; use parse_ast::parse_ast; +use xxhash; #[napi] pub fn parse(code: String, allow_return_outside_function: bool) -> Buffer { parse_ast(code, allow_return_outside_function).into() } + +#[napi] +pub fn xxhash_base64_url(input: Uint8Array) -> String { + xxhash::xxhash_base64_url(&input.to_vec()) +} diff --git a/rust/bindings_wasm/Cargo.toml b/rust/bindings_wasm/Cargo.toml index 50a988942..a596a4824 100644 --- a/rust/bindings_wasm/Cargo.toml +++ b/rust/bindings_wasm/Cargo.toml @@ -6,6 +6,8 @@ edition = "2021" [dependencies] wasm-bindgen = "0.2.87" parse_ast = { path = "../parse_ast" } +xxhash = { path = "../xxhash" } +js-sys = "0.3.64" [lib] crate-type = ["cdylib", "rlib"] diff --git a/rust/bindings_wasm/src/lib.rs b/rust/bindings_wasm/src/lib.rs index bc2c05455..5f7bec443 100644 --- a/rust/bindings_wasm/src/lib.rs +++ b/rust/bindings_wasm/src/lib.rs @@ -1,7 +1,14 @@ +use js_sys::Uint8Array; use parse_ast::parse_ast; use wasm_bindgen::prelude::*; +use xxhash; #[wasm_bindgen] pub fn parse(code: String, allow_return_outside_function: bool) -> Vec { parse_ast(code, allow_return_outside_function) } + +#[wasm_bindgen] +pub fn xxhash_base64_url(input: Uint8Array) -> String { + xxhash::xxhash_base64_url(&input.to_vec()) +} diff --git a/rust/parse_ast/src/lib.rs b/rust/parse_ast/src/lib.rs index 02061d427..992344420 100644 --- a/rust/parse_ast/src/lib.rs +++ b/rust/parse_ast/src/lib.rs @@ -1,6 +1,7 @@ #![feature(ptr_internals)] use std::sync::Arc; +use convert_ast::converter::AstConverter; use swc::config::IsModule::Unknown; use swc::{config::ParseOptions, Compiler}; use swc_common::sync::Lrc; @@ -8,8 +9,6 @@ use swc_common::{FileName, FilePathMapping, Globals, SourceMap, GLOBALS}; use swc_ecma_ast::EsVersion; use swc_ecma_parser::{EsConfig, Syntax}; -use convert_ast::converter::AstConverter; - use crate::convert_ast::annotations::SequentialComments; mod convert_ast; diff --git a/rust/xxhash/Cargo.toml b/rust/xxhash/Cargo.toml new file mode 100644 index 000000000..14df1f65e --- /dev/null +++ b/rust/xxhash/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "xxhash" +version = "0.0.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +base64 = '0.21.4' +xxhash-rust = { version = "0.8.7", features = ["xxh3"] } diff --git a/rust/xxhash/src/lib.rs b/rust/xxhash/src/lib.rs new file mode 100644 index 000000000..cc43619e5 --- /dev/null +++ b/rust/xxhash/src/lib.rs @@ -0,0 +1,7 @@ +use base64::{engine::general_purpose, Engine as _}; +use xxhash_rust::xxh3::xxh3_128; + +pub fn xxhash_base64_url(input: &[u8]) -> String { + let hash = xxh3_128(input).to_le_bytes(); + general_purpose::URL_SAFE_NO_PAD.encode(&hash) +} diff --git a/src/Graph.ts b/src/Graph.ts index c61a2f7b6..408b07965 100644 --- a/src/Graph.ts +++ b/src/Graph.ts @@ -1,5 +1,5 @@ import flru from 'flru'; -import native from '../native'; +import { parse } from '../native'; import type ExternalModule from './ExternalModule'; import Module from './Module'; import { ModuleLoader, type UnresolvedModule } from './ModuleLoader'; @@ -127,7 +127,7 @@ export default class Graph { code: string, { allowReturnOutsideFunction = false }: { allowReturnOutsideFunction?: boolean } = {} ): AstNode { - const astBuffer = native.parse(code, allowReturnOutsideFunction); + const astBuffer = parse(code, allowReturnOutsideFunction); const readString = getReadStringFunction(astBuffer); return convertProgram(astBuffer.buffer, readString); } diff --git a/src/utils/FileEmitter.ts b/src/utils/FileEmitter.ts index c5405eb4d..de2921320 100644 --- a/src/utils/FileEmitter.ts +++ b/src/utils/FileEmitter.ts @@ -11,7 +11,7 @@ import type { OutputChunk } from '../rollup/types'; import { BuildPhase } from './buildPhase'; -import { createHash } from './crypto'; +import { getXxhash } from './crypto'; import { getOrCreate } from './getOrCreate'; import { defaultHashSize } from './hashPlaceholders'; import { LOGLEVEL_WARN } from './logging'; @@ -33,10 +33,6 @@ import { extname } from './path'; import { isPathFragment } from './relativeId'; import { makeUnique, renderNamePattern } from './renderNamePattern'; -function getSourceHash(source: string | Uint8Array): string { - return createHash().update(source).digest('hex'); -} - function generateAssetFileName( name: string | undefined, source: string | Uint8Array, @@ -274,7 +270,7 @@ export class FileEmitter { if (consumedFile.fileName) { this.finalizeAdditionalAsset(consumedFile, consumedFile.source, output); } else { - const sourceHash = getSourceHash(consumedFile.source); + const sourceHash = getXxhash(consumedFile.source); getOrCreate(consumedAssetsByHash, sourceHash, () => []).push(consumedFile); } } else if (consumedFile.type === 'prebuilt-chunk') { @@ -294,7 +290,7 @@ export class FileEmitter { let referenceId = idBase; do { - referenceId = createHash().update(referenceId).digest('hex').slice(0, 8); + referenceId = getXxhash(referenceId).slice(0, 8).replaceAll('-', '$'); } while ( this.filesByReferenceId.has(referenceId) || this.outputFileEmitters.some(({ filesByReferenceId }) => filesByReferenceId.has(referenceId)) @@ -449,7 +445,7 @@ export class FileEmitter { // Deduplicate assets if an explicit fileName is not provided if (!fileName) { - const sourceHash = getSourceHash(source); + const sourceHash = getXxhash(source); fileName = fileNamesBySource.get(sourceHash); if (!fileName) { fileName = generateAssetFileName( diff --git a/src/utils/crypto.ts b/src/utils/crypto.ts index c230000be..0914b89cd 100644 --- a/src/utils/crypto.ts +++ b/src/utils/crypto.ts @@ -1,3 +1,17 @@ -import { createHash as cryptoCreateHash, type Hash } from 'node:crypto'; +import { xxhashBase64Url } from '../../native'; -export const createHash = (): Hash => cryptoCreateHash('sha256'); +let textEncoder: TextEncoder; +export function getXxhash(input: string | Uint8Array) { + let buffer: Uint8Array; + if (typeof input === 'string') { + if (typeof Buffer === 'undefined') { + textEncoder ??= new TextEncoder(); + buffer = textEncoder.encode(input); + } else { + buffer = Buffer.from(input); + } + } else { + buffer = input; + } + return xxhashBase64Url(buffer); +} diff --git a/src/utils/hashPlaceholders.ts b/src/utils/hashPlaceholders.ts index 2910da06f..15a2fa946 100644 --- a/src/utils/hashPlaceholders.ts +++ b/src/utils/hashPlaceholders.ts @@ -7,8 +7,8 @@ const hashPlaceholderLeft = '!~{'; const hashPlaceholderRight = '}~'; const hashPlaceholderOverhead = hashPlaceholderLeft.length + hashPlaceholderRight.length; -// This is the size of a sha256 -export const maxHashSize = 64; +// This is the size of a 128-bits xxhash with base64url encoding +export const maxHashSize = 22; export const defaultHashSize = 8; export type HashPlaceholderGenerator = (optionName: string, hashSize?: number) => string; diff --git a/src/utils/renderChunks.ts b/src/utils/renderChunks.ts index e154cc62d..4a24db0b9 100644 --- a/src/utils/renderChunks.ts +++ b/src/utils/renderChunks.ts @@ -9,7 +9,7 @@ import type { } from '../rollup/types'; import type { PluginDriver } from './PluginDriver'; import { collapseSourcemaps } from './collapseSourcemaps'; -import { createHash } from './crypto'; +import { getXxhash } from './crypto'; import { decodedSourcemap } from './decodedSourcemap'; import { replacePlaceholders, @@ -240,7 +240,7 @@ async function transformChunksAndGenerateContentHashes( // replaced with the same value before hashing const { containedPlaceholders, transformedCode } = replacePlaceholdersWithDefaultAndGetContainedPlaceholders(code, placeholders); - const hash = createHash().update(transformedCode); + let contentToHash = transformedCode; const hashAugmentation = pluginDriver.hookReduceValueSync( 'augmentChunkHash', '', @@ -253,12 +253,12 @@ async function transformChunksAndGenerateContentHashes( } ); if (hashAugmentation) { - hash.update(hashAugmentation); + contentToHash += hashAugmentation; } renderedChunksByPlaceholder.set(hashPlaceholder, transformedChunk); hashDependenciesByPlaceholder.set(hashPlaceholder, { containedPlaceholders, - contentHash: hash.digest('hex') + contentHash: getXxhash(contentToHash) }); } else { nonHashedChunksWithPlaceholders.push(transformedChunk); @@ -268,10 +268,7 @@ async function transformChunksAndGenerateContentHashes( if (map && sourcemapHashPlaceholder) { initialHashesByPlaceholder.set( preliminarySourcemapFileName.hashPlaceholder, - createHash() - .update(map.toString()) - .digest('hex') - .slice(0, preliminarySourcemapFileName.hashPlaceholder.length) + getXxhash(map.toString()).slice(0, preliminarySourcemapFileName.hashPlaceholder.length) ); } } @@ -293,12 +290,12 @@ function generateFinalHashes( ) { const hashesByPlaceholder = new Map(initialHashesByPlaceholder); for (const [placeholder, { fileName }] of renderedChunksByPlaceholder) { - let hash = createHash(); + let contentToHash = ''; const hashDependencyPlaceholders = new Set([placeholder]); for (const dependencyPlaceholder of hashDependencyPlaceholders) { const { containedPlaceholders, contentHash } = hashDependenciesByPlaceholder.get(dependencyPlaceholder)!; - hash.update(contentHash); + contentToHash += contentHash; for (const containedPlaceholder of containedPlaceholders) { // When looping over a map, setting an entry only causes a new iteration if the key is new hashDependencyPlaceholders.add(containedPlaceholder); @@ -309,9 +306,9 @@ function generateFinalHashes( do { // In case of a hash collision, create a hash of the hash if (finalHash) { - hash = createHash().update(finalHash); + contentToHash = finalHash; } - finalHash = hash.digest('hex').slice(0, placeholder.length); + finalHash = getXxhash(contentToHash).slice(0, placeholder.length); finalFileName = replaceSinglePlaceholder(fileName, placeholder, finalHash); } while (bundle[lowercaseBundleKeys].has(finalFileName.toLowerCase())); bundle[finalFileName] = FILE_PLACEHOLDER; diff --git a/test/browser/samples/supports-hashes/_expected/dep-bd733981.js b/test/browser/samples/supports-hashes/_expected/dep-KkHNeB29.js similarity index 100% rename from test/browser/samples/supports-hashes/_expected/dep-bd733981.js rename to test/browser/samples/supports-hashes/_expected/dep-KkHNeB29.js diff --git a/test/browser/samples/supports-hashes/_expected/main-70712c1f.js b/test/browser/samples/supports-hashes/_expected/main-70712c1f.js deleted file mode 100644 index 697a036fc..000000000 --- a/test/browser/samples/supports-hashes/_expected/main-70712c1f.js +++ /dev/null @@ -1,3 +0,0 @@ -import { foo } from './dep-bd733981.js'; - -console.log(foo); diff --git a/test/browser/samples/supports-hashes/_expected/main-pNv0QjL6.js b/test/browser/samples/supports-hashes/_expected/main-pNv0QjL6.js new file mode 100644 index 000000000..592340bf1 --- /dev/null +++ b/test/browser/samples/supports-hashes/_expected/main-pNv0QjL6.js @@ -0,0 +1,3 @@ +import { foo } from './dep-KkHNeB29.js'; + +console.log(foo); diff --git a/test/chunking-form/samples/emit-file/asset-file-names/_expected/amd/txt/b94d27b9-test.txt b/test/chunking-form/samples/emit-file/asset-file-names/_expected/amd/txt/x7YVzHWH-test.txt similarity index 100% rename from test/chunking-form/samples/emit-file/asset-file-names/_expected/amd/txt/b94d27b9-test.txt rename to test/chunking-form/samples/emit-file/asset-file-names/_expected/amd/txt/x7YVzHWH-test.txt diff --git a/test/chunking-form/samples/emit-file/asset-file-names/_expected/cjs/txt/b94d27b9-test.txt b/test/chunking-form/samples/emit-file/asset-file-names/_expected/cjs/txt/x7YVzHWH-test.txt similarity index 100% rename from test/chunking-form/samples/emit-file/asset-file-names/_expected/cjs/txt/b94d27b9-test.txt rename to test/chunking-form/samples/emit-file/asset-file-names/_expected/cjs/txt/x7YVzHWH-test.txt diff --git a/test/chunking-form/samples/emit-file/asset-file-names/_expected/es/txt/b94d27b9-test.txt b/test/chunking-form/samples/emit-file/asset-file-names/_expected/es/txt/x7YVzHWH-test.txt similarity index 100% rename from test/chunking-form/samples/emit-file/asset-file-names/_expected/es/txt/b94d27b9-test.txt rename to test/chunking-form/samples/emit-file/asset-file-names/_expected/es/txt/x7YVzHWH-test.txt diff --git a/test/chunking-form/samples/emit-file/asset-file-names/_expected/system/txt/b94d27b9-test.txt b/test/chunking-form/samples/emit-file/asset-file-names/_expected/system/txt/x7YVzHWH-test.txt similarity index 100% rename from test/chunking-form/samples/emit-file/asset-file-names/_expected/system/txt/b94d27b9-test.txt rename to test/chunking-form/samples/emit-file/asset-file-names/_expected/system/txt/x7YVzHWH-test.txt diff --git a/test/chunking-form/samples/emit-file/deduplicate-assets/_config.js b/test/chunking-form/samples/emit-file/deduplicate-assets/_config.js index 7c018f631..82d5f081f 100644 --- a/test/chunking-form/samples/emit-file/deduplicate-assets/_config.js +++ b/test/chunking-form/samples/emit-file/deduplicate-assets/_config.js @@ -69,37 +69,37 @@ module.exports = defineTest({ return null; }, generateBundle() { - assert.strictEqual(this.getFileName(string1Id), 'assets/string1-473287f8.txt', 'string1'); - assert.strictEqual(this.getFileName(string2Id), 'assets/string1-473287f8.txt', 'string2'); + assert.strictEqual(this.getFileName(string1Id), 'assets/string1-PAAt4eb8.txt', 'string1'); + assert.strictEqual(this.getFileName(string2Id), 'assets/string1-PAAt4eb8.txt', 'string2'); assert.strictEqual( this.getFileName(stringSameSourceId), - 'assets/string1-473287f8.txt', + 'assets/string1-PAAt4eb8.txt', 'stringSameSource' ); assert.strictEqual( this.getFileName(sameStringAsBufferId), - 'assets/string1-473287f8.txt', + 'assets/string1-PAAt4eb8.txt', 'sameStringAsBuffer' ); assert.strictEqual( this.getFileName(otherStringId), - 'assets/otherString-e296c1ca.txt', + 'assets/otherString-PiT4klzx.txt', 'otherString' ); - assert.strictEqual(this.getFileName(bufferId), 'assets/buffer-d0ca8c2a.txt', 'buffer'); + assert.strictEqual(this.getFileName(bufferId), 'assets/buffer-fV9J_shM.txt', 'buffer'); assert.strictEqual( this.getFileName(bufferSameSourceId), - 'assets/buffer-d0ca8c2a.txt', + 'assets/buffer-fV9J_shM.txt', 'bufferSameSource' ); assert.strictEqual( this.getFileName(sameBufferAsStringId), - 'assets/buffer-d0ca8c2a.txt', + 'assets/buffer-fV9J_shM.txt', 'sameBufferAsString' ); assert.strictEqual( this.getFileName(otherBufferId), - 'assets/otherBuffer-e8d9b528.txt', + 'assets/otherBuffer-Oh78Hjdg.txt', 'otherBuffer' ); } diff --git a/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assets/buffer-d0ca8c2a.txt b/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assets/buffer-fV9J_shM.txt similarity index 100% rename from test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assets/buffer-d0ca8c2a.txt rename to test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assets/buffer-fV9J_shM.txt diff --git a/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assets/otherBuffer-e8d9b528.txt b/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assets/otherBuffer-Oh78Hjdg.txt similarity index 100% rename from test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assets/otherBuffer-e8d9b528.txt rename to test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assets/otherBuffer-Oh78Hjdg.txt diff --git a/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assets/otherString-e296c1ca.txt b/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assets/otherString-PiT4klzx.txt similarity index 100% rename from test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assets/otherString-e296c1ca.txt rename to test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assets/otherString-PiT4klzx.txt diff --git a/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assets/string1-473287f8.txt b/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assets/string1-PAAt4eb8.txt similarity index 100% rename from test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assets/string1-473287f8.txt rename to test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assets/string1-PAAt4eb8.txt diff --git a/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assets/buffer-d0ca8c2a.txt b/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assets/buffer-fV9J_shM.txt similarity index 100% rename from test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assets/buffer-d0ca8c2a.txt rename to test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assets/buffer-fV9J_shM.txt diff --git a/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assets/otherBuffer-e8d9b528.txt b/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assets/otherBuffer-Oh78Hjdg.txt similarity index 100% rename from test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assets/otherBuffer-e8d9b528.txt rename to test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assets/otherBuffer-Oh78Hjdg.txt diff --git a/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assets/otherString-e296c1ca.txt b/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assets/otherString-PiT4klzx.txt similarity index 100% rename from test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assets/otherString-e296c1ca.txt rename to test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assets/otherString-PiT4klzx.txt diff --git a/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assets/string1-473287f8.txt b/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assets/string1-PAAt4eb8.txt similarity index 100% rename from test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assets/string1-473287f8.txt rename to test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assets/string1-PAAt4eb8.txt diff --git a/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assets/buffer-d0ca8c2a.txt b/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assets/buffer-fV9J_shM.txt similarity index 100% rename from test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assets/buffer-d0ca8c2a.txt rename to test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assets/buffer-fV9J_shM.txt diff --git a/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assets/otherBuffer-e8d9b528.txt b/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assets/otherBuffer-Oh78Hjdg.txt similarity index 100% rename from test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assets/otherBuffer-e8d9b528.txt rename to test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assets/otherBuffer-Oh78Hjdg.txt diff --git a/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assets/otherString-e296c1ca.txt b/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assets/otherString-PiT4klzx.txt similarity index 100% rename from test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assets/otherString-e296c1ca.txt rename to test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assets/otherString-PiT4klzx.txt diff --git a/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assets/string1-473287f8.txt b/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assets/string1-PAAt4eb8.txt similarity index 100% rename from test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assets/string1-473287f8.txt rename to test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assets/string1-PAAt4eb8.txt diff --git a/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assets/buffer-d0ca8c2a.txt b/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assets/buffer-fV9J_shM.txt similarity index 100% rename from test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assets/buffer-d0ca8c2a.txt rename to test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assets/buffer-fV9J_shM.txt diff --git a/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assets/otherBuffer-e8d9b528.txt b/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assets/otherBuffer-Oh78Hjdg.txt similarity index 100% rename from test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assets/otherBuffer-e8d9b528.txt rename to test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assets/otherBuffer-Oh78Hjdg.txt diff --git a/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assets/otherString-e296c1ca.txt b/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assets/otherString-PiT4klzx.txt similarity index 100% rename from test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assets/otherString-e296c1ca.txt rename to test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assets/otherString-PiT4klzx.txt diff --git a/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assets/string1-473287f8.txt b/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assets/string1-PAAt4eb8.txt similarity index 100% rename from test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assets/string1-473287f8.txt rename to test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assets/string1-PAAt4eb8.txt diff --git a/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/amd/assets/asset-b94d27b9 b/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/amd/assets/asset-x7YVzHWH similarity index 100% rename from test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/amd/assets/asset-b94d27b9 rename to test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/amd/assets/asset-x7YVzHWH diff --git a/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/cjs/assets/asset-b94d27b9 b/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/cjs/assets/asset-x7YVzHWH similarity index 100% rename from test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/cjs/assets/asset-b94d27b9 rename to test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/cjs/assets/asset-x7YVzHWH diff --git a/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/es/assets/asset-b94d27b9 b/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/es/assets/asset-x7YVzHWH similarity index 100% rename from test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/es/assets/asset-b94d27b9 rename to test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/es/assets/asset-x7YVzHWH diff --git a/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/system/assets/asset-b94d27b9 b/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/system/assets/asset-x7YVzHWH similarity index 100% rename from test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/system/assets/asset-b94d27b9 rename to test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/system/assets/asset-x7YVzHWH diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/banner-8c7ed2d9.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/banner-Pqjybijy.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/banner-8c7ed2d9.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/banner-Pqjybijy.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/buildEnd-6e08d992.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/buildEnd-bjZfkWaR.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/buildEnd-6e08d992.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/buildEnd-bjZfkWaR.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/buildStart-db9421f6.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/buildStart-jUsAaHhv.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/buildStart-db9421f6.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/buildStart-jUsAaHhv.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/footer-0301844c.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/footer-lepGH7ft.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/footer-0301844c.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/footer-lepGH7ft.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/generateBundle-5b9a4e56.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/generateBundle-YC5K5IqI.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/generateBundle-5b9a4e56.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/generateBundle-YC5K5IqI.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/intro-c432b372.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/intro-NT6UL-Ie.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/intro-c432b372.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/intro-NT6UL-Ie.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/load-0cf67fc7.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/load-f5EgoTqv.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/load-0cf67fc7.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/load-f5EgoTqv.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/outro-1e5fe046.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/outro-_McFrfAR.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/outro-1e5fe046.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/outro-_McFrfAR.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/renderChunk-aa9e49b7.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/renderChunk-DMYyTWqj.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/renderChunk-aa9e49b7.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/renderChunk-DMYyTWqj.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/renderStart-981aa2ea.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/renderStart-eFzm3QZM.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/renderStart-981aa2ea.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/renderStart-eFzm3QZM.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/resolveId-dd9bb7f8.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/resolveId-go8NkbCx.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/resolveId-dd9bb7f8.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/resolveId-go8NkbCx.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/transform-aa214ea3.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/transform-PQ2olIjk.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/transform-aa214ea3.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assets/transform-PQ2olIjk.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/banner-8c7ed2d9.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/banner-Pqjybijy.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/banner-8c7ed2d9.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/banner-Pqjybijy.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/buildEnd-6e08d992.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/buildEnd-bjZfkWaR.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/buildEnd-6e08d992.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/buildEnd-bjZfkWaR.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/buildStart-db9421f6.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/buildStart-jUsAaHhv.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/buildStart-db9421f6.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/buildStart-jUsAaHhv.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/footer-0301844c.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/footer-lepGH7ft.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/footer-0301844c.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/footer-lepGH7ft.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/generateBundle-5b9a4e56.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/generateBundle-YC5K5IqI.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/generateBundle-5b9a4e56.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/generateBundle-YC5K5IqI.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/intro-c432b372.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/intro-NT6UL-Ie.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/intro-c432b372.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/intro-NT6UL-Ie.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/load-0cf67fc7.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/load-f5EgoTqv.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/load-0cf67fc7.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/load-f5EgoTqv.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/outro-1e5fe046.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/outro-_McFrfAR.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/outro-1e5fe046.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/outro-_McFrfAR.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/renderChunk-aa9e49b7.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/renderChunk-DMYyTWqj.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/renderChunk-aa9e49b7.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/renderChunk-DMYyTWqj.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/renderStart-981aa2ea.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/renderStart-eFzm3QZM.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/renderStart-981aa2ea.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/renderStart-eFzm3QZM.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/resolveId-dd9bb7f8.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/resolveId-go8NkbCx.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/resolveId-dd9bb7f8.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/resolveId-go8NkbCx.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/transform-aa214ea3.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/transform-PQ2olIjk.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/transform-aa214ea3.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assets/transform-PQ2olIjk.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/banner-8c7ed2d9.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/banner-Pqjybijy.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/banner-8c7ed2d9.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/banner-Pqjybijy.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/buildEnd-6e08d992.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/buildEnd-bjZfkWaR.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/buildEnd-6e08d992.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/buildEnd-bjZfkWaR.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/buildStart-db9421f6.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/buildStart-jUsAaHhv.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/buildStart-db9421f6.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/buildStart-jUsAaHhv.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/footer-0301844c.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/footer-lepGH7ft.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/footer-0301844c.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/footer-lepGH7ft.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/generateBundle-5b9a4e56.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/generateBundle-YC5K5IqI.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/generateBundle-5b9a4e56.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/generateBundle-YC5K5IqI.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/intro-c432b372.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/intro-NT6UL-Ie.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/intro-c432b372.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/intro-NT6UL-Ie.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/load-0cf67fc7.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/load-f5EgoTqv.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/load-0cf67fc7.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/load-f5EgoTqv.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/outro-1e5fe046.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/outro-_McFrfAR.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/outro-1e5fe046.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/outro-_McFrfAR.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/renderChunk-aa9e49b7.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/renderChunk-DMYyTWqj.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/renderChunk-aa9e49b7.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/renderChunk-DMYyTWqj.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/renderStart-981aa2ea.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/renderStart-eFzm3QZM.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/renderStart-981aa2ea.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/renderStart-eFzm3QZM.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/resolveId-dd9bb7f8.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/resolveId-go8NkbCx.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/resolveId-dd9bb7f8.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/resolveId-go8NkbCx.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/transform-aa214ea3.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/transform-PQ2olIjk.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/transform-aa214ea3.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assets/transform-PQ2olIjk.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/banner-8c7ed2d9.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/banner-Pqjybijy.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/banner-8c7ed2d9.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/banner-Pqjybijy.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/buildEnd-6e08d992.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/buildEnd-bjZfkWaR.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/buildEnd-6e08d992.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/buildEnd-bjZfkWaR.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/buildStart-db9421f6.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/buildStart-jUsAaHhv.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/buildStart-db9421f6.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/buildStart-jUsAaHhv.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/footer-0301844c.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/footer-lepGH7ft.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/footer-0301844c.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/footer-lepGH7ft.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/generateBundle-5b9a4e56.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/generateBundle-YC5K5IqI.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/generateBundle-5b9a4e56.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/generateBundle-YC5K5IqI.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/intro-c432b372.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/intro-NT6UL-Ie.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/intro-c432b372.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/intro-NT6UL-Ie.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/load-0cf67fc7.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/load-f5EgoTqv.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/load-0cf67fc7.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/load-f5EgoTqv.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/outro-1e5fe046.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/outro-_McFrfAR.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/outro-1e5fe046.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/outro-_McFrfAR.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/renderChunk-aa9e49b7.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/renderChunk-DMYyTWqj.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/renderChunk-aa9e49b7.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/renderChunk-DMYyTWqj.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/renderStart-981aa2ea.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/renderStart-eFzm3QZM.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/renderStart-981aa2ea.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/renderStart-eFzm3QZM.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/resolveId-dd9bb7f8.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/resolveId-go8NkbCx.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/resolveId-dd9bb7f8.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/resolveId-go8NkbCx.txt diff --git a/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/transform-aa214ea3.txt b/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/transform-PQ2olIjk.txt similarity index 100% rename from test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/transform-aa214ea3.txt rename to test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assets/transform-PQ2olIjk.txt diff --git a/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/amd/assets/test-b94d27b9.txt b/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/amd/assets/test-x7YVzHWH.txt similarity index 100% rename from test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/amd/assets/test-b94d27b9.txt rename to test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/amd/assets/test-x7YVzHWH.txt diff --git a/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/cjs/assets/test-b94d27b9.txt b/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/cjs/assets/test-x7YVzHWH.txt similarity index 100% rename from test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/cjs/assets/test-b94d27b9.txt rename to test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/cjs/assets/test-x7YVzHWH.txt diff --git a/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/es/assets/test-b94d27b9.txt b/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/es/assets/test-x7YVzHWH.txt similarity index 100% rename from test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/es/assets/test-b94d27b9.txt rename to test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/es/assets/test-x7YVzHWH.txt diff --git a/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/system/assets/test-b94d27b9.txt b/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/system/assets/test-x7YVzHWH.txt similarity index 100% rename from test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/system/assets/test-b94d27b9.txt rename to test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/system/assets/test-x7YVzHWH.txt diff --git a/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/chunk-deb-87ce45a9-amd.js b/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/chunk-deb-9YxNr2n5-amd.js similarity index 100% rename from test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/chunk-deb-87ce45a9-amd.js rename to test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/chunk-deb-9YxNr2n5-amd.js diff --git a/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/entry-main-70ac024b-amd.js b/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/entry-main-2WHbe7ly-amd.js similarity index 72% rename from test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/entry-main-70ac024b-amd.js rename to test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/entry-main-2WHbe7ly-amd.js index bed6a1ef6..a8e20401a 100644 --- a/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/entry-main-70ac024b-amd.js +++ b/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/entry-main-2WHbe7ly-amd.js @@ -1,6 +1,6 @@ define(['require'], (function (require) { 'use strict'; console.log('main'); - new Promise(function (resolve, reject) { require(['./chunk-deb-87ce45a9-amd'], resolve, reject); }).then(console.log); + new Promise(function (resolve, reject) { require(['./chunk-deb-9YxNr2n5-amd'], resolve, reject); }).then(console.log); })); diff --git a/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/txt/b94d27b9-test.txt b/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/txt/x7YVzHWH-test.txt similarity index 100% rename from test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/txt/b94d27b9-test.txt rename to test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/txt/x7YVzHWH-test.txt diff --git a/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/chunk-deb-69905607-cjs.js b/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/chunk-deb-KO3me1q0-cjs.js similarity index 100% rename from test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/chunk-deb-69905607-cjs.js rename to test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/chunk-deb-KO3me1q0-cjs.js diff --git a/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/entry-main-780766d3-cjs.js b/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/entry-main-GKdCatel-cjs.js similarity index 70% rename from test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/entry-main-780766d3-cjs.js rename to test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/entry-main-GKdCatel-cjs.js index e28e6fa0c..8bf670103 100644 --- a/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/entry-main-780766d3-cjs.js +++ b/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/entry-main-GKdCatel-cjs.js @@ -1,4 +1,4 @@ 'use strict'; console.log('main'); -Promise.resolve().then(function () { return require('./chunk-deb-69905607-cjs.js'); }).then(console.log); +Promise.resolve().then(function () { return require('./chunk-deb-KO3me1q0-cjs.js'); }).then(console.log); diff --git a/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/txt/b94d27b9-test.txt b/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/txt/x7YVzHWH-test.txt similarity index 100% rename from test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/txt/b94d27b9-test.txt rename to test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/txt/x7YVzHWH-test.txt diff --git a/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/es/chunk-deb-9f85baf7-es.js b/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/es/chunk-deb-3ItlXRQy-es.js similarity index 100% rename from test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/es/chunk-deb-9f85baf7-es.js rename to test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/es/chunk-deb-3ItlXRQy-es.js diff --git a/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/es/entry-main-080ad38c-es.js b/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/es/entry-main-080ad38c-es.js deleted file mode 100644 index 0e182cf58..000000000 --- a/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/es/entry-main-080ad38c-es.js +++ /dev/null @@ -1,2 +0,0 @@ -console.log('main'); -import('./chunk-deb-9f85baf7-es.js').then(console.log); diff --git a/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/es/entry-main-mA3J9obY-es.js b/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/es/entry-main-mA3J9obY-es.js new file mode 100644 index 000000000..322a26f98 --- /dev/null +++ b/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/es/entry-main-mA3J9obY-es.js @@ -0,0 +1,2 @@ +console.log('main'); +import('./chunk-deb-3ItlXRQy-es.js').then(console.log); diff --git a/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/es/txt/b94d27b9-test.txt b/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/es/txt/x7YVzHWH-test.txt similarity index 100% rename from test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/es/txt/b94d27b9-test.txt rename to test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/es/txt/x7YVzHWH-test.txt diff --git a/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/system/chunk-deb-467d682b-system.js b/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/system/chunk-deb-BJKR2fPr-system.js similarity index 100% rename from test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/system/chunk-deb-467d682b-system.js rename to test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/system/chunk-deb-BJKR2fPr-system.js diff --git a/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/system/entry-main-5d41b5c4-system.js b/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/system/entry-main-ljrLE_qG-system.js similarity index 69% rename from test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/system/entry-main-5d41b5c4-system.js rename to test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/system/entry-main-ljrLE_qG-system.js index eadb26d88..c8349de79 100644 --- a/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/system/entry-main-5d41b5c4-system.js +++ b/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/system/entry-main-ljrLE_qG-system.js @@ -4,7 +4,7 @@ System.register([], (function (exports, module) { execute: (function () { console.log('main'); - module.import('./chunk-deb-467d682b-system.js').then(console.log); + module.import('./chunk-deb-BJKR2fPr-system.js').then(console.log); }) }; diff --git a/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/system/txt/b94d27b9-test.txt b/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/system/txt/x7YVzHWH-test.txt similarity index 100% rename from test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/system/txt/b94d27b9-test.txt rename to test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/system/txt/x7YVzHWH-test.txt diff --git a/test/chunking-form/samples/emit-file/reference-files/_expected/amd/assets/logo1-60bc15c4.svg b/test/chunking-form/samples/emit-file/reference-files/_expected/amd/assets/logo1-BarkEXVd.svg similarity index 100% rename from test/chunking-form/samples/emit-file/reference-files/_expected/amd/assets/logo1-60bc15c4.svg rename to test/chunking-form/samples/emit-file/reference-files/_expected/amd/assets/logo1-BarkEXVd.svg diff --git a/test/chunking-form/samples/emit-file/reference-files/_expected/amd/assets/logo2-fdaa7478.svg b/test/chunking-form/samples/emit-file/reference-files/_expected/amd/assets/logo2-yX706C0w.svg similarity index 100% rename from test/chunking-form/samples/emit-file/reference-files/_expected/amd/assets/logo2-fdaa7478.svg rename to test/chunking-form/samples/emit-file/reference-files/_expected/amd/assets/logo2-yX706C0w.svg diff --git a/test/chunking-form/samples/emit-file/reference-files/_expected/amd/main.js b/test/chunking-form/samples/emit-file/reference-files/_expected/amd/main.js index e56819894..8a142438d 100644 --- a/test/chunking-form/samples/emit-file/reference-files/_expected/amd/main.js +++ b/test/chunking-form/samples/emit-file/reference-files/_expected/amd/main.js @@ -1,6 +1,6 @@ define(['require', 'exports'], (function (require, exports) { 'use strict'; - var logo = new URL(require.toUrl('./assets/logo1-60bc15c4.svg'), document.baseURI).href; + var logo = new URL(require.toUrl('./assets/logo1-BarkEXVd.svg'), document.baseURI).href; function showImage(url) { console.log(url); diff --git a/test/chunking-form/samples/emit-file/reference-files/_expected/amd/nested/chunk.js b/test/chunking-form/samples/emit-file/reference-files/_expected/amd/nested/chunk.js index dcde89811..c03689df1 100644 --- a/test/chunking-form/samples/emit-file/reference-files/_expected/amd/nested/chunk.js +++ b/test/chunking-form/samples/emit-file/reference-files/_expected/amd/nested/chunk.js @@ -1,6 +1,6 @@ define(['require', '../main'], (function (require, main) { 'use strict'; - var logo = new URL(require.toUrl('../assets/logo2-fdaa7478.svg'), document.baseURI).href; + var logo = new URL(require.toUrl('../assets/logo2-yX706C0w.svg'), document.baseURI).href; main.showImage(logo); diff --git a/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/assets/logo1-60bc15c4.svg b/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/assets/logo1-BarkEXVd.svg similarity index 100% rename from test/chunking-form/samples/emit-file/reference-files/_expected/cjs/assets/logo1-60bc15c4.svg rename to test/chunking-form/samples/emit-file/reference-files/_expected/cjs/assets/logo1-BarkEXVd.svg diff --git a/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/assets/logo2-fdaa7478.svg b/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/assets/logo2-yX706C0w.svg similarity index 100% rename from test/chunking-form/samples/emit-file/reference-files/_expected/cjs/assets/logo2-fdaa7478.svg rename to test/chunking-form/samples/emit-file/reference-files/_expected/cjs/assets/logo2-yX706C0w.svg diff --git a/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/main.js b/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/main.js index 6576cadb0..6b7d5ab73 100644 --- a/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/main.js +++ b/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/main.js @@ -1,6 +1,6 @@ 'use strict'; -var logo = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/logo1-60bc15c4.svg').href : new URL('assets/logo1-60bc15c4.svg', document.currentScript && document.currentScript.src || document.baseURI).href); +var logo = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/logo1-BarkEXVd.svg').href : new URL('assets/logo1-BarkEXVd.svg', document.currentScript && document.currentScript.src || document.baseURI).href); function showImage(url) { console.log(url); diff --git a/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/nested/chunk.js b/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/nested/chunk.js index 72106cf5e..131505138 100644 --- a/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/nested/chunk.js +++ b/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/nested/chunk.js @@ -2,6 +2,6 @@ var main = require('../main.js'); -var logo = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/../assets/logo2-fdaa7478.svg').href : new URL('../assets/logo2-fdaa7478.svg', document.currentScript && document.currentScript.src || document.baseURI).href); +var logo = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/../assets/logo2-yX706C0w.svg').href : new URL('../assets/logo2-yX706C0w.svg', document.currentScript && document.currentScript.src || document.baseURI).href); main.showImage(logo); diff --git a/test/chunking-form/samples/emit-file/reference-files/_expected/es/assets/logo1-60bc15c4.svg b/test/chunking-form/samples/emit-file/reference-files/_expected/es/assets/logo1-BarkEXVd.svg similarity index 100% rename from test/chunking-form/samples/emit-file/reference-files/_expected/es/assets/logo1-60bc15c4.svg rename to test/chunking-form/samples/emit-file/reference-files/_expected/es/assets/logo1-BarkEXVd.svg diff --git a/test/chunking-form/samples/emit-file/reference-files/_expected/es/assets/logo2-fdaa7478.svg b/test/chunking-form/samples/emit-file/reference-files/_expected/es/assets/logo2-yX706C0w.svg similarity index 100% rename from test/chunking-form/samples/emit-file/reference-files/_expected/es/assets/logo2-fdaa7478.svg rename to test/chunking-form/samples/emit-file/reference-files/_expected/es/assets/logo2-yX706C0w.svg diff --git a/test/chunking-form/samples/emit-file/reference-files/_expected/es/main.js b/test/chunking-form/samples/emit-file/reference-files/_expected/es/main.js index 043250d9d..d7ef2486e 100644 --- a/test/chunking-form/samples/emit-file/reference-files/_expected/es/main.js +++ b/test/chunking-form/samples/emit-file/reference-files/_expected/es/main.js @@ -1,4 +1,4 @@ -var logo = new URL('assets/logo1-60bc15c4.svg', import.meta.url).href; +var logo = new URL('assets/logo1-BarkEXVd.svg', import.meta.url).href; function showImage(url) { console.log(url); diff --git a/test/chunking-form/samples/emit-file/reference-files/_expected/es/nested/chunk.js b/test/chunking-form/samples/emit-file/reference-files/_expected/es/nested/chunk.js index e8eb7621b..d87f90bd0 100644 --- a/test/chunking-form/samples/emit-file/reference-files/_expected/es/nested/chunk.js +++ b/test/chunking-form/samples/emit-file/reference-files/_expected/es/nested/chunk.js @@ -1,5 +1,5 @@ import { s as showImage } from '../main.js'; -var logo = new URL('../assets/logo2-fdaa7478.svg', import.meta.url).href; +var logo = new URL('../assets/logo2-yX706C0w.svg', import.meta.url).href; showImage(logo); diff --git a/test/chunking-form/samples/emit-file/reference-files/_expected/system/assets/logo1-60bc15c4.svg b/test/chunking-form/samples/emit-file/reference-files/_expected/system/assets/logo1-BarkEXVd.svg similarity index 100% rename from test/chunking-form/samples/emit-file/reference-files/_expected/system/assets/logo1-60bc15c4.svg rename to test/chunking-form/samples/emit-file/reference-files/_expected/system/assets/logo1-BarkEXVd.svg diff --git a/test/chunking-form/samples/emit-file/reference-files/_expected/system/assets/logo2-fdaa7478.svg b/test/chunking-form/samples/emit-file/reference-files/_expected/system/assets/logo2-yX706C0w.svg similarity index 100% rename from test/chunking-form/samples/emit-file/reference-files/_expected/system/assets/logo2-fdaa7478.svg rename to test/chunking-form/samples/emit-file/reference-files/_expected/system/assets/logo2-yX706C0w.svg diff --git a/test/chunking-form/samples/emit-file/reference-files/_expected/system/main.js b/test/chunking-form/samples/emit-file/reference-files/_expected/system/main.js index aeaba1fc6..db77cf0d5 100644 --- a/test/chunking-form/samples/emit-file/reference-files/_expected/system/main.js +++ b/test/chunking-form/samples/emit-file/reference-files/_expected/system/main.js @@ -5,7 +5,7 @@ System.register([], (function (exports, module) { exports('s', showImage); - var logo = new URL('assets/logo1-60bc15c4.svg', module.meta.url).href; + var logo = new URL('assets/logo1-BarkEXVd.svg', module.meta.url).href; function showImage(url) { console.log(url); diff --git a/test/chunking-form/samples/emit-file/reference-files/_expected/system/nested/chunk.js b/test/chunking-form/samples/emit-file/reference-files/_expected/system/nested/chunk.js index 3be6d4393..69612a70f 100644 --- a/test/chunking-form/samples/emit-file/reference-files/_expected/system/nested/chunk.js +++ b/test/chunking-form/samples/emit-file/reference-files/_expected/system/nested/chunk.js @@ -7,7 +7,7 @@ System.register(['../main.js'], (function (exports, module) { }], execute: (function () { - var logo = new URL('../assets/logo2-fdaa7478.svg', module.meta.url).href; + var logo = new URL('../assets/logo2-yX706C0w.svg', module.meta.url).href; showImage(logo); diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/banner-8c7ed2d9.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/banner-Pqjybijy.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/banner-8c7ed2d9.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/banner-Pqjybijy.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/footer-0301844c.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/footer-lepGH7ft.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/footer-0301844c.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/footer-lepGH7ft.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/generateBundle-6922b0a1.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/generateBundle-6922b0a1.txt deleted file mode 100644 index b00dcf278..000000000 --- a/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/generateBundle-6922b0a1.txt +++ /dev/null @@ -1 +0,0 @@ -generateBundle amd with assets/generateBundle-format-240389f4.txt \ No newline at end of file diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/generateBundle-KcqLI9cb.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/generateBundle-KcqLI9cb.txt new file mode 100644 index 000000000..b578c3775 --- /dev/null +++ b/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/generateBundle-KcqLI9cb.txt @@ -0,0 +1 @@ +generateBundle amd with assets/generateBundle-format-5jVvk-26.txt \ No newline at end of file diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/generateBundle-format-240389f4.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/generateBundle-format-5jVvk-26.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/generateBundle-format-240389f4.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/generateBundle-format-5jVvk-26.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/intro-c432b372.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/intro-NT6UL-Ie.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/intro-c432b372.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/intro-NT6UL-Ie.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/outro-1e5fe046.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/outro-_McFrfAR.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/outro-1e5fe046.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/outro-_McFrfAR.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/renderChunk-aa9e49b7.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/renderChunk-DMYyTWqj.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/renderChunk-aa9e49b7.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/renderChunk-DMYyTWqj.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/renderStart-981aa2ea.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/renderStart-eFzm3QZM.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/renderStart-981aa2ea.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/renderStart-eFzm3QZM.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/generateBundle.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/generateBundle.txt index b00dcf278..b578c3775 100644 --- a/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/generateBundle.txt +++ b/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/generateBundle.txt @@ -1 +1 @@ -generateBundle amd with assets/generateBundle-format-240389f4.txt \ No newline at end of file +generateBundle amd with assets/generateBundle-format-5jVvk-26.txt \ No newline at end of file diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/main.js b/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/main.js index ea3be9026..5a7d41715 100644 --- a/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/main.js +++ b/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/main.js @@ -1,6 +1,6 @@ define(['require', 'exports'], (function (require, exports) { 'use strict'; - const renderStart = new URL(require.toUrl('./assets/renderStart-981aa2ea.txt'), document.baseURI).href; + const renderStart = new URL(require.toUrl('./assets/renderStart-eFzm3QZM.txt'), document.baseURI).href; const renderStartNamed = new URL(require.toUrl('./renderStart.txt'), document.baseURI).href; const renderStartNamedImmediately = 'renderStart.txt'; const bannerNamed = new URL(require.toUrl('./banner.txt'), document.baseURI).href; diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/banner-8c7ed2d9.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/banner-Pqjybijy.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/banner-8c7ed2d9.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/banner-Pqjybijy.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/footer-0301844c.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/footer-lepGH7ft.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/footer-0301844c.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/footer-lepGH7ft.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/generateBundle-b1a5f14c.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/generateBundle-b1a5f14c.txt deleted file mode 100644 index 21e7f9971..000000000 --- a/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/generateBundle-b1a5f14c.txt +++ /dev/null @@ -1 +0,0 @@ -generateBundle cjs with assets/generateBundle-format-4efb05bc.txt \ No newline at end of file diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/generateBundle-format-4efb05bc.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/generateBundle-format-9Z73n2OP.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/generateBundle-format-4efb05bc.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/generateBundle-format-9Z73n2OP.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/generateBundle-yF5Q0doc.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/generateBundle-yF5Q0doc.txt new file mode 100644 index 000000000..fef800828 --- /dev/null +++ b/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/generateBundle-yF5Q0doc.txt @@ -0,0 +1 @@ +generateBundle cjs with assets/generateBundle-format-9Z73n2OP.txt \ No newline at end of file diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/intro-c432b372.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/intro-NT6UL-Ie.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/intro-c432b372.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/intro-NT6UL-Ie.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/outro-1e5fe046.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/outro-_McFrfAR.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/outro-1e5fe046.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/outro-_McFrfAR.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/renderChunk-aa9e49b7.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/renderChunk-DMYyTWqj.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/renderChunk-aa9e49b7.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/renderChunk-DMYyTWqj.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/renderStart-981aa2ea.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/renderStart-eFzm3QZM.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/renderStart-981aa2ea.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/renderStart-eFzm3QZM.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/generateBundle.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/generateBundle.txt index 21e7f9971..fef800828 100644 --- a/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/generateBundle.txt +++ b/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/generateBundle.txt @@ -1 +1 @@ -generateBundle cjs with assets/generateBundle-format-4efb05bc.txt \ No newline at end of file +generateBundle cjs with assets/generateBundle-format-9Z73n2OP.txt \ No newline at end of file diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/main.js b/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/main.js index cc1b26907..bfad8ae2d 100644 --- a/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/main.js +++ b/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/main.js @@ -1,6 +1,6 @@ 'use strict'; -const renderStart = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/renderStart-981aa2ea.txt').href : new URL('assets/renderStart-981aa2ea.txt', document.currentScript && document.currentScript.src || document.baseURI).href); +const renderStart = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/renderStart-eFzm3QZM.txt').href : new URL('assets/renderStart-eFzm3QZM.txt', document.currentScript && document.currentScript.src || document.baseURI).href); const renderStartNamed = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/renderStart.txt').href : new URL('renderStart.txt', document.currentScript && document.currentScript.src || document.baseURI).href); const renderStartNamedImmediately = 'renderStart.txt'; const bannerNamed = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/banner.txt').href : new URL('banner.txt', document.currentScript && document.currentScript.src || document.baseURI).href); diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/banner-8c7ed2d9.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/banner-Pqjybijy.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/banner-8c7ed2d9.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/banner-Pqjybijy.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/footer-0301844c.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/footer-lepGH7ft.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/footer-0301844c.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/footer-lepGH7ft.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/generateBundle-668db42d.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/generateBundle-668db42d.txt deleted file mode 100644 index 253f7587c..000000000 --- a/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/generateBundle-668db42d.txt +++ /dev/null @@ -1 +0,0 @@ -generateBundle es with assets/generateBundle-format-c0bc1e08.txt \ No newline at end of file diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/generateBundle-9uv4IgKv.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/generateBundle-9uv4IgKv.txt new file mode 100644 index 000000000..3574605a8 --- /dev/null +++ b/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/generateBundle-9uv4IgKv.txt @@ -0,0 +1 @@ +generateBundle es with assets/generateBundle-format-en7tITil.txt \ No newline at end of file diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/generateBundle-format-c0bc1e08.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/generateBundle-format-en7tITil.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/generateBundle-format-c0bc1e08.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/generateBundle-format-en7tITil.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/intro-c432b372.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/intro-NT6UL-Ie.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/intro-c432b372.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/intro-NT6UL-Ie.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/outro-1e5fe046.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/outro-_McFrfAR.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/outro-1e5fe046.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/outro-_McFrfAR.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/renderChunk-aa9e49b7.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/renderChunk-DMYyTWqj.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/renderChunk-aa9e49b7.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/renderChunk-DMYyTWqj.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/renderStart-981aa2ea.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/renderStart-eFzm3QZM.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/renderStart-981aa2ea.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/renderStart-eFzm3QZM.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/generateBundle.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/generateBundle.txt index 253f7587c..3574605a8 100644 --- a/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/generateBundle.txt +++ b/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/generateBundle.txt @@ -1 +1 @@ -generateBundle es with assets/generateBundle-format-c0bc1e08.txt \ No newline at end of file +generateBundle es with assets/generateBundle-format-en7tITil.txt \ No newline at end of file diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/main.js b/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/main.js index 1e7d92b70..646524d9f 100644 --- a/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/main.js +++ b/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/main.js @@ -1,4 +1,4 @@ -const renderStart = new URL('assets/renderStart-981aa2ea.txt', import.meta.url).href; +const renderStart = new URL('assets/renderStart-eFzm3QZM.txt', import.meta.url).href; const renderStartNamed = new URL('renderStart.txt', import.meta.url).href; const renderStartNamedImmediately = 'renderStart.txt'; const bannerNamed = new URL('banner.txt', import.meta.url).href; diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/banner-8c7ed2d9.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/banner-Pqjybijy.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/banner-8c7ed2d9.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/banner-Pqjybijy.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/footer-0301844c.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/footer-lepGH7ft.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/footer-0301844c.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/footer-lepGH7ft.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/generateBundle-WoWY_GTC.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/generateBundle-WoWY_GTC.txt new file mode 100644 index 000000000..ebf5e4e27 --- /dev/null +++ b/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/generateBundle-WoWY_GTC.txt @@ -0,0 +1 @@ +generateBundle system with assets/generateBundle-format-XDhKOEdw.txt \ No newline at end of file diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/generateBundle-b0505b8f.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/generateBundle-b0505b8f.txt deleted file mode 100644 index 7b9889b5a..000000000 --- a/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/generateBundle-b0505b8f.txt +++ /dev/null @@ -1 +0,0 @@ -generateBundle system with assets/generateBundle-format-bbc5e661.txt \ No newline at end of file diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/generateBundle-format-bbc5e661.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/generateBundle-format-XDhKOEdw.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/generateBundle-format-bbc5e661.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/generateBundle-format-XDhKOEdw.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/intro-c432b372.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/intro-NT6UL-Ie.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/intro-c432b372.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/intro-NT6UL-Ie.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/outro-1e5fe046.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/outro-_McFrfAR.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/outro-1e5fe046.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/outro-_McFrfAR.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/renderChunk-aa9e49b7.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/renderChunk-DMYyTWqj.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/renderChunk-aa9e49b7.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/renderChunk-DMYyTWqj.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/renderStart-981aa2ea.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/renderStart-eFzm3QZM.txt similarity index 100% rename from test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/renderStart-981aa2ea.txt rename to test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/renderStart-eFzm3QZM.txt diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/generateBundle.txt b/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/generateBundle.txt index 7b9889b5a..ebf5e4e27 100644 --- a/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/generateBundle.txt +++ b/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/generateBundle.txt @@ -1 +1 @@ -generateBundle system with assets/generateBundle-format-bbc5e661.txt \ No newline at end of file +generateBundle system with assets/generateBundle-format-XDhKOEdw.txt \ No newline at end of file diff --git a/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/main.js b/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/main.js index ecff092f8..70e186a23 100644 --- a/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/main.js +++ b/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/main.js @@ -3,7 +3,7 @@ System.register([], (function (exports, module) { return { execute: (function () { - const renderStart = exports('renderStart', new URL('assets/renderStart-981aa2ea.txt', module.meta.url).href); + const renderStart = exports('renderStart', new URL('assets/renderStart-eFzm3QZM.txt', module.meta.url).href); const renderStartNamed = exports('renderStartNamed', new URL('renderStart.txt', module.meta.url).href); const renderStartNamedImmediately = exports('renderStartNamedImmediately', 'renderStart.txt'); const bannerNamed = exports('bannerNamed', new URL('banner.txt', module.meta.url).href); diff --git a/test/chunking-form/samples/filenames-patterns/_expected/amd/chunk-main2-a7baadb6-amd.js b/test/chunking-form/samples/filenames-patterns/_expected/amd/chunk-main2-cf881rtr-amd.js similarity index 100% rename from test/chunking-form/samples/filenames-patterns/_expected/amd/chunk-main2-a7baadb6-amd.js rename to test/chunking-form/samples/filenames-patterns/_expected/amd/chunk-main2-cf881rtr-amd.js diff --git a/test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main1-94fe149e-amd.js b/test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main1-94fe149e-amd.js deleted file mode 100644 index f06358c37..000000000 --- a/test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main1-94fe149e-amd.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./chunk-main2-a7baadb6-amd'], (function (main2) { 'use strict'; - - main2.log(main2.dep); - -})); diff --git a/test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main1-CBKFi7eG-amd.js b/test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main1-CBKFi7eG-amd.js new file mode 100644 index 000000000..962a36022 --- /dev/null +++ b/test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main1-CBKFi7eG-amd.js @@ -0,0 +1,5 @@ +define(['./chunk-main2-cf881rtr-amd'], (function (main2) { 'use strict'; + + main2.log(main2.dep); + +})); diff --git a/test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main2-16bafa95-amd.js b/test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main2-16bafa95-amd.js deleted file mode 100644 index 27e38c818..000000000 --- a/test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main2-16bafa95-amd.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./chunk-main2-a7baadb6-amd'], (function (main2) { 'use strict'; - - - - return main2.log; - -})); diff --git a/test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main2-U19f7Kkv-amd.js b/test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main2-U19f7Kkv-amd.js new file mode 100644 index 000000000..676c16f83 --- /dev/null +++ b/test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main2-U19f7Kkv-amd.js @@ -0,0 +1,7 @@ +define(['./chunk-main2-cf881rtr-amd'], (function (main2) { 'use strict'; + + + + return main2.log; + +})); diff --git a/test/chunking-form/samples/filenames-patterns/_expected/cjs/chunk-main2-399c15fc-cjs.js b/test/chunking-form/samples/filenames-patterns/_expected/cjs/chunk-main2-2eAijmim-cjs.js similarity index 100% rename from test/chunking-form/samples/filenames-patterns/_expected/cjs/chunk-main2-399c15fc-cjs.js rename to test/chunking-form/samples/filenames-patterns/_expected/cjs/chunk-main2-2eAijmim-cjs.js diff --git a/test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main1-2934d4fa-cjs.js b/test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main1-2934d4fa-cjs.js deleted file mode 100644 index b3ace5cc3..000000000 --- a/test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main1-2934d4fa-cjs.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var main2 = require('./chunk-main2-399c15fc-cjs.js'); - -main2.log(main2.dep); diff --git a/test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main1-i42FQ2i5-cjs.js b/test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main1-i42FQ2i5-cjs.js new file mode 100644 index 000000000..ab61f3a30 --- /dev/null +++ b/test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main1-i42FQ2i5-cjs.js @@ -0,0 +1,5 @@ +'use strict'; + +var main2 = require('./chunk-main2-2eAijmim-cjs.js'); + +main2.log(main2.dep); diff --git a/test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main2-523204ff-cjs.js b/test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main2-523204ff-cjs.js deleted file mode 100644 index a2103eea7..000000000 --- a/test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main2-523204ff-cjs.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -var main2 = require('./chunk-main2-399c15fc-cjs.js'); - - - -module.exports = main2.log; diff --git a/test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main2-e914JHZ0-cjs.js b/test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main2-e914JHZ0-cjs.js new file mode 100644 index 000000000..d51b2084d --- /dev/null +++ b/test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main2-e914JHZ0-cjs.js @@ -0,0 +1,7 @@ +'use strict'; + +var main2 = require('./chunk-main2-2eAijmim-cjs.js'); + + + +module.exports = main2.log; diff --git a/test/chunking-form/samples/filenames-patterns/_expected/es/chunk-main2-c42fce1a-es.js b/test/chunking-form/samples/filenames-patterns/_expected/es/chunk-main2-IiSmXREe-es.js similarity index 100% rename from test/chunking-form/samples/filenames-patterns/_expected/es/chunk-main2-c42fce1a-es.js rename to test/chunking-form/samples/filenames-patterns/_expected/es/chunk-main2-IiSmXREe-es.js diff --git a/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main1-6f12c5b2-es.js b/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main1-6f12c5b2-es.js deleted file mode 100644 index 43a51c026..000000000 --- a/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main1-6f12c5b2-es.js +++ /dev/null @@ -1,3 +0,0 @@ -import { l as log, d as dep } from './chunk-main2-c42fce1a-es.js'; - -log(dep); diff --git a/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main1-JQIS3SKF-es.js b/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main1-JQIS3SKF-es.js new file mode 100644 index 000000000..9efa2c141 --- /dev/null +++ b/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main1-JQIS3SKF-es.js @@ -0,0 +1,3 @@ +import { l as log, d as dep } from './chunk-main2-IiSmXREe-es.js'; + +log(dep); diff --git a/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main2-6DNkLKmG-es.js b/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main2-6DNkLKmG-es.js new file mode 100644 index 000000000..35eb81b45 --- /dev/null +++ b/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main2-6DNkLKmG-es.js @@ -0,0 +1 @@ +export { l as default } from './chunk-main2-IiSmXREe-es.js'; diff --git a/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main2-a9b323b4-es.js b/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main2-a9b323b4-es.js deleted file mode 100644 index ebb3c3e89..000000000 --- a/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main2-a9b323b4-es.js +++ /dev/null @@ -1 +0,0 @@ -export { l as default } from './chunk-main2-c42fce1a-es.js'; diff --git a/test/chunking-form/samples/filenames-patterns/_expected/system/chunk-main2-9cc03624-system.js b/test/chunking-form/samples/filenames-patterns/_expected/system/chunk-main2-cN2LIF0L-system.js similarity index 100% rename from test/chunking-form/samples/filenames-patterns/_expected/system/chunk-main2-9cc03624-system.js rename to test/chunking-form/samples/filenames-patterns/_expected/system/chunk-main2-cN2LIF0L-system.js diff --git a/test/chunking-form/samples/filenames-patterns/_expected/system/entry-main1-720299cf-system.js b/test/chunking-form/samples/filenames-patterns/_expected/system/entry-main1-3xo1S8a0-system.js similarity index 73% rename from test/chunking-form/samples/filenames-patterns/_expected/system/entry-main1-720299cf-system.js rename to test/chunking-form/samples/filenames-patterns/_expected/system/entry-main1-3xo1S8a0-system.js index bbe15d21f..1715f48cd 100644 --- a/test/chunking-form/samples/filenames-patterns/_expected/system/entry-main1-720299cf-system.js +++ b/test/chunking-form/samples/filenames-patterns/_expected/system/entry-main1-3xo1S8a0-system.js @@ -1,4 +1,4 @@ -System.register(['./chunk-main2-9cc03624-system.js'], (function () { +System.register(['./chunk-main2-cN2LIF0L-system.js'], (function () { 'use strict'; var log, dep; return { diff --git a/test/chunking-form/samples/filenames-patterns/_expected/system/entry-main2-c3cb1622-system.js b/test/chunking-form/samples/filenames-patterns/_expected/system/entry-main2-RI9cN2Cj-system.js similarity index 70% rename from test/chunking-form/samples/filenames-patterns/_expected/system/entry-main2-c3cb1622-system.js rename to test/chunking-form/samples/filenames-patterns/_expected/system/entry-main2-RI9cN2Cj-system.js index 8b0dde3a3..bec58bbe1 100644 --- a/test/chunking-form/samples/filenames-patterns/_expected/system/entry-main2-c3cb1622-system.js +++ b/test/chunking-form/samples/filenames-patterns/_expected/system/entry-main2-RI9cN2Cj-system.js @@ -1,4 +1,4 @@ -System.register(['./chunk-main2-9cc03624-system.js'], (function (exports) { +System.register(['./chunk-main2-cN2LIF0L-system.js'], (function (exports) { 'use strict'; return { setters: [function (module) { diff --git a/test/chunking-form/samples/hashing/deconflict-hashes/_expected/amd/entry-7061c38c.js b/test/chunking-form/samples/hashing/deconflict-hashes/_expected/amd/entry-BjVZZvuI.js similarity index 100% rename from test/chunking-form/samples/hashing/deconflict-hashes/_expected/amd/entry-7061c38c.js rename to test/chunking-form/samples/hashing/deconflict-hashes/_expected/amd/entry-BjVZZvuI.js diff --git a/test/chunking-form/samples/hashing/deconflict-hashes/_expected/amd/entry-82a5a8a4.js b/test/chunking-form/samples/hashing/deconflict-hashes/_expected/amd/entry-_kM9k9Bx.js similarity index 100% rename from test/chunking-form/samples/hashing/deconflict-hashes/_expected/amd/entry-82a5a8a4.js rename to test/chunking-form/samples/hashing/deconflict-hashes/_expected/amd/entry-_kM9k9Bx.js diff --git a/test/chunking-form/samples/hashing/deconflict-hashes/_expected/cjs/entry-8011025d.js b/test/chunking-form/samples/hashing/deconflict-hashes/_expected/cjs/entry-BAMj_W0O.js similarity index 100% rename from test/chunking-form/samples/hashing/deconflict-hashes/_expected/cjs/entry-8011025d.js rename to test/chunking-form/samples/hashing/deconflict-hashes/_expected/cjs/entry-BAMj_W0O.js diff --git a/test/chunking-form/samples/hashing/deconflict-hashes/_expected/cjs/entry-fc7b26ff.js b/test/chunking-form/samples/hashing/deconflict-hashes/_expected/cjs/entry-ivriA37N.js similarity index 100% rename from test/chunking-form/samples/hashing/deconflict-hashes/_expected/cjs/entry-fc7b26ff.js rename to test/chunking-form/samples/hashing/deconflict-hashes/_expected/cjs/entry-ivriA37N.js diff --git a/test/chunking-form/samples/hashing/deconflict-hashes/_expected/es/entry-2b8647b5.js b/test/chunking-form/samples/hashing/deconflict-hashes/_expected/es/entry-Gs557UIb.js similarity index 100% rename from test/chunking-form/samples/hashing/deconflict-hashes/_expected/es/entry-2b8647b5.js rename to test/chunking-form/samples/hashing/deconflict-hashes/_expected/es/entry-Gs557UIb.js diff --git a/test/chunking-form/samples/hashing/deconflict-hashes/_expected/es/entry-369b04c8.js b/test/chunking-form/samples/hashing/deconflict-hashes/_expected/es/entry-Y0flmsE_.js similarity index 100% rename from test/chunking-form/samples/hashing/deconflict-hashes/_expected/es/entry-369b04c8.js rename to test/chunking-form/samples/hashing/deconflict-hashes/_expected/es/entry-Y0flmsE_.js diff --git a/test/chunking-form/samples/hashing/deconflict-hashes/_expected/system/entry-54240e14.js b/test/chunking-form/samples/hashing/deconflict-hashes/_expected/system/entry-aiNN2RB-.js similarity index 100% rename from test/chunking-form/samples/hashing/deconflict-hashes/_expected/system/entry-54240e14.js rename to test/chunking-form/samples/hashing/deconflict-hashes/_expected/system/entry-aiNN2RB-.js diff --git a/test/chunking-form/samples/hashing/deconflict-hashes/_expected/system/entry-ed8fdbb3.js b/test/chunking-form/samples/hashing/deconflict-hashes/_expected/system/entry-yZdFXPRq.js similarity index 100% rename from test/chunking-form/samples/hashing/deconflict-hashes/_expected/system/entry-ed8fdbb3.js rename to test/chunking-form/samples/hashing/deconflict-hashes/_expected/system/entry-yZdFXPRq.js diff --git a/test/chunking-form/samples/hashing/double-hash/_expected/amd/7061c38c/entry-7061c38c.js b/test/chunking-form/samples/hashing/double-hash/_expected/amd/_kM9k9Bx/entry-_kM9k9Bx.js similarity index 100% rename from test/chunking-form/samples/hashing/double-hash/_expected/amd/7061c38c/entry-7061c38c.js rename to test/chunking-form/samples/hashing/double-hash/_expected/amd/_kM9k9Bx/entry-_kM9k9Bx.js diff --git a/test/chunking-form/samples/hashing/double-hash/_expected/cjs/8011025d/entry-8011025d.js b/test/chunking-form/samples/hashing/double-hash/_expected/cjs/ivriA37N/entry-ivriA37N.js similarity index 100% rename from test/chunking-form/samples/hashing/double-hash/_expected/cjs/8011025d/entry-8011025d.js rename to test/chunking-form/samples/hashing/double-hash/_expected/cjs/ivriA37N/entry-ivriA37N.js diff --git a/test/chunking-form/samples/hashing/double-hash/_expected/es/2b8647b5/entry-2b8647b5.js b/test/chunking-form/samples/hashing/double-hash/_expected/es/Y0flmsE_/entry-Y0flmsE_.js similarity index 100% rename from test/chunking-form/samples/hashing/double-hash/_expected/es/2b8647b5/entry-2b8647b5.js rename to test/chunking-form/samples/hashing/double-hash/_expected/es/Y0flmsE_/entry-Y0flmsE_.js diff --git a/test/chunking-form/samples/hashing/double-hash/_expected/system/54240e14/entry-54240e14.js b/test/chunking-form/samples/hashing/double-hash/_expected/system/yZdFXPRq/entry-yZdFXPRq.js similarity index 100% rename from test/chunking-form/samples/hashing/double-hash/_expected/system/54240e14/entry-54240e14.js rename to test/chunking-form/samples/hashing/double-hash/_expected/system/yZdFXPRq/entry-yZdFXPRq.js diff --git a/test/chunking-form/samples/hashing/hash-size/_expected/amd/dep-5905830720d5f3.js b/test/chunking-form/samples/hashing/hash-size/_expected/amd/dep-eCO4iyaHEVP2U2.js similarity index 100% rename from test/chunking-form/samples/hashing/hash-size/_expected/amd/dep-5905830720d5f3.js rename to test/chunking-form/samples/hashing/hash-size/_expected/amd/dep-eCO4iyaHEVP2U2.js diff --git a/test/chunking-form/samples/hashing/hash-size/_expected/amd/main1-9bGLbd-q.js b/test/chunking-form/samples/hashing/hash-size/_expected/amd/main1-9bGLbd-q.js new file mode 100644 index 000000000..438974a00 --- /dev/null +++ b/test/chunking-form/samples/hashing/hash-size/_expected/amd/main1-9bGLbd-q.js @@ -0,0 +1,5 @@ +define(['./dep-eCO4iyaHEVP2U2'], (function (dep) { 'use strict'; + + console.log('main1'); + +})); diff --git a/test/chunking-form/samples/hashing/hash-size/_expected/amd/main1-eb0f074f.js b/test/chunking-form/samples/hashing/hash-size/_expected/amd/main1-eb0f074f.js deleted file mode 100644 index 3f3a68618..000000000 --- a/test/chunking-form/samples/hashing/hash-size/_expected/amd/main1-eb0f074f.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./dep-5905830720d5f3'], (function (dep) { 'use strict'; - - console.log('main1'); - -})); diff --git a/test/chunking-form/samples/hashing/hash-size/_expected/amd/main2-5gkbLhN4J6.js b/test/chunking-form/samples/hashing/hash-size/_expected/amd/main2-5gkbLhN4J6.js new file mode 100644 index 000000000..160493aba --- /dev/null +++ b/test/chunking-form/samples/hashing/hash-size/_expected/amd/main2-5gkbLhN4J6.js @@ -0,0 +1,5 @@ +define(['./dep-eCO4iyaHEVP2U2'], (function (dep) { 'use strict'; + + console.log('main2'); + +})); diff --git a/test/chunking-form/samples/hashing/hash-size/_expected/amd/main2-b24fb22e7f.js b/test/chunking-form/samples/hashing/hash-size/_expected/amd/main2-b24fb22e7f.js deleted file mode 100644 index e4c34f3a2..000000000 --- a/test/chunking-form/samples/hashing/hash-size/_expected/amd/main2-b24fb22e7f.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./dep-5905830720d5f3'], (function (dep) { 'use strict'; - - console.log('main2'); - -})); diff --git a/test/chunking-form/samples/hashing/hash-size/_expected/amd/test-9f86d081884c7d659a.txt b/test/chunking-form/samples/hashing/hash-size/_expected/amd/test-uF-4QoZ1HtBY01G94-.txt similarity index 100% rename from test/chunking-form/samples/hashing/hash-size/_expected/amd/test-9f86d081884c7d659a.txt rename to test/chunking-form/samples/hashing/hash-size/_expected/amd/test-uF-4QoZ1HtBY01G94-.txt diff --git a/test/chunking-form/samples/hashing/hash-size/_expected/cjs/dep-0f12b4bf62a634.js b/test/chunking-form/samples/hashing/hash-size/_expected/cjs/dep-YVivKZa3-xWdJj.js similarity index 100% rename from test/chunking-form/samples/hashing/hash-size/_expected/cjs/dep-0f12b4bf62a634.js rename to test/chunking-form/samples/hashing/hash-size/_expected/cjs/dep-YVivKZa3-xWdJj.js diff --git a/test/chunking-form/samples/hashing/hash-size/_expected/cjs/main1-87405ba3.js b/test/chunking-form/samples/hashing/hash-size/_expected/cjs/main1-hNgwlFpU.js similarity index 51% rename from test/chunking-form/samples/hashing/hash-size/_expected/cjs/main1-87405ba3.js rename to test/chunking-form/samples/hashing/hash-size/_expected/cjs/main1-hNgwlFpU.js index 5b8fcb08e..61a963dbd 100644 --- a/test/chunking-form/samples/hashing/hash-size/_expected/cjs/main1-87405ba3.js +++ b/test/chunking-form/samples/hashing/hash-size/_expected/cjs/main1-hNgwlFpU.js @@ -1,5 +1,5 @@ 'use strict'; -require('./dep-0f12b4bf62a634.js'); +require('./dep-YVivKZa3-xWdJj.js'); console.log('main1'); diff --git a/test/chunking-form/samples/hashing/hash-size/_expected/cjs/main2-b2c59bdf14.js b/test/chunking-form/samples/hashing/hash-size/_expected/cjs/main2-VmtfVxsamQ.js similarity index 51% rename from test/chunking-form/samples/hashing/hash-size/_expected/cjs/main2-b2c59bdf14.js rename to test/chunking-form/samples/hashing/hash-size/_expected/cjs/main2-VmtfVxsamQ.js index 908db6fb4..dae1e640b 100644 --- a/test/chunking-form/samples/hashing/hash-size/_expected/cjs/main2-b2c59bdf14.js +++ b/test/chunking-form/samples/hashing/hash-size/_expected/cjs/main2-VmtfVxsamQ.js @@ -1,5 +1,5 @@ 'use strict'; -require('./dep-0f12b4bf62a634.js'); +require('./dep-YVivKZa3-xWdJj.js'); console.log('main2'); diff --git a/test/chunking-form/samples/hashing/hash-size/_expected/cjs/test-9f86d081884c7d659a.txt b/test/chunking-form/samples/hashing/hash-size/_expected/cjs/test-uF-4QoZ1HtBY01G94-.txt similarity index 100% rename from test/chunking-form/samples/hashing/hash-size/_expected/cjs/test-9f86d081884c7d659a.txt rename to test/chunking-form/samples/hashing/hash-size/_expected/cjs/test-uF-4QoZ1HtBY01G94-.txt diff --git a/test/chunking-form/samples/hashing/hash-size/_expected/es/dep-cd6f5744f7fc9c.js b/test/chunking-form/samples/hashing/hash-size/_expected/es/dep-zBY_VBiSge8Mj4.js similarity index 100% rename from test/chunking-form/samples/hashing/hash-size/_expected/es/dep-cd6f5744f7fc9c.js rename to test/chunking-form/samples/hashing/hash-size/_expected/es/dep-zBY_VBiSge8Mj4.js diff --git a/test/chunking-form/samples/hashing/hash-size/_expected/es/main1-bcca55a1.js b/test/chunking-form/samples/hashing/hash-size/_expected/es/main1-bcca55a1.js deleted file mode 100644 index 1416a70c5..000000000 --- a/test/chunking-form/samples/hashing/hash-size/_expected/es/main1-bcca55a1.js +++ /dev/null @@ -1,3 +0,0 @@ -import './dep-cd6f5744f7fc9c.js'; - -console.log('main1'); diff --git a/test/chunking-form/samples/hashing/hash-size/_expected/es/main1-fjlEGKoF.js b/test/chunking-form/samples/hashing/hash-size/_expected/es/main1-fjlEGKoF.js new file mode 100644 index 000000000..b60234c1c --- /dev/null +++ b/test/chunking-form/samples/hashing/hash-size/_expected/es/main1-fjlEGKoF.js @@ -0,0 +1,3 @@ +import './dep-zBY_VBiSge8Mj4.js'; + +console.log('main1'); diff --git a/test/chunking-form/samples/hashing/hash-size/_expected/es/main2-83d7b451fa.js b/test/chunking-form/samples/hashing/hash-size/_expected/es/main2-83d7b451fa.js deleted file mode 100644 index 95158db64..000000000 --- a/test/chunking-form/samples/hashing/hash-size/_expected/es/main2-83d7b451fa.js +++ /dev/null @@ -1,3 +0,0 @@ -import './dep-cd6f5744f7fc9c.js'; - -console.log('main2'); diff --git a/test/chunking-form/samples/hashing/hash-size/_expected/es/main2-_s3jGKh5RD.js b/test/chunking-form/samples/hashing/hash-size/_expected/es/main2-_s3jGKh5RD.js new file mode 100644 index 000000000..3cb92aa8f --- /dev/null +++ b/test/chunking-form/samples/hashing/hash-size/_expected/es/main2-_s3jGKh5RD.js @@ -0,0 +1,3 @@ +import './dep-zBY_VBiSge8Mj4.js'; + +console.log('main2'); diff --git a/test/chunking-form/samples/hashing/hash-size/_expected/es/test-9f86d081884c7d659a.txt b/test/chunking-form/samples/hashing/hash-size/_expected/es/test-uF-4QoZ1HtBY01G94-.txt similarity index 100% rename from test/chunking-form/samples/hashing/hash-size/_expected/es/test-9f86d081884c7d659a.txt rename to test/chunking-form/samples/hashing/hash-size/_expected/es/test-uF-4QoZ1HtBY01G94-.txt diff --git a/test/chunking-form/samples/hashing/hash-size/_expected/system/dep-626bb5df3105f7.js b/test/chunking-form/samples/hashing/hash-size/_expected/system/dep-hy-CAAd7JeW4I2.js similarity index 100% rename from test/chunking-form/samples/hashing/hash-size/_expected/system/dep-626bb5df3105f7.js rename to test/chunking-form/samples/hashing/hash-size/_expected/system/dep-hy-CAAd7JeW4I2.js diff --git a/test/chunking-form/samples/hashing/hash-size/_expected/system/main1-c5eecf00.js b/test/chunking-form/samples/hashing/hash-size/_expected/system/main1-YgtCdyy2.js similarity index 64% rename from test/chunking-form/samples/hashing/hash-size/_expected/system/main1-c5eecf00.js rename to test/chunking-form/samples/hashing/hash-size/_expected/system/main1-YgtCdyy2.js index ce5a10591..6efeff73f 100644 --- a/test/chunking-form/samples/hashing/hash-size/_expected/system/main1-c5eecf00.js +++ b/test/chunking-form/samples/hashing/hash-size/_expected/system/main1-YgtCdyy2.js @@ -1,4 +1,4 @@ -System.register(['./dep-626bb5df3105f7.js'], (function () { +System.register(['./dep-hy-CAAd7JeW4I2.js'], (function () { 'use strict'; return { setters: [null], diff --git a/test/chunking-form/samples/hashing/hash-size/_expected/system/main2-842e475e5e.js b/test/chunking-form/samples/hashing/hash-size/_expected/system/main2-dDGqHpvMDz.js similarity index 64% rename from test/chunking-form/samples/hashing/hash-size/_expected/system/main2-842e475e5e.js rename to test/chunking-form/samples/hashing/hash-size/_expected/system/main2-dDGqHpvMDz.js index 6812a37a6..02e50e49a 100644 --- a/test/chunking-form/samples/hashing/hash-size/_expected/system/main2-842e475e5e.js +++ b/test/chunking-form/samples/hashing/hash-size/_expected/system/main2-dDGqHpvMDz.js @@ -1,4 +1,4 @@ -System.register(['./dep-626bb5df3105f7.js'], (function () { +System.register(['./dep-hy-CAAd7JeW4I2.js'], (function () { 'use strict'; return { setters: [null], diff --git a/test/chunking-form/samples/hashing/hash-size/_expected/system/test-9f86d081884c7d659a.txt b/test/chunking-form/samples/hashing/hash-size/_expected/system/test-uF-4QoZ1HtBY01G94-.txt similarity index 100% rename from test/chunking-form/samples/hashing/hash-size/_expected/system/test-9f86d081884c7d659a.txt rename to test/chunking-form/samples/hashing/hash-size/_expected/system/test-uF-4QoZ1HtBY01G94-.txt diff --git a/test/chunking-form/samples/hashing/random-match/_expected/amd/entry-a38385ce-a38385ce-!~{123}~.js b/test/chunking-form/samples/hashing/random-match/_expected/amd/entry-1UjYC2I--1UjYC2I--!~{123}~.js similarity index 69% rename from test/chunking-form/samples/hashing/random-match/_expected/amd/entry-a38385ce-a38385ce-!~{123}~.js rename to test/chunking-form/samples/hashing/random-match/_expected/amd/entry-1UjYC2I--1UjYC2I--!~{123}~.js index dea40a5e3..ea22ff4fe 100644 --- a/test/chunking-form/samples/hashing/random-match/_expected/amd/entry-a38385ce-a38385ce-!~{123}~.js +++ b/test/chunking-form/samples/hashing/random-match/_expected/amd/entry-1UjYC2I--1UjYC2I--!~{123}~.js @@ -1,6 +1,6 @@ define((function () { 'use strict'; - console.log('replaced: a38385ce'); + console.log('replaced: 1UjYC2I-'); console.log('not replaced: !~{123}~'); })); diff --git a/test/chunking-form/samples/hashing/random-match/_expected/cjs/entry-55937672-55937672-!~{123}~.js b/test/chunking-form/samples/hashing/random-match/_expected/cjs/entry-r0OE6QqP-r0OE6QqP-!~{123}~.js similarity index 60% rename from test/chunking-form/samples/hashing/random-match/_expected/cjs/entry-55937672-55937672-!~{123}~.js rename to test/chunking-form/samples/hashing/random-match/_expected/cjs/entry-r0OE6QqP-r0OE6QqP-!~{123}~.js index 7040251a7..f927c49e2 100644 --- a/test/chunking-form/samples/hashing/random-match/_expected/cjs/entry-55937672-55937672-!~{123}~.js +++ b/test/chunking-form/samples/hashing/random-match/_expected/cjs/entry-r0OE6QqP-r0OE6QqP-!~{123}~.js @@ -1,4 +1,4 @@ 'use strict'; -console.log('replaced: 55937672'); +console.log('replaced: r0OE6QqP'); console.log('not replaced: !~{123}~'); diff --git a/test/chunking-form/samples/hashing/random-match/_expected/es/entry-3e8c77bc-3e8c77bc-!~{123}~.js b/test/chunking-form/samples/hashing/random-match/_expected/es/entry-0i8gYiAL-0i8gYiAL-!~{123}~.js similarity index 52% rename from test/chunking-form/samples/hashing/random-match/_expected/es/entry-3e8c77bc-3e8c77bc-!~{123}~.js rename to test/chunking-form/samples/hashing/random-match/_expected/es/entry-0i8gYiAL-0i8gYiAL-!~{123}~.js index 23eae93ea..d9abb07cb 100644 --- a/test/chunking-form/samples/hashing/random-match/_expected/es/entry-3e8c77bc-3e8c77bc-!~{123}~.js +++ b/test/chunking-form/samples/hashing/random-match/_expected/es/entry-0i8gYiAL-0i8gYiAL-!~{123}~.js @@ -1,2 +1,2 @@ -console.log('replaced: 3e8c77bc'); +console.log('replaced: 0i8gYiAL'); console.log('not replaced: !~{123}~'); diff --git a/test/chunking-form/samples/hashing/random-match/_expected/system/entry-49c9800c-49c9800c-!~{123}~.js b/test/chunking-form/samples/hashing/random-match/_expected/system/entry-uj5cAyaj-uj5cAyaj-!~{123}~.js similarity index 79% rename from test/chunking-form/samples/hashing/random-match/_expected/system/entry-49c9800c-49c9800c-!~{123}~.js rename to test/chunking-form/samples/hashing/random-match/_expected/system/entry-uj5cAyaj-uj5cAyaj-!~{123}~.js index 8fc781567..8af252f33 100644 --- a/test/chunking-form/samples/hashing/random-match/_expected/system/entry-49c9800c-49c9800c-!~{123}~.js +++ b/test/chunking-form/samples/hashing/random-match/_expected/system/entry-uj5cAyaj-uj5cAyaj-!~{123}~.js @@ -3,7 +3,7 @@ System.register([], (function () { return { execute: (function () { - console.log('replaced: 49c9800c'); + console.log('replaced: uj5cAyaj'); console.log('not replaced: !~{123}~'); }) diff --git a/test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/amd/09da348a.js b/test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/amd/H3l_crHv.js similarity index 100% rename from test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/amd/09da348a.js rename to test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/amd/H3l_crHv.js diff --git a/test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/cjs/b99f90f4.js b/test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/cjs/-4vUgP94.js similarity index 100% rename from test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/cjs/b99f90f4.js rename to test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/cjs/-4vUgP94.js diff --git a/test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/es/55aeacf8.js b/test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/es/A-tvJWOc.js similarity index 100% rename from test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/es/55aeacf8.js rename to test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/es/A-tvJWOc.js diff --git a/test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/system/e65da870.js b/test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/system/ia0SgqCA.js similarity index 100% rename from test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/system/e65da870.js rename to test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/system/ia0SgqCA.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/b.str-amd-f73e15b9.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/b.str-amd-hhqXr9WW.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/b.str-amd-f73e15b9.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/b.str-amd-hhqXr9WW.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/c-amd-c1bed163.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/c-amd-TDR2LH-3.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/c-amd-c1bed163.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/c-amd-TDR2LH-3.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/d-amd-f5c92c04.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/d-amd-VrgHm0xN.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/d-amd-f5c92c04.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/d-amd-VrgHm0xN.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/e-amd-f393b98d.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/e-amd-zwUdnnpR.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/e-amd-f393b98d.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/e-amd-zwUdnnpR.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/f-amd-df81ac71.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/f-amd-6N1j88Mb.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/f-amd-df81ac71.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/f-amd-6N1j88Mb.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/g-amd-1f750b5c.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/g-amd-bhx6veTY.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/g-amd-1f750b5c.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/g-amd-bhx6veTY.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/h-amd-a60c0f22.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/h-amd-wseWVa4P.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/h-amd-a60c0f22.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/h-amd-wseWVa4P.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/main-amd-7vxzdx0k.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/main-amd-7vxzdx0k.js new file mode 100644 index 000000000..7f6d6a9d0 --- /dev/null +++ b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/main-amd-7vxzdx0k.js @@ -0,0 +1,15 @@ +define(['exports', './nested/a-amd-skgc70zk', './b.str-amd-hhqXr9WW', './c-amd-TDR2LH-3', './d-amd-VrgHm0xN', './e-amd-zwUdnnpR', './f-amd-6N1j88Mb', './g-amd-bhx6veTY', './h-amd-wseWVa4P', './no-ext-amd-KDE3R3Gg'], (function (exports, a, b, c, d, e, f, g, h, noExt) { 'use strict'; + + + + exports.a = a; + exports.b = b; + exports.c = c; + exports.d = d; + exports.e = e; + exports.f = f; + exports.g = g; + exports.h = h; + exports.x = noExt; + +})); diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/main-amd-addffa50.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/main-amd-addffa50.js deleted file mode 100644 index 55eaa1294..000000000 --- a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/main-amd-addffa50.js +++ /dev/null @@ -1,15 +0,0 @@ -define(['exports', './nested/a-amd-5dc7856c', './b.str-amd-f73e15b9', './c-amd-c1bed163', './d-amd-f5c92c04', './e-amd-f393b98d', './f-amd-df81ac71', './g-amd-1f750b5c', './h-amd-a60c0f22', './no-ext-amd-9d2c6ef6'], (function (exports, a, b, c, d, e, f, g, h, noExt) { 'use strict'; - - - - exports.a = a; - exports.b = b; - exports.c = c; - exports.d = d; - exports.e = e; - exports.f = f; - exports.g = g; - exports.h = h; - exports.x = noExt; - -})); diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/nested/a-amd-5dc7856c.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/nested/a-amd-skgc70zk.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/nested/a-amd-5dc7856c.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/nested/a-amd-skgc70zk.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/no-ext-amd-9d2c6ef6.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/no-ext-amd-KDE3R3Gg.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/no-ext-amd-9d2c6ef6.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/no-ext-amd-KDE3R3Gg.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/b.str-cjs-6703f3b2.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/b.str-cjs-oMtv8QPW.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/b.str-cjs-6703f3b2.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/b.str-cjs-oMtv8QPW.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/c-cjs-71ac0098.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/c-cjs-5n06CuHC.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/c-cjs-71ac0098.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/c-cjs-5n06CuHC.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/d-cjs-9b009b8f.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/d-cjs-Gz2CiPX0.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/d-cjs-9b009b8f.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/d-cjs-Gz2CiPX0.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/e-cjs-831dad1f.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/e-cjs-WOU85U0_.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/e-cjs-831dad1f.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/e-cjs-WOU85U0_.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/f-cjs-39905a99.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/f-cjs-WoWuXuZP.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/f-cjs-39905a99.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/f-cjs-WoWuXuZP.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/g-cjs-3328e22b.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/g-cjs-ZcQtf4ii.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/g-cjs-3328e22b.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/g-cjs-ZcQtf4ii.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/h-cjs-d8541d4b.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/h-cjs-8Kljj-VE.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/h-cjs-d8541d4b.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/h-cjs-8Kljj-VE.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/main-cjs-JyKGpmTa.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/main-cjs-JyKGpmTa.js new file mode 100644 index 000000000..d3dd810d3 --- /dev/null +++ b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/main-cjs-JyKGpmTa.js @@ -0,0 +1,23 @@ +'use strict'; + +var a = require('./nested/a-cjs-kvZ4_FEE.js'); +var b = require('./b.str-cjs-oMtv8QPW.js'); +var c = require('./c-cjs-5n06CuHC.js'); +var d = require('./d-cjs-Gz2CiPX0.js'); +var e = require('./e-cjs-WOU85U0_.js'); +var f = require('./f-cjs-WoWuXuZP.js'); +var g = require('./g-cjs-ZcQtf4ii.js'); +var h = require('./h-cjs-8Kljj-VE.js'); +var noExt = require('./no-ext-cjs-bp5EbIHi.js'); + + + +exports.a = a; +exports.b = b; +exports.c = c; +exports.d = d; +exports.e = e; +exports.f = f; +exports.g = g; +exports.h = h; +exports.x = noExt; diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/main-cjs-cb43c6df.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/main-cjs-cb43c6df.js deleted file mode 100644 index 89e6a4239..000000000 --- a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/main-cjs-cb43c6df.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -var a = require('./nested/a-cjs-80f9b8c3.js'); -var b = require('./b.str-cjs-6703f3b2.js'); -var c = require('./c-cjs-71ac0098.js'); -var d = require('./d-cjs-9b009b8f.js'); -var e = require('./e-cjs-831dad1f.js'); -var f = require('./f-cjs-39905a99.js'); -var g = require('./g-cjs-3328e22b.js'); -var h = require('./h-cjs-d8541d4b.js'); -var noExt = require('./no-ext-cjs-500f8f81.js'); - - - -exports.a = a; -exports.b = b; -exports.c = c; -exports.d = d; -exports.e = e; -exports.f = f; -exports.g = g; -exports.h = h; -exports.x = noExt; diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/nested/a-cjs-80f9b8c3.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/nested/a-cjs-kvZ4_FEE.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/nested/a-cjs-80f9b8c3.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/nested/a-cjs-kvZ4_FEE.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/no-ext-cjs-500f8f81.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/no-ext-cjs-bp5EbIHi.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/no-ext-cjs-500f8f81.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/no-ext-cjs-bp5EbIHi.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/b.str-es-3ce883b1.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/b.str-es-Ja5UDcox.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/b.str-es-3ce883b1.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/b.str-es-Ja5UDcox.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/c-es-7b7256f9.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/c-es-kgE3BpZP.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/c-es-7b7256f9.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/c-es-kgE3BpZP.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/d-es-1616849c.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/d-es-aJHyMhkA.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/d-es-1616849c.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/d-es-aJHyMhkA.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/e-es-e18089fa.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/e-es-L3xdJkDr.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/e-es-e18089fa.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/e-es-L3xdJkDr.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/f-es-c1646e12.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/f-es--VxedyqQ.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/f-es-c1646e12.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/f-es--VxedyqQ.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/g-es-968f87d2.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/g-es-spweQtsO.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/g-es-968f87d2.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/g-es-spweQtsO.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/h-es-05491bfa.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/h-es-TRi7J9bn.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/h-es-05491bfa.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/h-es-TRi7J9bn.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/main-es-N06cocRH.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/main-es-N06cocRH.js new file mode 100644 index 000000000..86deb5ad8 --- /dev/null +++ b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/main-es-N06cocRH.js @@ -0,0 +1,9 @@ +export { default as a } from './nested/a-es-NSAVj3lN.js'; +export { default as b } from './b.str-es-Ja5UDcox.js'; +export { default as c } from './c-es-kgE3BpZP.js'; +export { default as d } from './d-es-aJHyMhkA.js'; +export { default as e } from './e-es-L3xdJkDr.js'; +export { default as f } from './f-es--VxedyqQ.js'; +export { default as g } from './g-es-spweQtsO.js'; +export { default as h } from './h-es-TRi7J9bn.js'; +export { default as x } from './no-ext-es-C7qwrbcM.js'; diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/main-es-f8350081.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/main-es-f8350081.js deleted file mode 100644 index bea0b84c6..000000000 --- a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/main-es-f8350081.js +++ /dev/null @@ -1,9 +0,0 @@ -export { default as a } from './nested/a-es-125ea65c.js'; -export { default as b } from './b.str-es-3ce883b1.js'; -export { default as c } from './c-es-7b7256f9.js'; -export { default as d } from './d-es-1616849c.js'; -export { default as e } from './e-es-e18089fa.js'; -export { default as f } from './f-es-c1646e12.js'; -export { default as g } from './g-es-968f87d2.js'; -export { default as h } from './h-es-05491bfa.js'; -export { default as x } from './no-ext-es-1f34b6e8.js'; diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/nested/a-es-125ea65c.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/nested/a-es-NSAVj3lN.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/nested/a-es-125ea65c.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/nested/a-es-NSAVj3lN.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/no-ext-es-1f34b6e8.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/no-ext-es-C7qwrbcM.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/no-ext-es-1f34b6e8.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/no-ext-es-C7qwrbcM.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/b.str-system-2fa3160e.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/b.str-system-7-uTx9xs.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/b.str-system-2fa3160e.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/b.str-system-7-uTx9xs.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/c-system-9442eacd.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/c-system-3c7Uwjh3.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/c-system-9442eacd.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/c-system-3c7Uwjh3.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/d-system-1a05eeda.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/d-system-bygti7CV.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/d-system-1a05eeda.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/d-system-bygti7CV.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/e-system-f73caf6a.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/e-system-Ol7HNm3k.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/e-system-f73caf6a.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/e-system-Ol7HNm3k.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/f-system-b3b06e3f.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/f-system-WkQAXb4K.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/f-system-b3b06e3f.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/f-system-WkQAXb4K.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/g-system-9b3ad652.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/g-system-7SjE1oVU.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/g-system-9b3ad652.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/g-system-7SjE1oVU.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/h-system-6c6b48ca.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/h-system-2b9bPI4v.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/h-system-6c6b48ca.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/h-system-2b9bPI4v.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/main-system-d08bfef5.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/main-system-awzr_ZZt.js similarity index 67% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/main-system-d08bfef5.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/main-system-awzr_ZZt.js index ed7bef411..cd61d3dc6 100644 --- a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/main-system-d08bfef5.js +++ b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/main-system-awzr_ZZt.js @@ -1,4 +1,4 @@ -System.register(['./nested/a-system-db94ffc0.js', './b.str-system-2fa3160e.js', './c-system-9442eacd.js', './d-system-1a05eeda.js', './e-system-f73caf6a.js', './f-system-b3b06e3f.js', './g-system-9b3ad652.js', './h-system-6c6b48ca.js', './no-ext-system-0cf938a8.js'], (function (exports) { +System.register(['./nested/a-system-Sq4jqhxz.js', './b.str-system-7-uTx9xs.js', './c-system-3c7Uwjh3.js', './d-system-bygti7CV.js', './e-system-Ol7HNm3k.js', './f-system-WkQAXb4K.js', './g-system-7SjE1oVU.js', './h-system-2b9bPI4v.js', './no-ext-system-KaJN8U9x.js'], (function (exports) { 'use strict'; return { setters: [function (module) { diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/nested/a-system-db94ffc0.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/nested/a-system-Sq4jqhxz.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/nested/a-system-db94ffc0.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/nested/a-system-Sq4jqhxz.js diff --git a/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/no-ext-system-0cf938a8.js b/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/no-ext-system-KaJN8U9x.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/no-ext-system-0cf938a8.js rename to test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/no-ext-system-KaJN8U9x.js diff --git a/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/_virtual/_virtualModule-amd-03552e5c.mjs b/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/_virtual/_virtualModule-amd-dkCUmZZM.mjs similarity index 100% rename from test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/_virtual/_virtualModule-amd-03552e5c.mjs rename to test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/_virtual/_virtualModule-amd-dkCUmZZM.mjs diff --git a/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/_virtual/_virtualWithAssetExt.str-amd-724c602d.mjs b/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/_virtual/_virtualWithAssetExt.str-amd-ZmgZpO4v.mjs similarity index 100% rename from test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/_virtual/_virtualWithAssetExt.str-amd-724c602d.mjs rename to test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/_virtual/_virtualWithAssetExt.str-amd-ZmgZpO4v.mjs diff --git a/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/_virtual/_virtualWithExt-amd-e9dc1b7e.mjs b/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/_virtual/_virtualWithExt-amd-fYdXqg2l.mjs similarity index 100% rename from test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/_virtual/_virtualWithExt-amd-e9dc1b7e.mjs rename to test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/_virtual/_virtualWithExt-amd-fYdXqg2l.mjs diff --git a/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/main-amd-30156411.mjs b/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/main-amd-bdsEo1jf.mjs similarity index 53% rename from test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/main-amd-30156411.mjs rename to test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/main-amd-bdsEo1jf.mjs index 05b7abceb..5e7f1a876 100644 --- a/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/main-amd-30156411.mjs +++ b/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/main-amd-bdsEo1jf.mjs @@ -1,4 +1,4 @@ -define(['./_virtual/_virtualModule-amd-03552e5c.mjs', './_virtual/_virtualWithExt-amd-e9dc1b7e.mjs', './_virtual/_virtualWithAssetExt.str-amd-724c602d.mjs'], (function (_virtualModule, _virtualWithExt, _virtualWithAssetExt) { 'use strict'; +define(['./_virtual/_virtualModule-amd-dkCUmZZM.mjs', './_virtual/_virtualWithExt-amd-fYdXqg2l.mjs', './_virtual/_virtualWithAssetExt.str-amd-ZmgZpO4v.mjs'], (function (_virtualModule, _virtualWithExt, _virtualWithAssetExt) { 'use strict'; assert.equal(_virtualModule.virtual, 'Virtual!'); assert.equal(_virtualWithExt.virtual2, 'Virtual2!'); diff --git a/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/_virtual/_virtualModule-cjs-bbe1ad5e.mjs b/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/_virtual/_virtualModule-cjs-vsfTWOJ4.mjs similarity index 100% rename from test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/_virtual/_virtualModule-cjs-bbe1ad5e.mjs rename to test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/_virtual/_virtualModule-cjs-vsfTWOJ4.mjs diff --git a/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/_virtual/_virtualWithAssetExt.str-cjs-0e561611.mjs b/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/_virtual/_virtualWithAssetExt.str-cjs-C3etvDA-.mjs similarity index 100% rename from test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/_virtual/_virtualWithAssetExt.str-cjs-0e561611.mjs rename to test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/_virtual/_virtualWithAssetExt.str-cjs-C3etvDA-.mjs diff --git a/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/_virtual/_virtualWithExt-cjs-b148ca33.mjs b/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/_virtual/_virtualWithExt-cjs-Q5dP1jbm.mjs similarity index 100% rename from test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/_virtual/_virtualWithExt-cjs-b148ca33.mjs rename to test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/_virtual/_virtualWithExt-cjs-Q5dP1jbm.mjs diff --git a/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/main-cjs-23637a85.mjs b/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/main-cjs-6wpvmYGP.mjs similarity index 56% rename from test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/main-cjs-23637a85.mjs rename to test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/main-cjs-6wpvmYGP.mjs index 7246a157d..fbbe4aaf0 100644 --- a/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/main-cjs-23637a85.mjs +++ b/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/main-cjs-6wpvmYGP.mjs @@ -1,8 +1,8 @@ 'use strict'; -var _virtualModule = require('./_virtual/_virtualModule-cjs-bbe1ad5e.mjs'); -var _virtualWithExt = require('./_virtual/_virtualWithExt-cjs-b148ca33.mjs'); -var _virtualWithAssetExt = require('./_virtual/_virtualWithAssetExt.str-cjs-0e561611.mjs'); +var _virtualModule = require('./_virtual/_virtualModule-cjs-vsfTWOJ4.mjs'); +var _virtualWithExt = require('./_virtual/_virtualWithExt-cjs-Q5dP1jbm.mjs'); +var _virtualWithAssetExt = require('./_virtual/_virtualWithAssetExt.str-cjs-C3etvDA-.mjs'); assert.equal(_virtualModule.virtual, 'Virtual!'); assert.equal(_virtualWithExt.virtual2, 'Virtual2!'); diff --git a/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/_virtual/_virtualModule-es-22303f19.mjs b/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/_virtual/_virtualModule-es-0lAsaDxt.mjs similarity index 100% rename from test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/_virtual/_virtualModule-es-22303f19.mjs rename to test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/_virtual/_virtualModule-es-0lAsaDxt.mjs diff --git a/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/_virtual/_virtualWithAssetExt.str-es-07beb78c.mjs b/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/_virtual/_virtualWithAssetExt.str-es-i4KuU6IN.mjs similarity index 100% rename from test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/_virtual/_virtualWithAssetExt.str-es-07beb78c.mjs rename to test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/_virtual/_virtualWithAssetExt.str-es-i4KuU6IN.mjs diff --git a/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/_virtual/_virtualWithExt-es-6330be37.mjs b/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/_virtual/_virtualWithExt-es-0H_6dNOV.mjs similarity index 100% rename from test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/_virtual/_virtualWithExt-es-6330be37.mjs rename to test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/_virtual/_virtualWithExt-es-0H_6dNOV.mjs diff --git a/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/main-es-956265de.mjs b/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/main-es-qKNN2CuL.mjs similarity index 56% rename from test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/main-es-956265de.mjs rename to test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/main-es-qKNN2CuL.mjs index b76ad5331..1b5730c37 100644 --- a/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/main-es-956265de.mjs +++ b/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/main-es-qKNN2CuL.mjs @@ -1,6 +1,6 @@ -import { virtual } from './_virtual/_virtualModule-es-22303f19.mjs'; -import { virtual2 } from './_virtual/_virtualWithExt-es-6330be37.mjs'; -import { virtual3 } from './_virtual/_virtualWithAssetExt.str-es-07beb78c.mjs'; +import { virtual } from './_virtual/_virtualModule-es-0lAsaDxt.mjs'; +import { virtual2 } from './_virtual/_virtualWithExt-es-0H_6dNOV.mjs'; +import { virtual3 } from './_virtual/_virtualWithAssetExt.str-es-i4KuU6IN.mjs'; assert.equal(virtual, 'Virtual!'); assert.equal(virtual2, 'Virtual2!'); diff --git a/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system/_virtual/_virtualModule-system-26bc5070.mjs b/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system/_virtual/_virtualModule-system-QemGjyyq.mjs similarity index 100% rename from test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system/_virtual/_virtualModule-system-26bc5070.mjs rename to test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system/_virtual/_virtualModule-system-QemGjyyq.mjs diff --git a/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system/_virtual/_virtualWithAssetExt.str-system-98927794.mjs b/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system/_virtual/_virtualWithAssetExt.str-system-i71mo7go.mjs similarity index 100% rename from test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system/_virtual/_virtualWithAssetExt.str-system-98927794.mjs rename to test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system/_virtual/_virtualWithAssetExt.str-system-i71mo7go.mjs diff --git a/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system/_virtual/_virtualWithExt-system-11e583df.mjs b/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system/_virtual/_virtualWithExt-system-m-4Ec4Ay.mjs similarity index 100% rename from test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system/_virtual/_virtualWithExt-system-11e583df.mjs rename to test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system/_virtual/_virtualWithExt-system-m-4Ec4Ay.mjs diff --git a/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system/main-system-36e9b93b.mjs b/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system/main-system-vB0aGC5C.mjs similarity index 67% rename from test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system/main-system-36e9b93b.mjs rename to test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system/main-system-vB0aGC5C.mjs index 0471f3969..7c878c7f4 100644 --- a/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system/main-system-36e9b93b.mjs +++ b/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system/main-system-vB0aGC5C.mjs @@ -1,4 +1,4 @@ -System.register(['./_virtual/_virtualModule-system-26bc5070.mjs', './_virtual/_virtualWithExt-system-11e583df.mjs', './_virtual/_virtualWithAssetExt.str-system-98927794.mjs'], (function () { +System.register(['./_virtual/_virtualModule-system-QemGjyyq.mjs', './_virtual/_virtualWithExt-system-m-4Ec4Ay.mjs', './_virtual/_virtualWithAssetExt.str-system-i71mo7go.mjs'], (function () { 'use strict'; var virtual, virtual2, virtual3; return { diff --git a/test/chunking-form/samples/render-chunk-transform/_config.js b/test/chunking-form/samples/render-chunk-transform/_config.js index d45b42c72..f934d0f47 100644 --- a/test/chunking-form/samples/render-chunk-transform/_config.js +++ b/test/chunking-form/samples/render-chunk-transform/_config.js @@ -21,7 +21,7 @@ module.exports = defineTest({ generateBundle(options, bundle) { const sanitizedBundle = JSON.parse( replaceDirectoryInStringifiedObject(bundle, __dirname).replace( - /(entry-\w+)-\w+\.js/g, + /(entry-\w+)-[\w|-]+\.js/g, (match, name) => `${name}.js` ) ); diff --git a/test/chunking-form/samples/render-chunk-transform/_expected/amd/entry-main1-31ed1903.js b/test/chunking-form/samples/render-chunk-transform/_expected/amd/entry-main1-kZfhqQ-c.js similarity index 100% rename from test/chunking-form/samples/render-chunk-transform/_expected/amd/entry-main1-31ed1903.js rename to test/chunking-form/samples/render-chunk-transform/_expected/amd/entry-main1-kZfhqQ-c.js diff --git a/test/chunking-form/samples/render-chunk-transform/_expected/amd/entry-main2-4c3da82f.js b/test/chunking-form/samples/render-chunk-transform/_expected/amd/entry-main2-HAN3t8tF.js similarity index 62% rename from test/chunking-form/samples/render-chunk-transform/_expected/amd/entry-main2-4c3da82f.js rename to test/chunking-form/samples/render-chunk-transform/_expected/amd/entry-main2-HAN3t8tF.js index a8a0784ce..9b52fb41e 100644 --- a/test/chunking-form/samples/render-chunk-transform/_expected/amd/entry-main2-4c3da82f.js +++ b/test/chunking-form/samples/render-chunk-transform/_expected/amd/entry-main2-HAN3t8tF.js @@ -1,4 +1,4 @@ -import { added } from "./entry-main1-31ed1903.js"; +import { added } from "./entry-main1-kZfhqQ-c.js"; console.log(added); define((function () { 'use strict'; diff --git a/test/chunking-form/samples/render-chunk-transform/_expected/cjs/entry-main1-c6673fa5.js b/test/chunking-form/samples/render-chunk-transform/_expected/cjs/entry-main1-vmW_xTy-.js similarity index 100% rename from test/chunking-form/samples/render-chunk-transform/_expected/cjs/entry-main1-c6673fa5.js rename to test/chunking-form/samples/render-chunk-transform/_expected/cjs/entry-main1-vmW_xTy-.js diff --git a/test/chunking-form/samples/render-chunk-transform/_expected/cjs/entry-main2-a3a04675.js b/test/chunking-form/samples/render-chunk-transform/_expected/cjs/entry-main2-Nn78jd3g.js similarity index 52% rename from test/chunking-form/samples/render-chunk-transform/_expected/cjs/entry-main2-a3a04675.js rename to test/chunking-form/samples/render-chunk-transform/_expected/cjs/entry-main2-Nn78jd3g.js index af9ae0e96..5bc61f1e7 100644 --- a/test/chunking-form/samples/render-chunk-transform/_expected/cjs/entry-main2-a3a04675.js +++ b/test/chunking-form/samples/render-chunk-transform/_expected/cjs/entry-main2-Nn78jd3g.js @@ -1,4 +1,4 @@ -import { added } from "./entry-main1-c6673fa5.js"; +import { added } from "./entry-main1-vmW_xTy-.js"; console.log(added); 'use strict'; diff --git a/test/chunking-form/samples/render-chunk-transform/_expected/es/entry-main1-56d7d368.js b/test/chunking-form/samples/render-chunk-transform/_expected/es/entry-main1-NHE3CPgw.js similarity index 100% rename from test/chunking-form/samples/render-chunk-transform/_expected/es/entry-main1-56d7d368.js rename to test/chunking-form/samples/render-chunk-transform/_expected/es/entry-main1-NHE3CPgw.js diff --git a/test/chunking-form/samples/render-chunk-transform/_expected/es/entry-main2-7827261c.js b/test/chunking-form/samples/render-chunk-transform/_expected/es/entry-main2-7827261c.js deleted file mode 100644 index 183983b05..000000000 --- a/test/chunking-form/samples/render-chunk-transform/_expected/es/entry-main2-7827261c.js +++ /dev/null @@ -1,3 +0,0 @@ -import { added } from "./entry-main1-56d7d368.js"; -console.log(added); -console.log('main2'); diff --git a/test/chunking-form/samples/render-chunk-transform/_expected/es/entry-main2-bcI4ej2q.js b/test/chunking-form/samples/render-chunk-transform/_expected/es/entry-main2-bcI4ej2q.js new file mode 100644 index 000000000..04d953904 --- /dev/null +++ b/test/chunking-form/samples/render-chunk-transform/_expected/es/entry-main2-bcI4ej2q.js @@ -0,0 +1,3 @@ +import { added } from "./entry-main1-NHE3CPgw.js"; +console.log(added); +console.log('main2'); diff --git a/test/chunking-form/samples/render-chunk-transform/_expected/system/entry-main1-d7dc9358.js b/test/chunking-form/samples/render-chunk-transform/_expected/system/entry-main1-ulqZAx1e.js similarity index 100% rename from test/chunking-form/samples/render-chunk-transform/_expected/system/entry-main1-d7dc9358.js rename to test/chunking-form/samples/render-chunk-transform/_expected/system/entry-main1-ulqZAx1e.js diff --git a/test/chunking-form/samples/render-chunk-transform/_expected/system/entry-main2-f1bbcc21.js b/test/chunking-form/samples/render-chunk-transform/_expected/system/entry-main2-9TMBLN6w.js similarity index 74% rename from test/chunking-form/samples/render-chunk-transform/_expected/system/entry-main2-f1bbcc21.js rename to test/chunking-form/samples/render-chunk-transform/_expected/system/entry-main2-9TMBLN6w.js index f97000e82..5af564bfc 100644 --- a/test/chunking-form/samples/render-chunk-transform/_expected/system/entry-main2-f1bbcc21.js +++ b/test/chunking-form/samples/render-chunk-transform/_expected/system/entry-main2-9TMBLN6w.js @@ -1,4 +1,4 @@ -import { added } from "./entry-main1-d7dc9358.js"; +import { added } from "./entry-main1-ulqZAx1e.js"; console.log(added); System.register([], (function () { 'use strict'; diff --git a/test/chunking-form/samples/render-chunk/_expected/amd/asset-test-9f86d081 b/test/chunking-form/samples/render-chunk/_expected/amd/asset-test-uF-4QoZ1 similarity index 100% rename from test/chunking-form/samples/render-chunk/_expected/amd/asset-test-9f86d081 rename to test/chunking-form/samples/render-chunk/_expected/amd/asset-test-uF-4QoZ1 diff --git a/test/chunking-form/samples/render-chunk/_expected/amd/chunk-dep2-af768b5f.js b/test/chunking-form/samples/render-chunk/_expected/amd/chunk-dep2-_bTcBm_f.js similarity index 69% rename from test/chunking-form/samples/render-chunk/_expected/amd/chunk-dep2-af768b5f.js rename to test/chunking-form/samples/render-chunk/_expected/amd/chunk-dep2-_bTcBm_f.js index 0ad19885d..fff484f12 100644 --- a/test/chunking-form/samples/render-chunk/_expected/amd/chunk-dep2-af768b5f.js +++ b/test/chunking-form/samples/render-chunk/_expected/amd/chunk-dep2-_bTcBm_f.js @@ -1,7 +1,7 @@ define(['require', 'exports'], (function (require, exports) { 'use strict'; var num = 2; - console.log('referenced asset', new URL(require.toUrl('./asset-test-9f86d081'), document.baseURI).href); + console.log('referenced asset', new URL(require.toUrl('./asset-test-uF-4QoZ1'), document.baseURI).href); exports.num = num; @@ -20,13 +20,13 @@ console.log({ "name": "dep2", "type": "chunk", "dynamicImports": [], - "fileName": "chunk-dep2-af768b5f.js", + "fileName": "chunk-dep2-_bTcBm_f.js", "implicitlyLoadedBefore": [], "importedBindings": {}, "imports": [], "modules": { "**/dep2.js": { - "code": "\tvar num = 2;\n\tconsole.log('referenced asset', new URL(require.toUrl('./asset-test-9f86d081'), document.baseURI).href);", + "code": "\tvar num = 2;\n\tconsole.log('referenced asset', new URL(require.toUrl('./asset-test-uF-4QoZ1'), document.baseURI).href);", "originalLength": 19, "removedExports": [], "renderedExports": [ @@ -36,8 +36,8 @@ console.log({ } }, "referencedFiles": [ - "asset-test-9f86d081" + "asset-test-uF-4QoZ1" ] }); -console.log('all chunks', ["entry-main1-62378d9a.js","entry-main2-d26bed01.js","chunk-dep2-af768b5f.js"]) -console.log('referenced asset in renderChunk', 'asset-test-9f86d081'); +console.log('all chunks', ["entry-main1-n5Rl5PjH.js","entry-main2-ne4fysq0.js","chunk-dep2-_bTcBm_f.js"]) +console.log('referenced asset in renderChunk', 'asset-test-uF-4QoZ1'); diff --git a/test/chunking-form/samples/render-chunk/_expected/amd/entry-main1-62378d9a.js b/test/chunking-form/samples/render-chunk/_expected/amd/entry-main1-n5Rl5PjH.js similarity index 65% rename from test/chunking-form/samples/render-chunk/_expected/amd/entry-main1-62378d9a.js rename to test/chunking-form/samples/render-chunk/_expected/amd/entry-main1-n5Rl5PjH.js index 06d127c09..d0bffe932 100644 --- a/test/chunking-form/samples/render-chunk/_expected/amd/entry-main1-62378d9a.js +++ b/test/chunking-form/samples/render-chunk/_expected/amd/entry-main1-n5Rl5PjH.js @@ -1,10 +1,10 @@ -define(['require', './chunk-dep2-af768b5f'], (function (require, dep2) { 'use strict'; +define(['require', './chunk-dep2-_bTcBm_f'], (function (require, dep2) { 'use strict'; var num = 1; - console.log('referenced asset', new URL(require.toUrl('./asset-test-9f86d081'), document.baseURI).href); + console.log('referenced asset', new URL(require.toUrl('./asset-test-uF-4QoZ1'), document.baseURI).href); console.log(num + dep2.num); - console.log('referenced asset', new URL(require.toUrl('./asset-test-9f86d081'), document.baseURI).href); + console.log('referenced asset', new URL(require.toUrl('./asset-test-uF-4QoZ1'), document.baseURI).href); })); console.log({ @@ -20,19 +20,19 @@ console.log({ "name": "main1", "type": "chunk", "dynamicImports": [], - "fileName": "entry-main1-62378d9a.js", + "fileName": "entry-main1-n5Rl5PjH.js", "implicitlyLoadedBefore": [], "importedBindings": { - "chunk-dep2-af768b5f.js": [ + "chunk-dep2-_bTcBm_f.js": [ "num" ] }, "imports": [ - "chunk-dep2-af768b5f.js" + "chunk-dep2-_bTcBm_f.js" ], "modules": { "**/dep1.js": { - "code": "\tvar num = 1;\n\tconsole.log('referenced asset', new URL(require.toUrl('./asset-test-9f86d081'), document.baseURI).href);", + "code": "\tvar num = 1;\n\tconsole.log('referenced asset', new URL(require.toUrl('./asset-test-uF-4QoZ1'), document.baseURI).href);", "originalLength": 19, "removedExports": [], "renderedExports": [ @@ -41,7 +41,7 @@ console.log({ "renderedLength": 117 }, "**/main1.js": { - "code": "\tconsole.log(num + dep2.num);\n\tconsole.log('referenced asset', new URL(require.toUrl('./asset-test-9f86d081'), document.baseURI).href);", + "code": "\tconsole.log(num + dep2.num);\n\tconsole.log('referenced asset', new URL(require.toUrl('./asset-test-uF-4QoZ1'), document.baseURI).href);", "originalLength": 102, "removedExports": [], "renderedExports": [], @@ -49,8 +49,8 @@ console.log({ } }, "referencedFiles": [ - "asset-test-9f86d081" + "asset-test-uF-4QoZ1" ] }); -console.log('all chunks', ["entry-main1-62378d9a.js","entry-main2-d26bed01.js","chunk-dep2-af768b5f.js"]) -console.log('referenced asset in renderChunk', 'asset-test-9f86d081'); +console.log('all chunks', ["entry-main1-n5Rl5PjH.js","entry-main2-ne4fysq0.js","chunk-dep2-_bTcBm_f.js"]) +console.log('referenced asset in renderChunk', 'asset-test-uF-4QoZ1'); diff --git a/test/chunking-form/samples/render-chunk/_expected/amd/entry-main2-d26bed01.js b/test/chunking-form/samples/render-chunk/_expected/amd/entry-main2-ne4fysq0.js similarity index 65% rename from test/chunking-form/samples/render-chunk/_expected/amd/entry-main2-d26bed01.js rename to test/chunking-form/samples/render-chunk/_expected/amd/entry-main2-ne4fysq0.js index 86f2d8916..2ae915dd6 100644 --- a/test/chunking-form/samples/render-chunk/_expected/amd/entry-main2-d26bed01.js +++ b/test/chunking-form/samples/render-chunk/_expected/amd/entry-main2-ne4fysq0.js @@ -1,10 +1,10 @@ -define(['require', './chunk-dep2-af768b5f'], (function (require, dep2) { 'use strict'; +define(['require', './chunk-dep2-_bTcBm_f'], (function (require, dep2) { 'use strict'; var num = 3; - console.log('referenced asset', new URL(require.toUrl('./asset-test-9f86d081'), document.baseURI).href); + console.log('referenced asset', new URL(require.toUrl('./asset-test-uF-4QoZ1'), document.baseURI).href); console.log(dep2.num + num); - console.log('referenced asset', new URL(require.toUrl('./asset-test-9f86d081'), document.baseURI).href); + console.log('referenced asset', new URL(require.toUrl('./asset-test-uF-4QoZ1'), document.baseURI).href); })); console.log({ @@ -20,19 +20,19 @@ console.log({ "name": "main2", "type": "chunk", "dynamicImports": [], - "fileName": "entry-main2-d26bed01.js", + "fileName": "entry-main2-ne4fysq0.js", "implicitlyLoadedBefore": [], "importedBindings": { - "chunk-dep2-af768b5f.js": [ + "chunk-dep2-_bTcBm_f.js": [ "num" ] }, "imports": [ - "chunk-dep2-af768b5f.js" + "chunk-dep2-_bTcBm_f.js" ], "modules": { "**/dep3.js": { - "code": "\tvar num = 3;\n\tconsole.log('referenced asset', new URL(require.toUrl('./asset-test-9f86d081'), document.baseURI).href);", + "code": "\tvar num = 3;\n\tconsole.log('referenced asset', new URL(require.toUrl('./asset-test-uF-4QoZ1'), document.baseURI).href);", "originalLength": 19, "removedExports": [], "renderedExports": [ @@ -41,7 +41,7 @@ console.log({ "renderedLength": 117 }, "**/main2.js": { - "code": "\tconsole.log(dep2.num + num);\n\tconsole.log('referenced asset', new URL(require.toUrl('./asset-test-9f86d081'), document.baseURI).href);", + "code": "\tconsole.log(dep2.num + num);\n\tconsole.log('referenced asset', new URL(require.toUrl('./asset-test-uF-4QoZ1'), document.baseURI).href);", "originalLength": 102, "removedExports": [], "renderedExports": [], @@ -49,8 +49,8 @@ console.log({ } }, "referencedFiles": [ - "asset-test-9f86d081" + "asset-test-uF-4QoZ1" ] }); -console.log('all chunks', ["entry-main1-62378d9a.js","entry-main2-d26bed01.js","chunk-dep2-af768b5f.js"]) -console.log('referenced asset in renderChunk', 'asset-test-9f86d081'); +console.log('all chunks', ["entry-main1-n5Rl5PjH.js","entry-main2-ne4fysq0.js","chunk-dep2-_bTcBm_f.js"]) +console.log('referenced asset in renderChunk', 'asset-test-uF-4QoZ1'); diff --git a/test/chunking-form/samples/render-chunk/_expected/cjs/asset-test-9f86d081 b/test/chunking-form/samples/render-chunk/_expected/cjs/asset-test-uF-4QoZ1 similarity index 100% rename from test/chunking-form/samples/render-chunk/_expected/cjs/asset-test-9f86d081 rename to test/chunking-form/samples/render-chunk/_expected/cjs/asset-test-uF-4QoZ1 diff --git a/test/chunking-form/samples/render-chunk/_expected/cjs/chunk-dep2-8d89c265.js b/test/chunking-form/samples/render-chunk/_expected/cjs/chunk-dep2-XPNbbDh-.js similarity index 63% rename from test/chunking-form/samples/render-chunk/_expected/cjs/chunk-dep2-8d89c265.js rename to test/chunking-form/samples/render-chunk/_expected/cjs/chunk-dep2-XPNbbDh-.js index 8f14f5a6e..f203a28c8 100644 --- a/test/chunking-form/samples/render-chunk/_expected/cjs/chunk-dep2-8d89c265.js +++ b/test/chunking-form/samples/render-chunk/_expected/cjs/chunk-dep2-XPNbbDh-.js @@ -1,7 +1,7 @@ 'use strict'; var num = 2; -console.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-9f86d081').href : new URL('asset-test-9f86d081', document.currentScript && document.currentScript.src || document.baseURI).href)); +console.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-uF-4QoZ1').href : new URL('asset-test-uF-4QoZ1', document.currentScript && document.currentScript.src || document.baseURI).href)); exports.num = num; console.log({ @@ -18,13 +18,13 @@ console.log({ "name": "dep2", "type": "chunk", "dynamicImports": [], - "fileName": "chunk-dep2-8d89c265.js", + "fileName": "chunk-dep2-XPNbbDh-.js", "implicitlyLoadedBefore": [], "importedBindings": {}, "imports": [], "modules": { "**/dep2.js": { - "code": "var num = 2;\nconsole.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-9f86d081').href : new URL('asset-test-9f86d081', document.currentScript && document.currentScript.src || document.baseURI).href));", + "code": "var num = 2;\nconsole.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-uF-4QoZ1').href : new URL('asset-test-uF-4QoZ1', document.currentScript && document.currentScript.src || document.baseURI).href));", "originalLength": 19, "removedExports": [], "renderedExports": [ @@ -34,8 +34,8 @@ console.log({ } }, "referencedFiles": [ - "asset-test-9f86d081" + "asset-test-uF-4QoZ1" ] }); -console.log('all chunks', ["entry-main1-5be92ae4.js","entry-main2-20c5a0f4.js","chunk-dep2-8d89c265.js"]) -console.log('referenced asset in renderChunk', 'asset-test-9f86d081'); +console.log('all chunks', ["entry-main1-zV-9xTLy.js","entry-main2-urBx_vfo.js","chunk-dep2-XPNbbDh-.js"]) +console.log('referenced asset in renderChunk', 'asset-test-uF-4QoZ1'); diff --git a/test/chunking-form/samples/render-chunk/_expected/cjs/entry-main1-5be92ae4.js b/test/chunking-form/samples/render-chunk/_expected/cjs/entry-main1-zV-9xTLy.js similarity index 61% rename from test/chunking-form/samples/render-chunk/_expected/cjs/entry-main1-5be92ae4.js rename to test/chunking-form/samples/render-chunk/_expected/cjs/entry-main1-zV-9xTLy.js index 3dce2c571..723e55840 100644 --- a/test/chunking-form/samples/render-chunk/_expected/cjs/entry-main1-5be92ae4.js +++ b/test/chunking-form/samples/render-chunk/_expected/cjs/entry-main1-zV-9xTLy.js @@ -1,12 +1,12 @@ 'use strict'; -var dep2 = require('./chunk-dep2-8d89c265.js'); +var dep2 = require('./chunk-dep2-XPNbbDh-.js'); var num = 1; -console.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-9f86d081').href : new URL('asset-test-9f86d081', document.currentScript && document.currentScript.src || document.baseURI).href)); +console.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-uF-4QoZ1').href : new URL('asset-test-uF-4QoZ1', document.currentScript && document.currentScript.src || document.baseURI).href)); console.log(num + dep2.num); -console.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-9f86d081').href : new URL('asset-test-9f86d081', document.currentScript && document.currentScript.src || document.baseURI).href)); +console.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-uF-4QoZ1').href : new URL('asset-test-uF-4QoZ1', document.currentScript && document.currentScript.src || document.baseURI).href)); console.log({ "exports": [], "facadeModuleId": "**/main1.js", @@ -20,19 +20,19 @@ console.log({ "name": "main1", "type": "chunk", "dynamicImports": [], - "fileName": "entry-main1-5be92ae4.js", + "fileName": "entry-main1-zV-9xTLy.js", "implicitlyLoadedBefore": [], "importedBindings": { - "chunk-dep2-8d89c265.js": [ + "chunk-dep2-XPNbbDh-.js": [ "num" ] }, "imports": [ - "chunk-dep2-8d89c265.js" + "chunk-dep2-XPNbbDh-.js" ], "modules": { "**/dep1.js": { - "code": "var num = 1;\nconsole.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-9f86d081').href : new URL('asset-test-9f86d081', document.currentScript && document.currentScript.src || document.baseURI).href));", + "code": "var num = 1;\nconsole.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-uF-4QoZ1').href : new URL('asset-test-uF-4QoZ1', document.currentScript && document.currentScript.src || document.baseURI).href));", "originalLength": 19, "removedExports": [], "renderedExports": [ @@ -41,7 +41,7 @@ console.log({ "renderedLength": 269 }, "**/main1.js": { - "code": "console.log(num + dep2.num);\nconsole.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-9f86d081').href : new URL('asset-test-9f86d081', document.currentScript && document.currentScript.src || document.baseURI).href));", + "code": "console.log(num + dep2.num);\nconsole.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-uF-4QoZ1').href : new URL('asset-test-uF-4QoZ1', document.currentScript && document.currentScript.src || document.baseURI).href));", "originalLength": 102, "removedExports": [], "renderedExports": [], @@ -49,8 +49,8 @@ console.log({ } }, "referencedFiles": [ - "asset-test-9f86d081" + "asset-test-uF-4QoZ1" ] }); -console.log('all chunks', ["entry-main1-5be92ae4.js","entry-main2-20c5a0f4.js","chunk-dep2-8d89c265.js"]) -console.log('referenced asset in renderChunk', 'asset-test-9f86d081'); +console.log('all chunks', ["entry-main1-zV-9xTLy.js","entry-main2-urBx_vfo.js","chunk-dep2-XPNbbDh-.js"]) +console.log('referenced asset in renderChunk', 'asset-test-uF-4QoZ1'); diff --git a/test/chunking-form/samples/render-chunk/_expected/cjs/entry-main2-20c5a0f4.js b/test/chunking-form/samples/render-chunk/_expected/cjs/entry-main2-urBx_vfo.js similarity index 61% rename from test/chunking-form/samples/render-chunk/_expected/cjs/entry-main2-20c5a0f4.js rename to test/chunking-form/samples/render-chunk/_expected/cjs/entry-main2-urBx_vfo.js index d72c61b69..05b4f92fa 100644 --- a/test/chunking-form/samples/render-chunk/_expected/cjs/entry-main2-20c5a0f4.js +++ b/test/chunking-form/samples/render-chunk/_expected/cjs/entry-main2-urBx_vfo.js @@ -1,12 +1,12 @@ 'use strict'; -var dep2 = require('./chunk-dep2-8d89c265.js'); +var dep2 = require('./chunk-dep2-XPNbbDh-.js'); var num = 3; -console.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-9f86d081').href : new URL('asset-test-9f86d081', document.currentScript && document.currentScript.src || document.baseURI).href)); +console.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-uF-4QoZ1').href : new URL('asset-test-uF-4QoZ1', document.currentScript && document.currentScript.src || document.baseURI).href)); console.log(dep2.num + num); -console.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-9f86d081').href : new URL('asset-test-9f86d081', document.currentScript && document.currentScript.src || document.baseURI).href)); +console.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-uF-4QoZ1').href : new URL('asset-test-uF-4QoZ1', document.currentScript && document.currentScript.src || document.baseURI).href)); console.log({ "exports": [], "facadeModuleId": "**/main2.js", @@ -20,19 +20,19 @@ console.log({ "name": "main2", "type": "chunk", "dynamicImports": [], - "fileName": "entry-main2-20c5a0f4.js", + "fileName": "entry-main2-urBx_vfo.js", "implicitlyLoadedBefore": [], "importedBindings": { - "chunk-dep2-8d89c265.js": [ + "chunk-dep2-XPNbbDh-.js": [ "num" ] }, "imports": [ - "chunk-dep2-8d89c265.js" + "chunk-dep2-XPNbbDh-.js" ], "modules": { "**/dep3.js": { - "code": "var num = 3;\nconsole.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-9f86d081').href : new URL('asset-test-9f86d081', document.currentScript && document.currentScript.src || document.baseURI).href));", + "code": "var num = 3;\nconsole.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-uF-4QoZ1').href : new URL('asset-test-uF-4QoZ1', document.currentScript && document.currentScript.src || document.baseURI).href));", "originalLength": 19, "removedExports": [], "renderedExports": [ @@ -41,7 +41,7 @@ console.log({ "renderedLength": 269 }, "**/main2.js": { - "code": "console.log(dep2.num + num);\nconsole.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-9f86d081').href : new URL('asset-test-9f86d081', document.currentScript && document.currentScript.src || document.baseURI).href));", + "code": "console.log(dep2.num + num);\nconsole.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-uF-4QoZ1').href : new URL('asset-test-uF-4QoZ1', document.currentScript && document.currentScript.src || document.baseURI).href));", "originalLength": 102, "removedExports": [], "renderedExports": [], @@ -49,8 +49,8 @@ console.log({ } }, "referencedFiles": [ - "asset-test-9f86d081" + "asset-test-uF-4QoZ1" ] }); -console.log('all chunks', ["entry-main1-5be92ae4.js","entry-main2-20c5a0f4.js","chunk-dep2-8d89c265.js"]) -console.log('referenced asset in renderChunk', 'asset-test-9f86d081'); +console.log('all chunks', ["entry-main1-zV-9xTLy.js","entry-main2-urBx_vfo.js","chunk-dep2-XPNbbDh-.js"]) +console.log('referenced asset in renderChunk', 'asset-test-uF-4QoZ1'); diff --git a/test/chunking-form/samples/render-chunk/_expected/es/asset-test-9f86d081 b/test/chunking-form/samples/render-chunk/_expected/es/asset-test-uF-4QoZ1 similarity index 100% rename from test/chunking-form/samples/render-chunk/_expected/es/asset-test-9f86d081 rename to test/chunking-form/samples/render-chunk/_expected/es/asset-test-uF-4QoZ1 diff --git a/test/chunking-form/samples/render-chunk/_expected/es/chunk-dep2-0da9d5f1.js b/test/chunking-form/samples/render-chunk/_expected/es/chunk-dep2-P6jMk6bJ.js similarity index 64% rename from test/chunking-form/samples/render-chunk/_expected/es/chunk-dep2-0da9d5f1.js rename to test/chunking-form/samples/render-chunk/_expected/es/chunk-dep2-P6jMk6bJ.js index 385503c25..7b4ceb759 100644 --- a/test/chunking-form/samples/render-chunk/_expected/es/chunk-dep2-0da9d5f1.js +++ b/test/chunking-form/samples/render-chunk/_expected/es/chunk-dep2-P6jMk6bJ.js @@ -1,5 +1,5 @@ var num = 2; -console.log('referenced asset', new URL('asset-test-9f86d081', import.meta.url).href); +console.log('referenced asset', new URL('asset-test-uF-4QoZ1', import.meta.url).href); export { num as n }; console.log({ @@ -16,13 +16,13 @@ console.log({ "name": "dep2", "type": "chunk", "dynamicImports": [], - "fileName": "chunk-dep2-0da9d5f1.js", + "fileName": "chunk-dep2-P6jMk6bJ.js", "implicitlyLoadedBefore": [], "importedBindings": {}, "imports": [], "modules": { "**/dep2.js": { - "code": "var num = 2;\nconsole.log('referenced asset', new URL('asset-test-9f86d081', import.meta.url).href);", + "code": "var num = 2;\nconsole.log('referenced asset', new URL('asset-test-uF-4QoZ1', import.meta.url).href);", "originalLength": 19, "removedExports": [], "renderedExports": [ @@ -32,8 +32,8 @@ console.log({ } }, "referencedFiles": [ - "asset-test-9f86d081" + "asset-test-uF-4QoZ1" ] }); -console.log('all chunks', ["entry-main1-f3f64fb9.js","entry-main2-d0add96f.js","chunk-dep2-0da9d5f1.js"]) -console.log('referenced asset in renderChunk', 'asset-test-9f86d081'); +console.log('all chunks', ["entry-main1--LupZW-p.js","entry-main2-wXJ52_9X.js","chunk-dep2-P6jMk6bJ.js"]) +console.log('referenced asset in renderChunk', 'asset-test-uF-4QoZ1'); diff --git a/test/chunking-form/samples/render-chunk/_expected/es/entry-main1-f3f64fb9.js b/test/chunking-form/samples/render-chunk/_expected/es/entry-main1--LupZW-p.js similarity index 60% rename from test/chunking-form/samples/render-chunk/_expected/es/entry-main1-f3f64fb9.js rename to test/chunking-form/samples/render-chunk/_expected/es/entry-main1--LupZW-p.js index bf56a24de..d4f4182a6 100644 --- a/test/chunking-form/samples/render-chunk/_expected/es/entry-main1-f3f64fb9.js +++ b/test/chunking-form/samples/render-chunk/_expected/es/entry-main1--LupZW-p.js @@ -1,10 +1,10 @@ -import { n as num$1 } from './chunk-dep2-0da9d5f1.js'; +import { n as num$1 } from './chunk-dep2-P6jMk6bJ.js'; var num = 1; -console.log('referenced asset', new URL('asset-test-9f86d081', import.meta.url).href); +console.log('referenced asset', new URL('asset-test-uF-4QoZ1', import.meta.url).href); console.log(num + num$1); -console.log('referenced asset', new URL('asset-test-9f86d081', import.meta.url).href); +console.log('referenced asset', new URL('asset-test-uF-4QoZ1', import.meta.url).href); console.log({ "exports": [], "facadeModuleId": "**/main1.js", @@ -18,19 +18,19 @@ console.log({ "name": "main1", "type": "chunk", "dynamicImports": [], - "fileName": "entry-main1-f3f64fb9.js", + "fileName": "entry-main1--LupZW-p.js", "implicitlyLoadedBefore": [], "importedBindings": { - "chunk-dep2-0da9d5f1.js": [ + "chunk-dep2-P6jMk6bJ.js": [ "n" ] }, "imports": [ - "chunk-dep2-0da9d5f1.js" + "chunk-dep2-P6jMk6bJ.js" ], "modules": { "**/dep1.js": { - "code": "var num = 1;\nconsole.log('referenced asset', new URL('asset-test-9f86d081', import.meta.url).href);", + "code": "var num = 1;\nconsole.log('referenced asset', new URL('asset-test-uF-4QoZ1', import.meta.url).href);", "originalLength": 19, "removedExports": [], "renderedExports": [ @@ -39,7 +39,7 @@ console.log({ "renderedLength": 99 }, "**/main1.js": { - "code": "console.log(num + num$1);\nconsole.log('referenced asset', new URL('asset-test-9f86d081', import.meta.url).href);", + "code": "console.log(num + num$1);\nconsole.log('referenced asset', new URL('asset-test-uF-4QoZ1', import.meta.url).href);", "originalLength": 102, "removedExports": [], "renderedExports": [], @@ -47,8 +47,8 @@ console.log({ } }, "referencedFiles": [ - "asset-test-9f86d081" + "asset-test-uF-4QoZ1" ] }); -console.log('all chunks', ["entry-main1-f3f64fb9.js","entry-main2-d0add96f.js","chunk-dep2-0da9d5f1.js"]) -console.log('referenced asset in renderChunk', 'asset-test-9f86d081'); +console.log('all chunks', ["entry-main1--LupZW-p.js","entry-main2-wXJ52_9X.js","chunk-dep2-P6jMk6bJ.js"]) +console.log('referenced asset in renderChunk', 'asset-test-uF-4QoZ1'); diff --git a/test/chunking-form/samples/render-chunk/_expected/es/entry-main2-d0add96f.js b/test/chunking-form/samples/render-chunk/_expected/es/entry-main2-wXJ52_9X.js similarity index 60% rename from test/chunking-form/samples/render-chunk/_expected/es/entry-main2-d0add96f.js rename to test/chunking-form/samples/render-chunk/_expected/es/entry-main2-wXJ52_9X.js index ec8304ffc..0d7280858 100644 --- a/test/chunking-form/samples/render-chunk/_expected/es/entry-main2-d0add96f.js +++ b/test/chunking-form/samples/render-chunk/_expected/es/entry-main2-wXJ52_9X.js @@ -1,10 +1,10 @@ -import { n as num$1 } from './chunk-dep2-0da9d5f1.js'; +import { n as num$1 } from './chunk-dep2-P6jMk6bJ.js'; var num = 3; -console.log('referenced asset', new URL('asset-test-9f86d081', import.meta.url).href); +console.log('referenced asset', new URL('asset-test-uF-4QoZ1', import.meta.url).href); console.log(num$1 + num); -console.log('referenced asset', new URL('asset-test-9f86d081', import.meta.url).href); +console.log('referenced asset', new URL('asset-test-uF-4QoZ1', import.meta.url).href); console.log({ "exports": [], "facadeModuleId": "**/main2.js", @@ -18,19 +18,19 @@ console.log({ "name": "main2", "type": "chunk", "dynamicImports": [], - "fileName": "entry-main2-d0add96f.js", + "fileName": "entry-main2-wXJ52_9X.js", "implicitlyLoadedBefore": [], "importedBindings": { - "chunk-dep2-0da9d5f1.js": [ + "chunk-dep2-P6jMk6bJ.js": [ "n" ] }, "imports": [ - "chunk-dep2-0da9d5f1.js" + "chunk-dep2-P6jMk6bJ.js" ], "modules": { "**/dep3.js": { - "code": "var num = 3;\nconsole.log('referenced asset', new URL('asset-test-9f86d081', import.meta.url).href);", + "code": "var num = 3;\nconsole.log('referenced asset', new URL('asset-test-uF-4QoZ1', import.meta.url).href);", "originalLength": 19, "removedExports": [], "renderedExports": [ @@ -39,7 +39,7 @@ console.log({ "renderedLength": 99 }, "**/main2.js": { - "code": "console.log(num$1 + num);\nconsole.log('referenced asset', new URL('asset-test-9f86d081', import.meta.url).href);", + "code": "console.log(num$1 + num);\nconsole.log('referenced asset', new URL('asset-test-uF-4QoZ1', import.meta.url).href);", "originalLength": 102, "removedExports": [], "renderedExports": [], @@ -47,8 +47,8 @@ console.log({ } }, "referencedFiles": [ - "asset-test-9f86d081" + "asset-test-uF-4QoZ1" ] }); -console.log('all chunks', ["entry-main1-f3f64fb9.js","entry-main2-d0add96f.js","chunk-dep2-0da9d5f1.js"]) -console.log('referenced asset in renderChunk', 'asset-test-9f86d081'); +console.log('all chunks', ["entry-main1--LupZW-p.js","entry-main2-wXJ52_9X.js","chunk-dep2-P6jMk6bJ.js"]) +console.log('referenced asset in renderChunk', 'asset-test-uF-4QoZ1'); diff --git a/test/chunking-form/samples/render-chunk/_expected/system/asset-test-9f86d081 b/test/chunking-form/samples/render-chunk/_expected/system/asset-test-uF-4QoZ1 similarity index 100% rename from test/chunking-form/samples/render-chunk/_expected/system/asset-test-9f86d081 rename to test/chunking-form/samples/render-chunk/_expected/system/asset-test-uF-4QoZ1 diff --git a/test/chunking-form/samples/render-chunk/_expected/system/chunk-dep2-be1287c1.js b/test/chunking-form/samples/render-chunk/_expected/system/chunk-dep2-tTS3nOMy.js similarity index 67% rename from test/chunking-form/samples/render-chunk/_expected/system/chunk-dep2-be1287c1.js rename to test/chunking-form/samples/render-chunk/_expected/system/chunk-dep2-tTS3nOMy.js index 48f5a405d..c955dbaf4 100644 --- a/test/chunking-form/samples/render-chunk/_expected/system/chunk-dep2-be1287c1.js +++ b/test/chunking-form/samples/render-chunk/_expected/system/chunk-dep2-tTS3nOMy.js @@ -4,7 +4,7 @@ System.register([], (function (exports, module) { execute: (function () { var num = exports('n', 2); - console.log('referenced asset', new URL('asset-test-9f86d081', module.meta.url).href); + console.log('referenced asset', new URL('asset-test-uF-4QoZ1', module.meta.url).href); }) }; @@ -23,13 +23,13 @@ console.log({ "name": "dep2", "type": "chunk", "dynamicImports": [], - "fileName": "chunk-dep2-be1287c1.js", + "fileName": "chunk-dep2-tTS3nOMy.js", "implicitlyLoadedBefore": [], "importedBindings": {}, "imports": [], "modules": { "**/dep2.js": { - "code": "\t\t\tvar num = exports('n', 2);\n\t\t\tconsole.log('referenced asset', new URL('asset-test-9f86d081', module.meta.url).href);", + "code": "\t\t\tvar num = exports('n', 2);\n\t\t\tconsole.log('referenced asset', new URL('asset-test-uF-4QoZ1', module.meta.url).href);", "originalLength": 19, "removedExports": [], "renderedExports": [ @@ -39,8 +39,8 @@ console.log({ } }, "referencedFiles": [ - "asset-test-9f86d081" + "asset-test-uF-4QoZ1" ] }); -console.log('all chunks', ["entry-main1-f0891ef8.js","entry-main2-ef5991ab.js","chunk-dep2-be1287c1.js"]) -console.log('referenced asset in renderChunk', 'asset-test-9f86d081'); +console.log('all chunks', ["entry-main1-j8-hK8pw.js","entry-main2-Y97yXNTt.js","chunk-dep2-tTS3nOMy.js"]) +console.log('referenced asset in renderChunk', 'asset-test-uF-4QoZ1'); diff --git a/test/chunking-form/samples/render-chunk/_expected/system/entry-main1-f0891ef8.js b/test/chunking-form/samples/render-chunk/_expected/system/entry-main1-j8-hK8pw.js similarity index 63% rename from test/chunking-form/samples/render-chunk/_expected/system/entry-main1-f0891ef8.js rename to test/chunking-form/samples/render-chunk/_expected/system/entry-main1-j8-hK8pw.js index a9ede4a55..113d4903a 100644 --- a/test/chunking-form/samples/render-chunk/_expected/system/entry-main1-f0891ef8.js +++ b/test/chunking-form/samples/render-chunk/_expected/system/entry-main1-j8-hK8pw.js @@ -1,4 +1,4 @@ -System.register(['./chunk-dep2-be1287c1.js'], (function (exports, module) { +System.register(['./chunk-dep2-tTS3nOMy.js'], (function (exports, module) { 'use strict'; var num$1; return { @@ -8,10 +8,10 @@ System.register(['./chunk-dep2-be1287c1.js'], (function (exports, module) { execute: (function () { var num = 1; - console.log('referenced asset', new URL('asset-test-9f86d081', module.meta.url).href); + console.log('referenced asset', new URL('asset-test-uF-4QoZ1', module.meta.url).href); console.log(num + num$1); - console.log('referenced asset', new URL('asset-test-9f86d081', module.meta.url).href); + console.log('referenced asset', new URL('asset-test-uF-4QoZ1', module.meta.url).href); }) }; @@ -29,19 +29,19 @@ console.log({ "name": "main1", "type": "chunk", "dynamicImports": [], - "fileName": "entry-main1-f0891ef8.js", + "fileName": "entry-main1-j8-hK8pw.js", "implicitlyLoadedBefore": [], "importedBindings": { - "chunk-dep2-be1287c1.js": [ + "chunk-dep2-tTS3nOMy.js": [ "n" ] }, "imports": [ - "chunk-dep2-be1287c1.js" + "chunk-dep2-tTS3nOMy.js" ], "modules": { "**/dep1.js": { - "code": "\t\t\tvar num = 1;\n\t\t\tconsole.log('referenced asset', new URL('asset-test-9f86d081', module.meta.url).href);", + "code": "\t\t\tvar num = 1;\n\t\t\tconsole.log('referenced asset', new URL('asset-test-uF-4QoZ1', module.meta.url).href);", "originalLength": 19, "removedExports": [], "renderedExports": [ @@ -50,7 +50,7 @@ console.log({ "renderedLength": 99 }, "**/main1.js": { - "code": "\t\t\tconsole.log(num + num$1);\n\t\t\tconsole.log('referenced asset', new URL('asset-test-9f86d081', module.meta.url).href);", + "code": "\t\t\tconsole.log(num + num$1);\n\t\t\tconsole.log('referenced asset', new URL('asset-test-uF-4QoZ1', module.meta.url).href);", "originalLength": 102, "removedExports": [], "renderedExports": [], @@ -58,8 +58,8 @@ console.log({ } }, "referencedFiles": [ - "asset-test-9f86d081" + "asset-test-uF-4QoZ1" ] }); -console.log('all chunks', ["entry-main1-f0891ef8.js","entry-main2-ef5991ab.js","chunk-dep2-be1287c1.js"]) -console.log('referenced asset in renderChunk', 'asset-test-9f86d081'); +console.log('all chunks', ["entry-main1-j8-hK8pw.js","entry-main2-Y97yXNTt.js","chunk-dep2-tTS3nOMy.js"]) +console.log('referenced asset in renderChunk', 'asset-test-uF-4QoZ1'); diff --git a/test/chunking-form/samples/render-chunk/_expected/system/entry-main2-ef5991ab.js b/test/chunking-form/samples/render-chunk/_expected/system/entry-main2-Y97yXNTt.js similarity index 63% rename from test/chunking-form/samples/render-chunk/_expected/system/entry-main2-ef5991ab.js rename to test/chunking-form/samples/render-chunk/_expected/system/entry-main2-Y97yXNTt.js index 2d601bb5d..b869aed54 100644 --- a/test/chunking-form/samples/render-chunk/_expected/system/entry-main2-ef5991ab.js +++ b/test/chunking-form/samples/render-chunk/_expected/system/entry-main2-Y97yXNTt.js @@ -1,4 +1,4 @@ -System.register(['./chunk-dep2-be1287c1.js'], (function (exports, module) { +System.register(['./chunk-dep2-tTS3nOMy.js'], (function (exports, module) { 'use strict'; var num$1; return { @@ -8,10 +8,10 @@ System.register(['./chunk-dep2-be1287c1.js'], (function (exports, module) { execute: (function () { var num = 3; - console.log('referenced asset', new URL('asset-test-9f86d081', module.meta.url).href); + console.log('referenced asset', new URL('asset-test-uF-4QoZ1', module.meta.url).href); console.log(num$1 + num); - console.log('referenced asset', new URL('asset-test-9f86d081', module.meta.url).href); + console.log('referenced asset', new URL('asset-test-uF-4QoZ1', module.meta.url).href); }) }; @@ -29,19 +29,19 @@ console.log({ "name": "main2", "type": "chunk", "dynamicImports": [], - "fileName": "entry-main2-ef5991ab.js", + "fileName": "entry-main2-Y97yXNTt.js", "implicitlyLoadedBefore": [], "importedBindings": { - "chunk-dep2-be1287c1.js": [ + "chunk-dep2-tTS3nOMy.js": [ "n" ] }, "imports": [ - "chunk-dep2-be1287c1.js" + "chunk-dep2-tTS3nOMy.js" ], "modules": { "**/dep3.js": { - "code": "\t\t\tvar num = 3;\n\t\t\tconsole.log('referenced asset', new URL('asset-test-9f86d081', module.meta.url).href);", + "code": "\t\t\tvar num = 3;\n\t\t\tconsole.log('referenced asset', new URL('asset-test-uF-4QoZ1', module.meta.url).href);", "originalLength": 19, "removedExports": [], "renderedExports": [ @@ -50,7 +50,7 @@ console.log({ "renderedLength": 99 }, "**/main2.js": { - "code": "\t\t\tconsole.log(num$1 + num);\n\t\t\tconsole.log('referenced asset', new URL('asset-test-9f86d081', module.meta.url).href);", + "code": "\t\t\tconsole.log(num$1 + num);\n\t\t\tconsole.log('referenced asset', new URL('asset-test-uF-4QoZ1', module.meta.url).href);", "originalLength": 102, "removedExports": [], "renderedExports": [], @@ -58,8 +58,8 @@ console.log({ } }, "referencedFiles": [ - "asset-test-9f86d081" + "asset-test-uF-4QoZ1" ] }); -console.log('all chunks', ["entry-main1-f0891ef8.js","entry-main2-ef5991ab.js","chunk-dep2-be1287c1.js"]) -console.log('referenced asset in renderChunk', 'asset-test-9f86d081'); +console.log('all chunks', ["entry-main1-j8-hK8pw.js","entry-main2-Y97yXNTt.js","chunk-dep2-tTS3nOMy.js"]) +console.log('referenced asset in renderChunk', 'asset-test-uF-4QoZ1'); diff --git a/test/chunking-form/samples/resolve-file-url/_expected/amd/assets/asset-resolved-9e0f7ca5.txt b/test/chunking-form/samples/resolve-file-url/_expected/amd/assets/asset-resolved-7pLh6Sdd.txt similarity index 100% rename from test/chunking-form/samples/resolve-file-url/_expected/amd/assets/asset-resolved-9e0f7ca5.txt rename to test/chunking-form/samples/resolve-file-url/_expected/amd/assets/asset-resolved-7pLh6Sdd.txt diff --git a/test/chunking-form/samples/resolve-file-url/_expected/amd/assets/asset-solved-230ecafd.txt b/test/chunking-form/samples/resolve-file-url/_expected/amd/assets/asset-solved-0oyI4hTT.txt similarity index 100% rename from test/chunking-form/samples/resolve-file-url/_expected/amd/assets/asset-solved-230ecafd.txt rename to test/chunking-form/samples/resolve-file-url/_expected/amd/assets/asset-solved-0oyI4hTT.txt diff --git a/test/chunking-form/samples/resolve-file-url/_expected/amd/assets/asset-unresolved-f4c1e86c.txt b/test/chunking-form/samples/resolve-file-url/_expected/amd/assets/asset-unresolved-e0Iev6TZ.txt similarity index 100% rename from test/chunking-form/samples/resolve-file-url/_expected/amd/assets/asset-unresolved-f4c1e86c.txt rename to test/chunking-form/samples/resolve-file-url/_expected/amd/assets/asset-unresolved-e0Iev6TZ.txt diff --git a/test/chunking-form/samples/resolve-file-url/_expected/amd/main.js b/test/chunking-form/samples/resolve-file-url/_expected/amd/main.js index af4a4d205..ed660feea 100644 --- a/test/chunking-form/samples/resolve-file-url/_expected/amd/main.js +++ b/test/chunking-form/samples/resolve-file-url/_expected/amd/main.js @@ -3,7 +3,7 @@ define(['require'], (function (require) { 'use strict'; const asset$1 = 'resolved'; const chunk$1 = 'resolved'; - const asset = new URL(require.toUrl('./assets/asset-unresolved-f4c1e86c.txt'), document.baseURI).href; + const asset = new URL(require.toUrl('./assets/asset-unresolved-e0Iev6TZ.txt'), document.baseURI).href; const chunk = new URL(require.toUrl('./nested/chunk2.js'), document.baseURI).href; new Promise(function (resolve, reject) { require(['./nested/chunk'], resolve, reject); }).then(result => console.log(result, chunk$1, chunk, asset$1, asset)); diff --git a/test/chunking-form/samples/resolve-file-url/_expected/amd/nested/chunk.js b/test/chunking-form/samples/resolve-file-url/_expected/amd/nested/chunk.js index c077f6b4e..5dc55f77d 100644 --- a/test/chunking-form/samples/resolve-file-url/_expected/amd/nested/chunk.js +++ b/test/chunking-form/samples/resolve-file-url/_expected/amd/nested/chunk.js @@ -1,7 +1,7 @@ define(['require', 'exports'], (function (require, exports) { 'use strict'; - const asset = 'chunkId=nested/chunk.js:moduleId=solved:fileName=assets/asset-solved-230ecafd.txt:format=amd:relativePath=../assets/asset-solved-230ecafd.txt:referenceId=6296c678'; - const chunk = 'chunkId=nested/chunk.js:moduleId=solved:fileName=nested/chunk2.js:format=amd:relativePath=chunk2.js:referenceId=f6c25ae7'; + const asset = 'chunkId=nested/chunk.js:moduleId=solved:fileName=assets/asset-solved-0oyI4hTT.txt:format=amd:relativePath=../assets/asset-solved-0oyI4hTT.txt:referenceId=JY$sxHZX'; + const chunk = 'chunkId=nested/chunk.js:moduleId=solved:fileName=nested/chunk2.js:format=amd:relativePath=chunk2.js:referenceId=8T3lqddV'; exports.asset = asset; exports.chunk = chunk; diff --git a/test/chunking-form/samples/resolve-file-url/_expected/cjs/assets/asset-resolved-9e0f7ca5.txt b/test/chunking-form/samples/resolve-file-url/_expected/cjs/assets/asset-resolved-7pLh6Sdd.txt similarity index 100% rename from test/chunking-form/samples/resolve-file-url/_expected/cjs/assets/asset-resolved-9e0f7ca5.txt rename to test/chunking-form/samples/resolve-file-url/_expected/cjs/assets/asset-resolved-7pLh6Sdd.txt diff --git a/test/chunking-form/samples/resolve-file-url/_expected/cjs/assets/asset-solved-230ecafd.txt b/test/chunking-form/samples/resolve-file-url/_expected/cjs/assets/asset-solved-0oyI4hTT.txt similarity index 100% rename from test/chunking-form/samples/resolve-file-url/_expected/cjs/assets/asset-solved-230ecafd.txt rename to test/chunking-form/samples/resolve-file-url/_expected/cjs/assets/asset-solved-0oyI4hTT.txt diff --git a/test/chunking-form/samples/resolve-file-url/_expected/cjs/assets/asset-unresolved-f4c1e86c.txt b/test/chunking-form/samples/resolve-file-url/_expected/cjs/assets/asset-unresolved-e0Iev6TZ.txt similarity index 100% rename from test/chunking-form/samples/resolve-file-url/_expected/cjs/assets/asset-unresolved-f4c1e86c.txt rename to test/chunking-form/samples/resolve-file-url/_expected/cjs/assets/asset-unresolved-e0Iev6TZ.txt diff --git a/test/chunking-form/samples/resolve-file-url/_expected/cjs/main.js b/test/chunking-form/samples/resolve-file-url/_expected/cjs/main.js index b77e39dfd..4e291ed1d 100644 --- a/test/chunking-form/samples/resolve-file-url/_expected/cjs/main.js +++ b/test/chunking-form/samples/resolve-file-url/_expected/cjs/main.js @@ -3,7 +3,7 @@ const asset$1 = 'resolved'; const chunk$1 = 'resolved'; -const asset = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-unresolved-f4c1e86c.txt').href : new URL('assets/asset-unresolved-f4c1e86c.txt', document.currentScript && document.currentScript.src || document.baseURI).href); +const asset = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-unresolved-e0Iev6TZ.txt').href : new URL('assets/asset-unresolved-e0Iev6TZ.txt', document.currentScript && document.currentScript.src || document.baseURI).href); const chunk = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/nested/chunk2.js').href : new URL('nested/chunk2.js', document.currentScript && document.currentScript.src || document.baseURI).href); Promise.resolve().then(function () { return require('./nested/chunk.js'); }).then(result => console.log(result, chunk$1, chunk, asset$1, asset)); diff --git a/test/chunking-form/samples/resolve-file-url/_expected/cjs/nested/chunk.js b/test/chunking-form/samples/resolve-file-url/_expected/cjs/nested/chunk.js index 206e5c2c2..4aec9a889 100644 --- a/test/chunking-form/samples/resolve-file-url/_expected/cjs/nested/chunk.js +++ b/test/chunking-form/samples/resolve-file-url/_expected/cjs/nested/chunk.js @@ -1,7 +1,7 @@ 'use strict'; -const asset = 'chunkId=nested/chunk.js:moduleId=solved:fileName=assets/asset-solved-230ecafd.txt:format=cjs:relativePath=../assets/asset-solved-230ecafd.txt:referenceId=6296c678'; -const chunk = 'chunkId=nested/chunk.js:moduleId=solved:fileName=nested/chunk2.js:format=cjs:relativePath=chunk2.js:referenceId=f6c25ae7'; +const asset = 'chunkId=nested/chunk.js:moduleId=solved:fileName=assets/asset-solved-0oyI4hTT.txt:format=cjs:relativePath=../assets/asset-solved-0oyI4hTT.txt:referenceId=JY$sxHZX'; +const chunk = 'chunkId=nested/chunk.js:moduleId=solved:fileName=nested/chunk2.js:format=cjs:relativePath=chunk2.js:referenceId=8T3lqddV'; exports.asset = asset; exports.chunk = chunk; diff --git a/test/chunking-form/samples/resolve-file-url/_expected/es/assets/asset-resolved-9e0f7ca5.txt b/test/chunking-form/samples/resolve-file-url/_expected/es/assets/asset-resolved-7pLh6Sdd.txt similarity index 100% rename from test/chunking-form/samples/resolve-file-url/_expected/es/assets/asset-resolved-9e0f7ca5.txt rename to test/chunking-form/samples/resolve-file-url/_expected/es/assets/asset-resolved-7pLh6Sdd.txt diff --git a/test/chunking-form/samples/resolve-file-url/_expected/es/assets/asset-solved-230ecafd.txt b/test/chunking-form/samples/resolve-file-url/_expected/es/assets/asset-solved-0oyI4hTT.txt similarity index 100% rename from test/chunking-form/samples/resolve-file-url/_expected/es/assets/asset-solved-230ecafd.txt rename to test/chunking-form/samples/resolve-file-url/_expected/es/assets/asset-solved-0oyI4hTT.txt diff --git a/test/chunking-form/samples/resolve-file-url/_expected/es/assets/asset-unresolved-f4c1e86c.txt b/test/chunking-form/samples/resolve-file-url/_expected/es/assets/asset-unresolved-e0Iev6TZ.txt similarity index 100% rename from test/chunking-form/samples/resolve-file-url/_expected/es/assets/asset-unresolved-f4c1e86c.txt rename to test/chunking-form/samples/resolve-file-url/_expected/es/assets/asset-unresolved-e0Iev6TZ.txt diff --git a/test/chunking-form/samples/resolve-file-url/_expected/es/main.js b/test/chunking-form/samples/resolve-file-url/_expected/es/main.js index 787fa8158..46368bd72 100644 --- a/test/chunking-form/samples/resolve-file-url/_expected/es/main.js +++ b/test/chunking-form/samples/resolve-file-url/_expected/es/main.js @@ -1,7 +1,7 @@ const asset$1 = 'resolved'; const chunk$1 = 'resolved'; -const asset = new URL('assets/asset-unresolved-f4c1e86c.txt', import.meta.url).href; +const asset = new URL('assets/asset-unresolved-e0Iev6TZ.txt', import.meta.url).href; const chunk = new URL('nested/chunk2.js', import.meta.url).href; import('./nested/chunk.js').then(result => console.log(result, chunk$1, chunk, asset$1, asset)); diff --git a/test/chunking-form/samples/resolve-file-url/_expected/es/nested/chunk.js b/test/chunking-form/samples/resolve-file-url/_expected/es/nested/chunk.js index a9081bb7a..b0cc32e88 100644 --- a/test/chunking-form/samples/resolve-file-url/_expected/es/nested/chunk.js +++ b/test/chunking-form/samples/resolve-file-url/_expected/es/nested/chunk.js @@ -1,4 +1,4 @@ -const asset = 'chunkId=nested/chunk.js:moduleId=solved:fileName=assets/asset-solved-230ecafd.txt:format=es:relativePath=../assets/asset-solved-230ecafd.txt:referenceId=6296c678'; -const chunk = 'chunkId=nested/chunk.js:moduleId=solved:fileName=nested/chunk2.js:format=es:relativePath=chunk2.js:referenceId=f6c25ae7'; +const asset = 'chunkId=nested/chunk.js:moduleId=solved:fileName=assets/asset-solved-0oyI4hTT.txt:format=es:relativePath=../assets/asset-solved-0oyI4hTT.txt:referenceId=JY$sxHZX'; +const chunk = 'chunkId=nested/chunk.js:moduleId=solved:fileName=nested/chunk2.js:format=es:relativePath=chunk2.js:referenceId=8T3lqddV'; export { asset, chunk }; diff --git a/test/chunking-form/samples/resolve-file-url/_expected/system/assets/asset-resolved-9e0f7ca5.txt b/test/chunking-form/samples/resolve-file-url/_expected/system/assets/asset-resolved-7pLh6Sdd.txt similarity index 100% rename from test/chunking-form/samples/resolve-file-url/_expected/system/assets/asset-resolved-9e0f7ca5.txt rename to test/chunking-form/samples/resolve-file-url/_expected/system/assets/asset-resolved-7pLh6Sdd.txt diff --git a/test/chunking-form/samples/resolve-file-url/_expected/system/assets/asset-solved-230ecafd.txt b/test/chunking-form/samples/resolve-file-url/_expected/system/assets/asset-solved-0oyI4hTT.txt similarity index 100% rename from test/chunking-form/samples/resolve-file-url/_expected/system/assets/asset-solved-230ecafd.txt rename to test/chunking-form/samples/resolve-file-url/_expected/system/assets/asset-solved-0oyI4hTT.txt diff --git a/test/chunking-form/samples/resolve-file-url/_expected/system/assets/asset-unresolved-f4c1e86c.txt b/test/chunking-form/samples/resolve-file-url/_expected/system/assets/asset-unresolved-e0Iev6TZ.txt similarity index 100% rename from test/chunking-form/samples/resolve-file-url/_expected/system/assets/asset-unresolved-f4c1e86c.txt rename to test/chunking-form/samples/resolve-file-url/_expected/system/assets/asset-unresolved-e0Iev6TZ.txt diff --git a/test/chunking-form/samples/resolve-file-url/_expected/system/main.js b/test/chunking-form/samples/resolve-file-url/_expected/system/main.js index e8f41d38a..60d285357 100644 --- a/test/chunking-form/samples/resolve-file-url/_expected/system/main.js +++ b/test/chunking-form/samples/resolve-file-url/_expected/system/main.js @@ -6,7 +6,7 @@ System.register([], (function (exports, module) { const asset$1 = 'resolved'; const chunk$1 = 'resolved'; - const asset = new URL('assets/asset-unresolved-f4c1e86c.txt', module.meta.url).href; + const asset = new URL('assets/asset-unresolved-e0Iev6TZ.txt', module.meta.url).href; const chunk = new URL('nested/chunk2.js', module.meta.url).href; module.import('./nested/chunk.js').then(result => console.log(result, chunk$1, chunk, asset$1, asset)); diff --git a/test/chunking-form/samples/resolve-file-url/_expected/system/nested/chunk.js b/test/chunking-form/samples/resolve-file-url/_expected/system/nested/chunk.js index 2565e1e88..6f462a10d 100644 --- a/test/chunking-form/samples/resolve-file-url/_expected/system/nested/chunk.js +++ b/test/chunking-form/samples/resolve-file-url/_expected/system/nested/chunk.js @@ -3,8 +3,8 @@ System.register([], (function (exports, module) { return { execute: (function () { - const asset = exports('asset', 'chunkId=nested/chunk.js:moduleId=solved:fileName=assets/asset-solved-230ecafd.txt:format=system:relativePath=../assets/asset-solved-230ecafd.txt:referenceId=6296c678'); - const chunk = exports('chunk', 'chunkId=nested/chunk.js:moduleId=solved:fileName=nested/chunk2.js:format=system:relativePath=chunk2.js:referenceId=f6c25ae7'); + const asset = exports('asset', 'chunkId=nested/chunk.js:moduleId=solved:fileName=assets/asset-solved-0oyI4hTT.txt:format=system:relativePath=../assets/asset-solved-0oyI4hTT.txt:referenceId=JY$sxHZX'); + const chunk = exports('chunk', 'chunkId=nested/chunk.js:moduleId=solved:fileName=nested/chunk2.js:format=system:relativePath=chunk2.js:referenceId=8T3lqddV'); }) }; diff --git a/test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/dynamic-eea0ce30202b-5ec8d44f.js.map b/test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/dynamic-HgyWTd0RHPMm-Z5LV91eZ.js.map similarity index 69% rename from test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/dynamic-eea0ce30202b-5ec8d44f.js.map rename to test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/dynamic-HgyWTd0RHPMm-Z5LV91eZ.js.map index c8102366e..2faf27354 100644 --- a/test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/dynamic-eea0ce30202b-5ec8d44f.js.map +++ b/test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/dynamic-HgyWTd0RHPMm-Z5LV91eZ.js.map @@ -1 +1 @@ -{"version":3,"file":"dynamic-hashed-5ec8d44f.js","sources":["../../dynamic-hashed.js"],"sourcesContent":["console.log('dynamic-hashed');\n"],"names":[],"mappings":";;CAAA,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;;;;;;"} \ No newline at end of file +{"version":3,"file":"dynamic-hashed-Z5LV91eZ.js","sources":["../../dynamic-hashed.js"],"sourcesContent":["console.log('dynamic-hashed');\n"],"names":[],"mappings":";;CAAA,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;;;;;;"} \ No newline at end of file diff --git a/test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/dynamic-hashed-5ec8d44f.js b/test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/dynamic-hashed-Z5LV91eZ.js similarity index 56% rename from test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/dynamic-hashed-5ec8d44f.js rename to test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/dynamic-hashed-Z5LV91eZ.js index 775befa5f..5deef2a6c 100644 --- a/test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/dynamic-hashed-5ec8d44f.js +++ b/test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/dynamic-hashed-Z5LV91eZ.js @@ -3,4 +3,4 @@ define((function () { 'use strict'; console.log('dynamic-hashed'); })); -//# sourceMappingURL=dynamic-eea0ce30202b-5ec8d44f.js.map +//# sourceMappingURL=dynamic-HgyWTd0RHPMm-Z5LV91eZ.js.map diff --git a/test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/dynamic-a0f7e361.js b/test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/dynamic-kWEjd9Su.js similarity index 100% rename from test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/dynamic-a0f7e361.js rename to test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/dynamic-kWEjd9Su.js diff --git a/test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/dynamic.js.map b/test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/dynamic.js.map index 3af06b91a..81e4f75eb 100644 --- a/test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/dynamic.js.map +++ b/test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/dynamic.js.map @@ -1 +1 @@ -{"version":3,"file":"dynamic-a0f7e361.js","sources":["../../dynamic.js"],"sourcesContent":["console.log('dynamic');\n"],"names":[],"mappings":";;CAAA,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;;;;;;"} \ No newline at end of file +{"version":3,"file":"dynamic-kWEjd9Su.js","sources":["../../dynamic.js"],"sourcesContent":["console.log('dynamic');\n"],"names":[],"mappings":";;CAAA,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;;;;;;"} \ No newline at end of file diff --git a/test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/main.js b/test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/main.js index 2c4333834..bc48ae880 100644 --- a/test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/main.js +++ b/test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/main.js @@ -1,7 +1,7 @@ define(['require'], (function (require) { 'use strict'; - new Promise(function (resolve, reject) { require(['./dynamic-a0f7e361'], resolve, reject); }); - new Promise(function (resolve, reject) { require(['./dynamic-hashed-5ec8d44f'], resolve, reject); }); + new Promise(function (resolve, reject) { require(['./dynamic-kWEjd9Su'], resolve, reject); }); + new Promise(function (resolve, reject) { require(['./dynamic-hashed-Z5LV91eZ'], resolve, reject); }); })); //# sourceMappingURL=main.js.map diff --git a/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/dynamic-44faaace9dbc-e21b9079.js.map b/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/dynamic-Bj3iqQlUJnPN-DzdWIGlX.js.map similarity index 68% rename from test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/dynamic-44faaace9dbc-e21b9079.js.map rename to test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/dynamic-Bj3iqQlUJnPN-DzdWIGlX.js.map index b1be3c6ea..0c47da9b3 100644 --- a/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/dynamic-44faaace9dbc-e21b9079.js.map +++ b/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/dynamic-Bj3iqQlUJnPN-DzdWIGlX.js.map @@ -1 +1 @@ -{"version":3,"file":"dynamic-hashed-e21b9079.js","sources":["../../dynamic-hashed.js"],"sourcesContent":["console.log('dynamic-hashed');\n"],"names":[],"mappings":";;AAAA,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;;"} \ No newline at end of file +{"version":3,"file":"dynamic-hashed-DzdWIGlX.js","sources":["../../dynamic-hashed.js"],"sourcesContent":["console.log('dynamic-hashed');\n"],"names":[],"mappings":";;AAAA,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;;"} \ No newline at end of file diff --git a/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/dynamic-03a87e17.js b/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/dynamic-Q4C4Dm_h.js similarity index 100% rename from test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/dynamic-03a87e17.js rename to test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/dynamic-Q4C4Dm_h.js diff --git a/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/dynamic-hashed-DzdWIGlX.js b/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/dynamic-hashed-DzdWIGlX.js new file mode 100644 index 000000000..adebf2bba --- /dev/null +++ b/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/dynamic-hashed-DzdWIGlX.js @@ -0,0 +1,4 @@ +'use strict'; + +console.log('dynamic-hashed'); +//# sourceMappingURL=dynamic-Bj3iqQlUJnPN-DzdWIGlX.js.map diff --git a/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/dynamic-hashed-e21b9079.js b/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/dynamic-hashed-e21b9079.js deleted file mode 100644 index 4f1a4393c..000000000 --- a/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/dynamic-hashed-e21b9079.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -console.log('dynamic-hashed'); -//# sourceMappingURL=dynamic-44faaace9dbc-e21b9079.js.map diff --git a/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/dynamic.js.map b/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/dynamic.js.map index 8535c836d..ab709c45c 100644 --- a/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/dynamic.js.map +++ b/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/dynamic.js.map @@ -1 +1 @@ -{"version":3,"file":"dynamic-03a87e17.js","sources":["../../dynamic.js"],"sourcesContent":["console.log('dynamic');\n"],"names":[],"mappings":";;AAAA,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;;"} \ No newline at end of file +{"version":3,"file":"dynamic-Q4C4Dm_h.js","sources":["../../dynamic.js"],"sourcesContent":["console.log('dynamic');\n"],"names":[],"mappings":";;AAAA,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;;"} \ No newline at end of file diff --git a/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/main.js b/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/main.js index ecf6f5b43..98cd0e2c2 100644 --- a/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/main.js +++ b/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/main.js @@ -1,5 +1,5 @@ 'use strict'; -Promise.resolve().then(function () { return require('./dynamic-03a87e17.js'); }); -Promise.resolve().then(function () { return require('./dynamic-hashed-e21b9079.js'); }); +Promise.resolve().then(function () { return require('./dynamic-Q4C4Dm_h.js'); }); +Promise.resolve().then(function () { return require('./dynamic-hashed-DzdWIGlX.js'); }); //# sourceMappingURL=main.js.map diff --git a/test/chunking-form/samples/sourcemap-file-names-function/_expected/es/dynamic-c7ad594d.js b/test/chunking-form/samples/sourcemap-file-names-function/_expected/es/dynamic-APUNg5Yg.js similarity index 100% rename from test/chunking-form/samples/sourcemap-file-names-function/_expected/es/dynamic-c7ad594d.js rename to test/chunking-form/samples/sourcemap-file-names-function/_expected/es/dynamic-APUNg5Yg.js diff --git a/test/chunking-form/samples/sourcemap-file-names-function/_expected/es/dynamic-hashed-4b06902b.js b/test/chunking-form/samples/sourcemap-file-names-function/_expected/es/dynamic-hashed-4b06902b.js deleted file mode 100644 index ca9acfeed..000000000 --- a/test/chunking-form/samples/sourcemap-file-names-function/_expected/es/dynamic-hashed-4b06902b.js +++ /dev/null @@ -1,2 +0,0 @@ -console.log('dynamic-hashed'); -//# sourceMappingURL=dynamic-769057acb768-4b06902b.js.map diff --git a/test/chunking-form/samples/sourcemap-file-names-function/_expected/es/dynamic-hashed-T4V3Rnvr.js b/test/chunking-form/samples/sourcemap-file-names-function/_expected/es/dynamic-hashed-T4V3Rnvr.js new file mode 100644 index 000000000..828ef804b --- /dev/null +++ b/test/chunking-form/samples/sourcemap-file-names-function/_expected/es/dynamic-hashed-T4V3Rnvr.js @@ -0,0 +1,2 @@ +console.log('dynamic-hashed'); +//# sourceMappingURL=dynamic-kETnNCzeTm-o-T4V3Rnvr.js.map diff --git a/test/chunking-form/samples/sourcemap-file-names-function/_expected/es/dynamic-769057acb768-4b06902b.js.map b/test/chunking-form/samples/sourcemap-file-names-function/_expected/es/dynamic-kETnNCzeTm-o-T4V3Rnvr.js.map similarity index 68% rename from test/chunking-form/samples/sourcemap-file-names-function/_expected/es/dynamic-769057acb768-4b06902b.js.map rename to test/chunking-form/samples/sourcemap-file-names-function/_expected/es/dynamic-kETnNCzeTm-o-T4V3Rnvr.js.map index 35d31d3d6..ecea6e844 100644 --- a/test/chunking-form/samples/sourcemap-file-names-function/_expected/es/dynamic-769057acb768-4b06902b.js.map +++ b/test/chunking-form/samples/sourcemap-file-names-function/_expected/es/dynamic-kETnNCzeTm-o-T4V3Rnvr.js.map @@ -1 +1 @@ -{"version":3,"file":"dynamic-hashed-4b06902b.js","sources":["../../dynamic-hashed.js"],"sourcesContent":["console.log('dynamic-hashed');\n"],"names":[],"mappings":"AAAA,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC"} \ No newline at end of file +{"version":3,"file":"dynamic-hashed-T4V3Rnvr.js","sources":["../../dynamic-hashed.js"],"sourcesContent":["console.log('dynamic-hashed');\n"],"names":[],"mappings":"AAAA,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC"} \ No newline at end of file diff --git a/test/chunking-form/samples/sourcemap-file-names-function/_expected/es/dynamic.js.map b/test/chunking-form/samples/sourcemap-file-names-function/_expected/es/dynamic.js.map index 45e7b978c..acee14c03 100644 --- a/test/chunking-form/samples/sourcemap-file-names-function/_expected/es/dynamic.js.map +++ b/test/chunking-form/samples/sourcemap-file-names-function/_expected/es/dynamic.js.map @@ -1 +1 @@ -{"version":3,"file":"dynamic-c7ad594d.js","sources":["../../dynamic.js"],"sourcesContent":["console.log('dynamic');\n"],"names":[],"mappings":"AAAA,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC"} \ No newline at end of file +{"version":3,"file":"dynamic-APUNg5Yg.js","sources":["../../dynamic.js"],"sourcesContent":["console.log('dynamic');\n"],"names":[],"mappings":"AAAA,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC"} \ No newline at end of file diff --git a/test/chunking-form/samples/sourcemap-file-names-function/_expected/es/main.js b/test/chunking-form/samples/sourcemap-file-names-function/_expected/es/main.js index ae85ca097..638c28af5 100644 --- a/test/chunking-form/samples/sourcemap-file-names-function/_expected/es/main.js +++ b/test/chunking-form/samples/sourcemap-file-names-function/_expected/es/main.js @@ -1,3 +1,3 @@ -import('./dynamic-c7ad594d.js'); -import('./dynamic-hashed-4b06902b.js'); +import('./dynamic-APUNg5Yg.js'); +import('./dynamic-hashed-T4V3Rnvr.js'); //# sourceMappingURL=main.js.map diff --git a/test/chunking-form/samples/sourcemap-file-names-function/_expected/system/dynamic-ef271780.js b/test/chunking-form/samples/sourcemap-file-names-function/_expected/system/dynamic-VkfTWHgI.js similarity index 100% rename from test/chunking-form/samples/sourcemap-file-names-function/_expected/system/dynamic-ef271780.js rename to test/chunking-form/samples/sourcemap-file-names-function/_expected/system/dynamic-VkfTWHgI.js diff --git a/test/chunking-form/samples/sourcemap-file-names-function/_expected/system/dynamic-hashed-c0b30ec8.js b/test/chunking-form/samples/sourcemap-file-names-function/_expected/system/dynamic-hashed-BFee68z_.js similarity index 70% rename from test/chunking-form/samples/sourcemap-file-names-function/_expected/system/dynamic-hashed-c0b30ec8.js rename to test/chunking-form/samples/sourcemap-file-names-function/_expected/system/dynamic-hashed-BFee68z_.js index d23349da9..9c648865c 100644 --- a/test/chunking-form/samples/sourcemap-file-names-function/_expected/system/dynamic-hashed-c0b30ec8.js +++ b/test/chunking-form/samples/sourcemap-file-names-function/_expected/system/dynamic-hashed-BFee68z_.js @@ -8,4 +8,4 @@ System.register([], (function () { }) }; })); -//# sourceMappingURL=dynamic-883b8003cd49-c0b30ec8.js.map +//# sourceMappingURL=dynamic-sDZez62fO5oL-BFee68z_.js.map diff --git a/test/chunking-form/samples/sourcemap-file-names-function/_expected/system/dynamic-883b8003cd49-c0b30ec8.js.map b/test/chunking-form/samples/sourcemap-file-names-function/_expected/system/dynamic-sDZez62fO5oL-BFee68z_.js.map similarity index 70% rename from test/chunking-form/samples/sourcemap-file-names-function/_expected/system/dynamic-883b8003cd49-c0b30ec8.js.map rename to test/chunking-form/samples/sourcemap-file-names-function/_expected/system/dynamic-sDZez62fO5oL-BFee68z_.js.map index 4efbf1079..8ff8747d2 100644 --- a/test/chunking-form/samples/sourcemap-file-names-function/_expected/system/dynamic-883b8003cd49-c0b30ec8.js.map +++ b/test/chunking-form/samples/sourcemap-file-names-function/_expected/system/dynamic-sDZez62fO5oL-BFee68z_.js.map @@ -1 +1 @@ -{"version":3,"file":"dynamic-hashed-c0b30ec8.js","sources":["../../dynamic-hashed.js"],"sourcesContent":["console.log('dynamic-hashed');\n"],"names":[],"mappings":";;;;;GAAA,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"dynamic-hashed-BFee68z_.js","sources":["../../dynamic-hashed.js"],"sourcesContent":["console.log('dynamic-hashed');\n"],"names":[],"mappings":";;;;;GAAA,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;;;;;;;;"} \ No newline at end of file diff --git a/test/chunking-form/samples/sourcemap-file-names-function/_expected/system/dynamic.js.map b/test/chunking-form/samples/sourcemap-file-names-function/_expected/system/dynamic.js.map index 49fa5e4dd..47d7fdad4 100644 --- a/test/chunking-form/samples/sourcemap-file-names-function/_expected/system/dynamic.js.map +++ b/test/chunking-form/samples/sourcemap-file-names-function/_expected/system/dynamic.js.map @@ -1 +1 @@ -{"version":3,"file":"dynamic-ef271780.js","sources":["../../dynamic.js"],"sourcesContent":["console.log('dynamic');\n"],"names":[],"mappings":";;;;;GAAA,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"dynamic-VkfTWHgI.js","sources":["../../dynamic.js"],"sourcesContent":["console.log('dynamic');\n"],"names":[],"mappings":";;;;;GAAA,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;;;;;;;;"} \ No newline at end of file diff --git a/test/chunking-form/samples/sourcemap-file-names-function/_expected/system/main.js b/test/chunking-form/samples/sourcemap-file-names-function/_expected/system/main.js index a366b8a53..a200691d6 100644 --- a/test/chunking-form/samples/sourcemap-file-names-function/_expected/system/main.js +++ b/test/chunking-form/samples/sourcemap-file-names-function/_expected/system/main.js @@ -3,8 +3,8 @@ System.register([], (function (exports, module) { return { execute: (function () { - module.import('./dynamic-ef271780.js'); - module.import('./dynamic-hashed-c0b30ec8.js'); + module.import('./dynamic-VkfTWHgI.js'); + module.import('./dynamic-hashed-BFee68z_.js'); }) }; diff --git a/test/chunking-form/samples/sourcemap-file-names/_expected/amd/main-543232e9-amd-af8f17da.js.map b/test/chunking-form/samples/sourcemap-file-names/_expected/amd/main-DrgsaZFk-amd-af4XjAqa.js.map similarity index 64% rename from test/chunking-form/samples/sourcemap-file-names/_expected/amd/main-543232e9-amd-af8f17da.js.map rename to test/chunking-form/samples/sourcemap-file-names/_expected/amd/main-DrgsaZFk-amd-af4XjAqa.js.map index 242d8eda3..c496aa986 100644 --- a/test/chunking-form/samples/sourcemap-file-names/_expected/amd/main-543232e9-amd-af8f17da.js.map +++ b/test/chunking-form/samples/sourcemap-file-names/_expected/amd/main-DrgsaZFk-amd-af4XjAqa.js.map @@ -1 +1 @@ -{"version":3,"file":"main-543232e9-amd.js","sources":["../../main.js"],"sourcesContent":["console.log( 42 );\n"],"names":[],"mappings":";;CAAA,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE;;;;;;"} \ No newline at end of file +{"version":3,"file":"main-DrgsaZFk-amd.js","sources":["../../main.js"],"sourcesContent":["console.log( 42 );\n"],"names":[],"mappings":";;CAAA,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE;;;;;;"} \ No newline at end of file diff --git a/test/chunking-form/samples/sourcemap-file-names/_expected/amd/main-543232e9-amd.js b/test/chunking-form/samples/sourcemap-file-names/_expected/amd/main-DrgsaZFk-amd.js similarity index 53% rename from test/chunking-form/samples/sourcemap-file-names/_expected/amd/main-543232e9-amd.js rename to test/chunking-form/samples/sourcemap-file-names/_expected/amd/main-DrgsaZFk-amd.js index 3970ebf7c..9831abf0e 100644 --- a/test/chunking-form/samples/sourcemap-file-names/_expected/amd/main-543232e9-amd.js +++ b/test/chunking-form/samples/sourcemap-file-names/_expected/amd/main-DrgsaZFk-amd.js @@ -3,4 +3,4 @@ define((function () { 'use strict'; console.log( 42 ); })); -//# sourceMappingURL=main-543232e9-amd-af8f17da.js.map +//# sourceMappingURL=main-DrgsaZFk-amd-af4XjAqa.js.map diff --git a/test/chunking-form/samples/sourcemap-file-names/_expected/cjs/main-3fddaf82-cjs.js b/test/chunking-form/samples/sourcemap-file-names/_expected/cjs/main-3fddaf82-cjs.js deleted file mode 100644 index 98bd52e71..000000000 --- a/test/chunking-form/samples/sourcemap-file-names/_expected/cjs/main-3fddaf82-cjs.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -console.log( 42 ); -//# sourceMappingURL=main-3fddaf82-cjs-c64b742b.js.map diff --git a/test/chunking-form/samples/sourcemap-file-names/_expected/cjs/main-3fddaf82-cjs-c64b742b.js.map b/test/chunking-form/samples/sourcemap-file-names/_expected/cjs/main-R9n-8tvV-cjs-AkG5wfAe.js.map similarity index 63% rename from test/chunking-form/samples/sourcemap-file-names/_expected/cjs/main-3fddaf82-cjs-c64b742b.js.map rename to test/chunking-form/samples/sourcemap-file-names/_expected/cjs/main-R9n-8tvV-cjs-AkG5wfAe.js.map index be5e8ad1c..bdda8609f 100644 --- a/test/chunking-form/samples/sourcemap-file-names/_expected/cjs/main-3fddaf82-cjs-c64b742b.js.map +++ b/test/chunking-form/samples/sourcemap-file-names/_expected/cjs/main-R9n-8tvV-cjs-AkG5wfAe.js.map @@ -1 +1 @@ -{"version":3,"file":"main-3fddaf82-cjs.js","sources":["../../main.js"],"sourcesContent":["console.log( 42 );\n"],"names":[],"mappings":";;AAAA,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE;;"} \ No newline at end of file +{"version":3,"file":"main-R9n-8tvV-cjs.js","sources":["../../main.js"],"sourcesContent":["console.log( 42 );\n"],"names":[],"mappings":";;AAAA,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE;;"} \ No newline at end of file diff --git a/test/chunking-form/samples/sourcemap-file-names/_expected/cjs/main-R9n-8tvV-cjs.js b/test/chunking-form/samples/sourcemap-file-names/_expected/cjs/main-R9n-8tvV-cjs.js new file mode 100644 index 000000000..b28b51293 --- /dev/null +++ b/test/chunking-form/samples/sourcemap-file-names/_expected/cjs/main-R9n-8tvV-cjs.js @@ -0,0 +1,4 @@ +'use strict'; + +console.log( 42 ); +//# sourceMappingURL=main-R9n-8tvV-cjs-AkG5wfAe.js.map diff --git a/test/chunking-form/samples/sourcemap-file-names/_expected/es/main-824894f4-es.js b/test/chunking-form/samples/sourcemap-file-names/_expected/es/main-824894f4-es.js deleted file mode 100644 index 556fd1f82..000000000 --- a/test/chunking-form/samples/sourcemap-file-names/_expected/es/main-824894f4-es.js +++ /dev/null @@ -1,2 +0,0 @@ -console.log( 42 ); -//# sourceMappingURL=main-824894f4-es-dbab040a.js.map diff --git a/test/chunking-form/samples/sourcemap-file-names/_expected/es/main-824894f4-es-dbab040a.js.map b/test/chunking-form/samples/sourcemap-file-names/_expected/es/main-bXxLNi2H-es-8pqe0w5c.js.map similarity index 62% rename from test/chunking-form/samples/sourcemap-file-names/_expected/es/main-824894f4-es-dbab040a.js.map rename to test/chunking-form/samples/sourcemap-file-names/_expected/es/main-bXxLNi2H-es-8pqe0w5c.js.map index 83eea7bfe..bcff8df88 100644 --- a/test/chunking-form/samples/sourcemap-file-names/_expected/es/main-824894f4-es-dbab040a.js.map +++ b/test/chunking-form/samples/sourcemap-file-names/_expected/es/main-bXxLNi2H-es-8pqe0w5c.js.map @@ -1 +1 @@ -{"version":3,"file":"main-824894f4-es.js","sources":["../../main.js"],"sourcesContent":["console.log( 42 );\n"],"names":[],"mappings":"AAAA,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE"} \ No newline at end of file +{"version":3,"file":"main-bXxLNi2H-es.js","sources":["../../main.js"],"sourcesContent":["console.log( 42 );\n"],"names":[],"mappings":"AAAA,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE"} \ No newline at end of file diff --git a/test/chunking-form/samples/sourcemap-file-names/_expected/es/main-bXxLNi2H-es.js b/test/chunking-form/samples/sourcemap-file-names/_expected/es/main-bXxLNi2H-es.js new file mode 100644 index 000000000..c4bdc0c1f --- /dev/null +++ b/test/chunking-form/samples/sourcemap-file-names/_expected/es/main-bXxLNi2H-es.js @@ -0,0 +1,2 @@ +console.log( 42 ); +//# sourceMappingURL=main-bXxLNi2H-es-8pqe0w5c.js.map diff --git a/test/chunking-form/samples/sourcemap-file-names/_expected/system/main-6186746c-system-bce3d2ab.js.map b/test/chunking-form/samples/sourcemap-file-names/_expected/system/main-c5ZQparC-system-mgjP6dBa.js.map similarity index 65% rename from test/chunking-form/samples/sourcemap-file-names/_expected/system/main-6186746c-system-bce3d2ab.js.map rename to test/chunking-form/samples/sourcemap-file-names/_expected/system/main-c5ZQparC-system-mgjP6dBa.js.map index 2d95a47c5..40898211a 100644 --- a/test/chunking-form/samples/sourcemap-file-names/_expected/system/main-6186746c-system-bce3d2ab.js.map +++ b/test/chunking-form/samples/sourcemap-file-names/_expected/system/main-c5ZQparC-system-mgjP6dBa.js.map @@ -1 +1 @@ -{"version":3,"file":"main-6186746c-system.js","sources":["../../main.js"],"sourcesContent":["console.log( 42 );\n"],"names":[],"mappings":";;;;;GAAA,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"main-c5ZQparC-system.js","sources":["../../main.js"],"sourcesContent":["console.log( 42 );\n"],"names":[],"mappings":";;;;;GAAA,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE;;;;;;;;"} \ No newline at end of file diff --git a/test/chunking-form/samples/sourcemap-file-names/_expected/system/main-6186746c-system.js b/test/chunking-form/samples/sourcemap-file-names/_expected/system/main-c5ZQparC-system.js similarity index 68% rename from test/chunking-form/samples/sourcemap-file-names/_expected/system/main-6186746c-system.js rename to test/chunking-form/samples/sourcemap-file-names/_expected/system/main-c5ZQparC-system.js index 6d33eca3a..6635e9df4 100644 --- a/test/chunking-form/samples/sourcemap-file-names/_expected/system/main-6186746c-system.js +++ b/test/chunking-form/samples/sourcemap-file-names/_expected/system/main-c5ZQparC-system.js @@ -8,4 +8,4 @@ System.register([], (function () { }) }; })); -//# sourceMappingURL=main-6186746c-system-bce3d2ab.js.map +//# sourceMappingURL=main-c5ZQparC-system-mgjP6dBa.js.map diff --git a/test/cli/samples/code-splitting-named-default-inputs/_config.js b/test/cli/samples/code-splitting-named-default-inputs/_config.js index 9bb1db99c..b0f7cd0e3 100644 --- a/test/cli/samples/code-splitting-named-default-inputs/_config.js +++ b/test/cli/samples/code-splitting-named-default-inputs/_config.js @@ -8,13 +8,13 @@ module.exports = defineTest({ assert.equal( code, '\n' + - `//→ entry1-10873415.js:\n` + + `//→ entry1-JF9mQsXW.js:\n` + "console.log('main1');\n" + '\n' + - `//→ Entry 2-b2b9d0bf.js:\n` + + `//→ Entry 2-GmuWsq4N.js:\n` + "console.log('main2');\n" + '\n' + - `//→ main3-064cd134.js:\n` + + `//→ main3-RQC0q0DR.js:\n` + "console.log('main3');\n" ); } diff --git a/test/cli/samples/code-splitting-named-inputs/_config.js b/test/cli/samples/code-splitting-named-inputs/_config.js index e22f53d98..575f82ca8 100644 --- a/test/cli/samples/code-splitting-named-inputs/_config.js +++ b/test/cli/samples/code-splitting-named-inputs/_config.js @@ -8,13 +8,13 @@ module.exports = defineTest({ assert.equal( code, '\n' + - `//→ entry1-10873415.js:\n` + + `//→ entry1-JF9mQsXW.js:\n` + "console.log('main1');\n" + '\n' + - `//→ Entry 2-b2b9d0bf.js:\n` + + `//→ Entry 2-GmuWsq4N.js:\n` + "console.log('main2');\n" + '\n' + - `//→ main3-064cd134.js:\n` + + `//→ main3-RQC0q0DR.js:\n` + "console.log('main3');\n" ); } diff --git a/test/cli/samples/stdout-code-splitting/_config.js b/test/cli/samples/stdout-code-splitting/_config.js index 597aa4320..ad1900655 100644 --- a/test/cli/samples/stdout-code-splitting/_config.js +++ b/test/cli/samples/stdout-code-splitting/_config.js @@ -20,7 +20,7 @@ module.exports = defineTest({ `${COLOR}//→ main2.js:${STANDARD}\n` + "console.log('main2');\n" + '\n' + - `${COLOR}//→ assets/asset-185f8db3:${STANDARD}\n` + + `${COLOR}//→ assets/asset-bdGDFXtM:${STANDARD}\n` + 'Hello' ); } diff --git a/test/form/samples/configure-file-url/_expected/amd.js b/test/form/samples/configure-file-url/_expected/amd.js index 5b95fa904..0288c956c 100644 --- a/test/form/samples/configure-file-url/_expected/amd.js +++ b/test/form/samples/configure-file-url/_expected/amd.js @@ -1,10 +1,10 @@ define(['require'], (function (require) { 'use strict'; - var asset1 = 'chunkId=amd.js:moduleId=solved:fileName=assets/asset-solved-230ecafd.txt:format=amd:relativePath=assets/asset-solved-230ecafd.txt:referenceId=6296c678'; + var asset1 = 'chunkId=amd.js:moduleId=solved:fileName=assets/asset-solved-0oyI4hTT.txt:format=amd:relativePath=assets/asset-solved-0oyI4hTT.txt:referenceId=JY$sxHZX'; var asset2 = 'resolved'; - var asset3 = new URL(require.toUrl('./assets/asset-unresolved-f4c1e86c.txt'), document.baseURI).href; + var asset3 = new URL(require.toUrl('./assets/asset-unresolved-e0Iev6TZ.txt'), document.baseURI).href; console.log(asset1, asset2, asset3); diff --git a/test/form/samples/configure-file-url/_expected/assets/asset-resolved-9e0f7ca5.txt b/test/form/samples/configure-file-url/_expected/assets/asset-resolved-7pLh6Sdd.txt similarity index 100% rename from test/form/samples/configure-file-url/_expected/assets/asset-resolved-9e0f7ca5.txt rename to test/form/samples/configure-file-url/_expected/assets/asset-resolved-7pLh6Sdd.txt diff --git a/test/form/samples/configure-file-url/_expected/assets/asset-solved-230ecafd.txt b/test/form/samples/configure-file-url/_expected/assets/asset-solved-0oyI4hTT.txt similarity index 100% rename from test/form/samples/configure-file-url/_expected/assets/asset-solved-230ecafd.txt rename to test/form/samples/configure-file-url/_expected/assets/asset-solved-0oyI4hTT.txt diff --git a/test/form/samples/configure-file-url/_expected/assets/asset-unresolved-f4c1e86c.txt b/test/form/samples/configure-file-url/_expected/assets/asset-unresolved-e0Iev6TZ.txt similarity index 100% rename from test/form/samples/configure-file-url/_expected/assets/asset-unresolved-f4c1e86c.txt rename to test/form/samples/configure-file-url/_expected/assets/asset-unresolved-e0Iev6TZ.txt diff --git a/test/form/samples/configure-file-url/_expected/cjs.js b/test/form/samples/configure-file-url/_expected/cjs.js index cc4b3be30..fdbff28d8 100644 --- a/test/form/samples/configure-file-url/_expected/cjs.js +++ b/test/form/samples/configure-file-url/_expected/cjs.js @@ -1,9 +1,9 @@ 'use strict'; -var asset1 = 'chunkId=cjs.js:moduleId=solved:fileName=assets/asset-solved-230ecafd.txt:format=cjs:relativePath=assets/asset-solved-230ecafd.txt:referenceId=6296c678'; +var asset1 = 'chunkId=cjs.js:moduleId=solved:fileName=assets/asset-solved-0oyI4hTT.txt:format=cjs:relativePath=assets/asset-solved-0oyI4hTT.txt:referenceId=JY$sxHZX'; var asset2 = 'resolved'; -var asset3 = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-unresolved-f4c1e86c.txt').href : new URL('assets/asset-unresolved-f4c1e86c.txt', document.currentScript && document.currentScript.src || document.baseURI).href); +var asset3 = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-unresolved-e0Iev6TZ.txt').href : new URL('assets/asset-unresolved-e0Iev6TZ.txt', document.currentScript && document.currentScript.src || document.baseURI).href); console.log(asset1, asset2, asset3); diff --git a/test/form/samples/configure-file-url/_expected/es.js b/test/form/samples/configure-file-url/_expected/es.js index 89945227e..e79334a1f 100644 --- a/test/form/samples/configure-file-url/_expected/es.js +++ b/test/form/samples/configure-file-url/_expected/es.js @@ -1,7 +1,7 @@ -var asset1 = 'chunkId=es.js:moduleId=solved:fileName=assets/asset-solved-230ecafd.txt:format=es:relativePath=assets/asset-solved-230ecafd.txt:referenceId=6296c678'; +var asset1 = 'chunkId=es.js:moduleId=solved:fileName=assets/asset-solved-0oyI4hTT.txt:format=es:relativePath=assets/asset-solved-0oyI4hTT.txt:referenceId=JY$sxHZX'; var asset2 = 'resolved'; -var asset3 = new URL('assets/asset-unresolved-f4c1e86c.txt', import.meta.url).href; +var asset3 = new URL('assets/asset-unresolved-e0Iev6TZ.txt', import.meta.url).href; console.log(asset1, asset2, asset3); diff --git a/test/form/samples/configure-file-url/_expected/iife.js b/test/form/samples/configure-file-url/_expected/iife.js index 66ea85781..2296c1ed1 100644 --- a/test/form/samples/configure-file-url/_expected/iife.js +++ b/test/form/samples/configure-file-url/_expected/iife.js @@ -1,11 +1,11 @@ (function () { 'use strict'; - var asset1 = 'chunkId=iife.js:moduleId=solved:fileName=assets/asset-solved-230ecafd.txt:format=iife:relativePath=assets/asset-solved-230ecafd.txt:referenceId=6296c678'; + var asset1 = 'chunkId=iife.js:moduleId=solved:fileName=assets/asset-solved-0oyI4hTT.txt:format=iife:relativePath=assets/asset-solved-0oyI4hTT.txt:referenceId=JY$sxHZX'; var asset2 = 'resolved'; - var asset3 = new URL('assets/asset-unresolved-f4c1e86c.txt', document.currentScript && document.currentScript.src || document.baseURI).href; + var asset3 = new URL('assets/asset-unresolved-e0Iev6TZ.txt', document.currentScript && document.currentScript.src || document.baseURI).href; console.log(asset1, asset2, asset3); diff --git a/test/form/samples/configure-file-url/_expected/system.js b/test/form/samples/configure-file-url/_expected/system.js index 83ada681a..83670329d 100644 --- a/test/form/samples/configure-file-url/_expected/system.js +++ b/test/form/samples/configure-file-url/_expected/system.js @@ -3,11 +3,11 @@ System.register([], (function (exports, module) { return { execute: (function () { - var asset1 = 'chunkId=system.js:moduleId=solved:fileName=assets/asset-solved-230ecafd.txt:format=system:relativePath=assets/asset-solved-230ecafd.txt:referenceId=6296c678'; + var asset1 = 'chunkId=system.js:moduleId=solved:fileName=assets/asset-solved-0oyI4hTT.txt:format=system:relativePath=assets/asset-solved-0oyI4hTT.txt:referenceId=JY$sxHZX'; var asset2 = 'resolved'; - var asset3 = new URL('assets/asset-unresolved-f4c1e86c.txt', module.meta.url).href; + var asset3 = new URL('assets/asset-unresolved-e0Iev6TZ.txt', module.meta.url).href; console.log(asset1, asset2, asset3); diff --git a/test/form/samples/configure-file-url/_expected/umd.js b/test/form/samples/configure-file-url/_expected/umd.js index 3c13a1507..081c383ae 100644 --- a/test/form/samples/configure-file-url/_expected/umd.js +++ b/test/form/samples/configure-file-url/_expected/umd.js @@ -3,11 +3,11 @@ factory(); })((function () { 'use strict'; - var asset1 = 'chunkId=umd.js:moduleId=solved:fileName=assets/asset-solved-230ecafd.txt:format=umd:relativePath=assets/asset-solved-230ecafd.txt:referenceId=6296c678'; + var asset1 = 'chunkId=umd.js:moduleId=solved:fileName=assets/asset-solved-0oyI4hTT.txt:format=umd:relativePath=assets/asset-solved-0oyI4hTT.txt:referenceId=JY$sxHZX'; var asset2 = 'resolved'; - var asset3 = (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-unresolved-f4c1e86c.txt').href : new URL('assets/asset-unresolved-f4c1e86c.txt', typeof document === 'undefined' ? location.href : document.currentScript && document.currentScript.src || document.baseURI).href); + var asset3 = (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-unresolved-e0Iev6TZ.txt').href : new URL('assets/asset-unresolved-e0Iev6TZ.txt', typeof document === 'undefined' ? location.href : document.currentScript && document.currentScript.src || document.baseURI).href); console.log(asset1, asset2, asset3); diff --git a/test/form/samples/emit-asset-file/_config.js b/test/form/samples/emit-asset-file/_config.js index 24bca655e..156e7b028 100644 --- a/test/form/samples/emit-asset-file/_config.js +++ b/test/form/samples/emit-asset-file/_config.js @@ -25,9 +25,9 @@ module.exports = defineTest({ generateBundle(options, outputBundle) { const keys = Object.keys(outputBundle); assert.strictEqual(keys.length, 2); - assert.strictEqual(keys[0], 'assets/logo-a2a2cdc4.svg'); + assert.strictEqual(keys[0], 'assets/logo-Mw5Zq12q.svg'); const asset = outputBundle[keys[0]]; - assert.strictEqual(asset.fileName, 'assets/logo-a2a2cdc4.svg'); + assert.strictEqual(asset.fileName, 'assets/logo-Mw5Zq12q.svg'); if (asset.type !== 'asset') { throw new Error(`Unexpected asset type ${asset.type}.`); } diff --git a/test/form/samples/emit-asset-file/_expected/amd.js b/test/form/samples/emit-asset-file/_expected/amd.js index ca2a1bdd5..95e450ea2 100644 --- a/test/form/samples/emit-asset-file/_expected/amd.js +++ b/test/form/samples/emit-asset-file/_expected/amd.js @@ -1,6 +1,6 @@ define(['require'], (function (require) { 'use strict'; - var logo = new URL(require.toUrl('./assets/logo-a2a2cdc4.svg'), document.baseURI).href; + var logo = new URL(require.toUrl('./assets/logo-Mw5Zq12q.svg'), document.baseURI).href; function showImage(url) { console.log(url); diff --git a/test/form/samples/emit-asset-file/_expected/assets/logo-a2a2cdc4.svg b/test/form/samples/emit-asset-file/_expected/assets/logo-Mw5Zq12q.svg similarity index 100% rename from test/form/samples/emit-asset-file/_expected/assets/logo-a2a2cdc4.svg rename to test/form/samples/emit-asset-file/_expected/assets/logo-Mw5Zq12q.svg diff --git a/test/form/samples/emit-asset-file/_expected/cjs.js b/test/form/samples/emit-asset-file/_expected/cjs.js index 2814aa111..f08047311 100644 --- a/test/form/samples/emit-asset-file/_expected/cjs.js +++ b/test/form/samples/emit-asset-file/_expected/cjs.js @@ -1,6 +1,6 @@ 'use strict'; -var logo = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/logo-a2a2cdc4.svg').href : new URL('assets/logo-a2a2cdc4.svg', document.currentScript && document.currentScript.src || document.baseURI).href); +var logo = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/logo-Mw5Zq12q.svg').href : new URL('assets/logo-Mw5Zq12q.svg', document.currentScript && document.currentScript.src || document.baseURI).href); function showImage(url) { console.log(url); diff --git a/test/form/samples/emit-asset-file/_expected/es.js b/test/form/samples/emit-asset-file/_expected/es.js index c29240a6a..3ce6ee622 100644 --- a/test/form/samples/emit-asset-file/_expected/es.js +++ b/test/form/samples/emit-asset-file/_expected/es.js @@ -1,4 +1,4 @@ -var logo = new URL('assets/logo-a2a2cdc4.svg', import.meta.url).href; +var logo = new URL('assets/logo-Mw5Zq12q.svg', import.meta.url).href; function showImage(url) { console.log(url); diff --git a/test/form/samples/emit-asset-file/_expected/iife.js b/test/form/samples/emit-asset-file/_expected/iife.js index f28f46dbc..cb0e0f33f 100644 --- a/test/form/samples/emit-asset-file/_expected/iife.js +++ b/test/form/samples/emit-asset-file/_expected/iife.js @@ -1,7 +1,7 @@ (function () { 'use strict'; - var logo = new URL('assets/logo-a2a2cdc4.svg', document.currentScript && document.currentScript.src || document.baseURI).href; + var logo = new URL('assets/logo-Mw5Zq12q.svg', document.currentScript && document.currentScript.src || document.baseURI).href; function showImage(url) { console.log(url); diff --git a/test/form/samples/emit-asset-file/_expected/system.js b/test/form/samples/emit-asset-file/_expected/system.js index d332088ba..5d2b8c1ee 100644 --- a/test/form/samples/emit-asset-file/_expected/system.js +++ b/test/form/samples/emit-asset-file/_expected/system.js @@ -3,7 +3,7 @@ System.register([], (function (exports, module) { return { execute: (function () { - var logo = new URL('assets/logo-a2a2cdc4.svg', module.meta.url).href; + var logo = new URL('assets/logo-Mw5Zq12q.svg', module.meta.url).href; function showImage(url) { console.log(url); diff --git a/test/form/samples/emit-asset-file/_expected/umd.js b/test/form/samples/emit-asset-file/_expected/umd.js index 0e30ac021..dba160744 100644 --- a/test/form/samples/emit-asset-file/_expected/umd.js +++ b/test/form/samples/emit-asset-file/_expected/umd.js @@ -3,7 +3,7 @@ factory(); })((function () { 'use strict'; - var logo = (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/logo-a2a2cdc4.svg').href : new URL('assets/logo-a2a2cdc4.svg', typeof document === 'undefined' ? location.href : document.currentScript && document.currentScript.src || document.baseURI).href); + var logo = (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/logo-Mw5Zq12q.svg').href : new URL('assets/logo-Mw5Zq12q.svg', typeof document === 'undefined' ? location.href : document.currentScript && document.currentScript.src || document.baseURI).href); function showImage(url) { console.log(url); diff --git a/test/form/samples/emit-file-tree-shaken-access/_expected/assets/logo-a2a2cdc4.svg b/test/form/samples/emit-file-tree-shaken-access/_expected/assets/logo-Mw5Zq12q.svg similarity index 100% rename from test/form/samples/emit-file-tree-shaken-access/_expected/assets/logo-a2a2cdc4.svg rename to test/form/samples/emit-file-tree-shaken-access/_expected/assets/logo-Mw5Zq12q.svg diff --git a/test/form/samples/emit-uint8array-no-buffer/_expected/amd.js b/test/form/samples/emit-uint8array-no-buffer/_expected/amd.js index 4dd0a3d99..9c9e5e8db 100644 --- a/test/form/samples/emit-uint8array-no-buffer/_expected/amd.js +++ b/test/form/samples/emit-uint8array-no-buffer/_expected/amd.js @@ -1,10 +1,10 @@ define(['require'], (function (require) { 'use strict'; - var asset1 = new URL(require.toUrl('./assets/asset-8e3dd2ea'), document.baseURI).href; + var asset1 = new URL(require.toUrl('./assets/asset-tb9uIT4z'), document.baseURI).href; - var asset2 = new URL(require.toUrl('./assets/asset-75590fc1'), document.baseURI).href; + var asset2 = new URL(require.toUrl('./assets/asset-rVqBj9gL'), document.baseURI).href; - var asset99 = new URL(require.toUrl('./assets/asset-60cc5dc9'), document.baseURI).href; + var asset99 = new URL(require.toUrl('./assets/asset-PPyJ5YHr'), document.baseURI).href; console.log(asset1, asset2, asset99); diff --git a/test/form/samples/emit-uint8array-no-buffer/_expected/assets/asset-60cc5dc9 b/test/form/samples/emit-uint8array-no-buffer/_expected/assets/asset-PPyJ5YHr similarity index 100% rename from test/form/samples/emit-uint8array-no-buffer/_expected/assets/asset-60cc5dc9 rename to test/form/samples/emit-uint8array-no-buffer/_expected/assets/asset-PPyJ5YHr diff --git a/test/form/samples/emit-uint8array-no-buffer/_expected/assets/asset-75590fc1 b/test/form/samples/emit-uint8array-no-buffer/_expected/assets/asset-rVqBj9gL similarity index 100% rename from test/form/samples/emit-uint8array-no-buffer/_expected/assets/asset-75590fc1 rename to test/form/samples/emit-uint8array-no-buffer/_expected/assets/asset-rVqBj9gL diff --git a/test/form/samples/emit-uint8array-no-buffer/_expected/assets/asset-8e3dd2ea b/test/form/samples/emit-uint8array-no-buffer/_expected/assets/asset-tb9uIT4z similarity index 100% rename from test/form/samples/emit-uint8array-no-buffer/_expected/assets/asset-8e3dd2ea rename to test/form/samples/emit-uint8array-no-buffer/_expected/assets/asset-tb9uIT4z diff --git a/test/form/samples/emit-uint8array-no-buffer/_expected/cjs.js b/test/form/samples/emit-uint8array-no-buffer/_expected/cjs.js index 6221222f2..72766f772 100644 --- a/test/form/samples/emit-uint8array-no-buffer/_expected/cjs.js +++ b/test/form/samples/emit-uint8array-no-buffer/_expected/cjs.js @@ -1,9 +1,9 @@ 'use strict'; -var asset1 = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-8e3dd2ea').href : new URL('assets/asset-8e3dd2ea', document.currentScript && document.currentScript.src || document.baseURI).href); +var asset1 = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-tb9uIT4z').href : new URL('assets/asset-tb9uIT4z', document.currentScript && document.currentScript.src || document.baseURI).href); -var asset2 = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-75590fc1').href : new URL('assets/asset-75590fc1', document.currentScript && document.currentScript.src || document.baseURI).href); +var asset2 = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-rVqBj9gL').href : new URL('assets/asset-rVqBj9gL', document.currentScript && document.currentScript.src || document.baseURI).href); -var asset99 = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-60cc5dc9').href : new URL('assets/asset-60cc5dc9', document.currentScript && document.currentScript.src || document.baseURI).href); +var asset99 = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-PPyJ5YHr').href : new URL('assets/asset-PPyJ5YHr', document.currentScript && document.currentScript.src || document.baseURI).href); console.log(asset1, asset2, asset99); diff --git a/test/form/samples/emit-uint8array-no-buffer/_expected/es.js b/test/form/samples/emit-uint8array-no-buffer/_expected/es.js index b534c76f8..e8e4da6f6 100644 --- a/test/form/samples/emit-uint8array-no-buffer/_expected/es.js +++ b/test/form/samples/emit-uint8array-no-buffer/_expected/es.js @@ -1,7 +1,7 @@ -var asset1 = new URL('assets/asset-8e3dd2ea', import.meta.url).href; +var asset1 = new URL('assets/asset-tb9uIT4z', import.meta.url).href; -var asset2 = new URL('assets/asset-75590fc1', import.meta.url).href; +var asset2 = new URL('assets/asset-rVqBj9gL', import.meta.url).href; -var asset99 = new URL('assets/asset-60cc5dc9', import.meta.url).href; +var asset99 = new URL('assets/asset-PPyJ5YHr', import.meta.url).href; console.log(asset1, asset2, asset99); diff --git a/test/form/samples/emit-uint8array-no-buffer/_expected/iife.js b/test/form/samples/emit-uint8array-no-buffer/_expected/iife.js index 0f2545ae0..1e53ea6a5 100644 --- a/test/form/samples/emit-uint8array-no-buffer/_expected/iife.js +++ b/test/form/samples/emit-uint8array-no-buffer/_expected/iife.js @@ -1,11 +1,11 @@ (function () { 'use strict'; - var asset1 = new URL('assets/asset-8e3dd2ea', document.currentScript && document.currentScript.src || document.baseURI).href; + var asset1 = new URL('assets/asset-tb9uIT4z', document.currentScript && document.currentScript.src || document.baseURI).href; - var asset2 = new URL('assets/asset-75590fc1', document.currentScript && document.currentScript.src || document.baseURI).href; + var asset2 = new URL('assets/asset-rVqBj9gL', document.currentScript && document.currentScript.src || document.baseURI).href; - var asset99 = new URL('assets/asset-60cc5dc9', document.currentScript && document.currentScript.src || document.baseURI).href; + var asset99 = new URL('assets/asset-PPyJ5YHr', document.currentScript && document.currentScript.src || document.baseURI).href; console.log(asset1, asset2, asset99); diff --git a/test/form/samples/emit-uint8array-no-buffer/_expected/system.js b/test/form/samples/emit-uint8array-no-buffer/_expected/system.js index 6ea30debb..793417e46 100644 --- a/test/form/samples/emit-uint8array-no-buffer/_expected/system.js +++ b/test/form/samples/emit-uint8array-no-buffer/_expected/system.js @@ -3,11 +3,11 @@ System.register([], (function (exports, module) { return { execute: (function () { - var asset1 = new URL('assets/asset-8e3dd2ea', module.meta.url).href; + var asset1 = new URL('assets/asset-tb9uIT4z', module.meta.url).href; - var asset2 = new URL('assets/asset-75590fc1', module.meta.url).href; + var asset2 = new URL('assets/asset-rVqBj9gL', module.meta.url).href; - var asset99 = new URL('assets/asset-60cc5dc9', module.meta.url).href; + var asset99 = new URL('assets/asset-PPyJ5YHr', module.meta.url).href; console.log(asset1, asset2, asset99); diff --git a/test/form/samples/emit-uint8array-no-buffer/_expected/umd.js b/test/form/samples/emit-uint8array-no-buffer/_expected/umd.js index 8f36a10af..3dd9d1d11 100644 --- a/test/form/samples/emit-uint8array-no-buffer/_expected/umd.js +++ b/test/form/samples/emit-uint8array-no-buffer/_expected/umd.js @@ -3,11 +3,11 @@ factory(); })((function () { 'use strict'; - var asset1 = (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-8e3dd2ea').href : new URL('assets/asset-8e3dd2ea', typeof document === 'undefined' ? location.href : document.currentScript && document.currentScript.src || document.baseURI).href); + var asset1 = (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-tb9uIT4z').href : new URL('assets/asset-tb9uIT4z', typeof document === 'undefined' ? location.href : document.currentScript && document.currentScript.src || document.baseURI).href); - var asset2 = (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-75590fc1').href : new URL('assets/asset-75590fc1', typeof document === 'undefined' ? location.href : document.currentScript && document.currentScript.src || document.baseURI).href); + var asset2 = (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-rVqBj9gL').href : new URL('assets/asset-rVqBj9gL', typeof document === 'undefined' ? location.href : document.currentScript && document.currentScript.src || document.baseURI).href); - var asset99 = (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-60cc5dc9').href : new URL('assets/asset-60cc5dc9', typeof document === 'undefined' ? location.href : document.currentScript && document.currentScript.src || document.baseURI).href); + var asset99 = (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-PPyJ5YHr').href : new URL('assets/asset-PPyJ5YHr', typeof document === 'undefined' ? location.href : document.currentScript && document.currentScript.src || document.baseURI).href); console.log(asset1, asset2, asset99); diff --git a/test/function/samples/emit-chunk-hash/_config.js b/test/function/samples/emit-chunk-hash/_config.js index 625408540..0d453c080 100644 --- a/test/function/samples/emit-chunk-hash/_config.js +++ b/test/function/samples/emit-chunk-hash/_config.js @@ -14,7 +14,7 @@ module.exports = defineTest({ referenceId = this.emitFile({ type: 'chunk', id: 'emitted' }); }, generateBundle() { - assert.strictEqual(this.getFileName(referenceId), 'emitted-38bdd9b2.js'); + assert.strictEqual(this.getFileName(referenceId), 'emitted-QRI93uhT.js'); } } ] diff --git a/test/function/samples/emit-chunk-manual-asset-source/_config.js b/test/function/samples/emit-chunk-manual-asset-source/_config.js index 8faf60754..6ce2e054a 100644 --- a/test/function/samples/emit-chunk-manual-asset-source/_config.js +++ b/test/function/samples/emit-chunk-manual-asset-source/_config.js @@ -21,7 +21,7 @@ module.exports = defineTest({ } }, generateBundle() { - assert.strictEqual(this.getFileName(referenceId), 'emitted-f57bfbce.txt'); + assert.strictEqual(this.getFileName(referenceId), 'emitted-umwR9Fta.txt'); } } ] diff --git a/test/function/samples/emit-chunk-manual/_config.js b/test/function/samples/emit-chunk-manual/_config.js index d9d513c58..7b8edc260 100644 --- a/test/function/samples/emit-chunk-manual/_config.js +++ b/test/function/samples/emit-chunk-manual/_config.js @@ -16,7 +16,7 @@ module.exports = defineTest({ } }, generateBundle() { - assert.strictEqual(this.getFileName(referenceId), 'emitted-f57bfbce.txt'); + assert.strictEqual(this.getFileName(referenceId), 'emitted-umwR9Fta.txt'); } } ] diff --git a/test/function/samples/emit-file/asset-source-invalid3/_config.js b/test/function/samples/emit-file/asset-source-invalid3/_config.js index a5a2754f2..b4b14d6d7 100644 --- a/test/function/samples/emit-file/asset-source-invalid3/_config.js +++ b/test/function/samples/emit-file/asset-source-invalid3/_config.js @@ -15,7 +15,7 @@ module.exports = defineTest({ code: 'PLUGIN_ERROR', hook: 'buildStart', message: - 'Could not set source for asset "6b86b273", asset source needs to be a string, Uint8Array or Buffer.', + 'Could not set source for asset "WPGYjwIl", asset source needs to be a string, Uint8Array or Buffer.', plugin: 'test-plugin', pluginCode: 'VALIDATION_ERROR' } diff --git a/test/function/samples/emit-file/asset-source-missing2/_config.js b/test/function/samples/emit-file/asset-source-missing2/_config.js index f4a4f1330..bfda3f628 100644 --- a/test/function/samples/emit-file/asset-source-missing2/_config.js +++ b/test/function/samples/emit-file/asset-source-missing2/_config.js @@ -12,6 +12,6 @@ module.exports = defineTest({ }, generateError: { code: 'ASSET_SOURCE_MISSING', - message: 'Plugin error creating asset "6b86b273" - no asset source set.' + message: 'Plugin error creating asset "WPGYjwIl" - no asset source set.' } }); diff --git a/test/function/samples/emit-file/asset-source-missing4/_config.js b/test/function/samples/emit-file/asset-source-missing4/_config.js index 82200e980..34efe1c65 100644 --- a/test/function/samples/emit-file/asset-source-missing4/_config.js +++ b/test/function/samples/emit-file/asset-source-missing4/_config.js @@ -15,7 +15,7 @@ module.exports = defineTest({ code: 'PLUGIN_ERROR', hook: 'buildStart', message: - 'Plugin error - Unable to get file name for asset "6b86b273". Ensure that the source is set and that generate is called first. If you reference assets via import.meta.ROLLUP_FILE_URL_, you need to either have set their source after "renderStart" or need to provide an explicit "fileName" when emitting them.', + 'Plugin error - Unable to get file name for asset "WPGYjwIl". Ensure that the source is set and that generate is called first. If you reference assets via import.meta.ROLLUP_FILE_URL_, you need to either have set their source after "renderStart" or need to provide an explicit "fileName" when emitting them.', plugin: 'test-plugin', pluginCode: 'ASSET_NOT_FINALISED' } diff --git a/test/function/samples/emit-file/set-asset-source-chunk/_config.js b/test/function/samples/emit-file/set-asset-source-chunk/_config.js index 0ee34ff46..83182333c 100644 --- a/test/function/samples/emit-file/set-asset-source-chunk/_config.js +++ b/test/function/samples/emit-file/set-asset-source-chunk/_config.js @@ -14,7 +14,7 @@ module.exports = defineTest({ error: { code: 'PLUGIN_ERROR', hook: 'buildStart', - message: 'Asset sources can only be set for emitted assets but "6c87f683" is an emitted chunk.', + message: 'Asset sources can only be set for emitted assets but "Vbibt3QL" is an emitted chunk.', plugin: 'test-plugin', pluginCode: 'VALIDATION_ERROR' } diff --git a/test/function/samples/emit-file/set-asset-source-twice2/_config.js b/test/function/samples/emit-file/set-asset-source-twice2/_config.js index 620da4a0c..4a962fcf7 100644 --- a/test/function/samples/emit-file/set-asset-source-twice2/_config.js +++ b/test/function/samples/emit-file/set-asset-source-twice2/_config.js @@ -15,7 +15,7 @@ module.exports = defineTest({ error: { code: 'PLUGIN_ERROR', hook: 'buildEnd', - message: 'Unable to set the source for asset "6b86b273", source already set.', + message: 'Unable to set the source for asset "WPGYjwIl", source already set.', plugin: 'test-plugin', pluginCode: 'ASSET_SOURCE_ALREADY_SET' } diff --git a/test/function/samples/hashing/maximum-hash-size/_config.js b/test/function/samples/hashing/maximum-hash-size/_config.js index fb8159901..1c4d82f79 100644 --- a/test/function/samples/hashing/maximum-hash-size/_config.js +++ b/test/function/samples/hashing/maximum-hash-size/_config.js @@ -1,9 +1,9 @@ module.exports = defineTest({ description: 'throws when the maximum hash size is exceeded', - options: { output: { chunkFileNames: '[hash:65].js' } }, + options: { output: { chunkFileNames: '[hash:23].js' } }, generateError: { code: 'VALIDATION_ERROR', message: - 'Hashes cannot be longer than 64 characters, received 65. Check the "output.chunkFileNames" option.' + 'Hashes cannot be longer than 22 characters, received 23. Check the "output.chunkFileNames" option.' } }); diff --git a/test/hooks/index.js b/test/hooks/index.js index 7c8a4107f..f88f351c2 100644 --- a/test/hooks/index.js +++ b/test/hooks/index.js @@ -173,9 +173,9 @@ describe('hooks', () => { .then(({ output }) => { assert.strictEqual( output[0].code, - `var input = new URL('chunk-f0e7d366.js', import.meta.url).href;\n\nexport { input as default };\n` + `var input = new URL('chunk-6DeDEJ3U.js', import.meta.url).href;\n\nexport { input as default };\n` ); - assert.strictEqual(output[1].fileName, 'chunk-f0e7d366.js'); + assert.strictEqual(output[1].fileName, 'chunk-6DeDEJ3U.js'); assert.strictEqual(output[1].code, `console.log('chunk');\n`); return rollup.rollup({ @@ -198,9 +198,9 @@ describe('hooks', () => { .then(({ output }) => { assert.strictEqual( output[0].code, - `var input = new URL('chunk-f0e7d366.js', import.meta.url).href;\n\nexport { input as default };\n` + `var input = new URL('chunk-6DeDEJ3U.js', import.meta.url).href;\n\nexport { input as default };\n` ); - assert.strictEqual(output[1].fileName, 'chunk-f0e7d366.js'); + assert.strictEqual(output[1].fileName, 'chunk-6DeDEJ3U.js'); assert.strictEqual(output[1].code, `console.log('chunk');\n`); return rollup.rollup({ @@ -220,9 +220,9 @@ describe('hooks', () => { .then(({ output }) => { assert.strictEqual( output[0].code, - `var input = new URL('chunk-f0e7d366.js', import.meta.url).href;\n\nexport { input as default };\n` + `var input = new URL('chunk-6DeDEJ3U.js', import.meta.url).href;\n\nexport { input as default };\n` ); - assert.strictEqual(output[1].fileName, 'chunk-f0e7d366.js'); + assert.strictEqual(output[1].fileName, 'chunk-6DeDEJ3U.js'); assert.strictEqual(output[1].code, `console.log('chunk');\n`); }); }); @@ -280,9 +280,9 @@ describe('hooks', () => { .then(({ output }) => { assert.strictEqual( output[0].code, - `var input = new URL('assets/test-b94d27b9.ext', import.meta.url).href;\n\nexport { input as default };\n` + `var input = new URL('assets/test-x7YVzHWH.ext', import.meta.url).href;\n\nexport { input as default };\n` ); - assert.strictEqual(output[1].fileName, 'assets/test-b94d27b9.ext'); + assert.strictEqual(output[1].fileName, 'assets/test-x7YVzHWH.ext'); assert.strictEqual(output[1].source, 'hello world'); return rollup.rollup({ @@ -305,9 +305,9 @@ describe('hooks', () => { .then(({ output }) => { assert.strictEqual( output[0].code, - `var input = new URL('assets/test-b94d27b9.ext', import.meta.url).href;\n\nexport { input as default };\n` + `var input = new URL('assets/test-x7YVzHWH.ext', import.meta.url).href;\n\nexport { input as default };\n` ); - assert.strictEqual(output[1].fileName, 'assets/test-b94d27b9.ext'); + assert.strictEqual(output[1].fileName, 'assets/test-x7YVzHWH.ext'); assert.strictEqual(output[1].source, 'hello world'); return rollup.rollup({ @@ -327,9 +327,9 @@ describe('hooks', () => { .then(({ output }) => { assert.strictEqual( output[0].code, - `var input = new URL('assets/test-b94d27b9.ext', import.meta.url).href;\n\nexport { input as default };\n` + `var input = new URL('assets/test-x7YVzHWH.ext', import.meta.url).href;\n\nexport { input as default };\n` ); - assert.strictEqual(output[1].fileName, 'assets/test-b94d27b9.ext'); + assert.strictEqual(output[1].fileName, 'assets/test-x7YVzHWH.ext'); assert.strictEqual(output[1].source, 'hello world'); }); }); @@ -375,10 +375,10 @@ describe('hooks', () => { assert.strictEqual( output[0].code, `console.log('imported');\n\n` + - `var input = new URL('assets/test-7d48a582.ext', import.meta.url).href;\n\n` + + `var input = new URL('assets/test--GjEfoLW.ext', import.meta.url).href;\n\n` + `export { input as default };\n` ); - assert.strictEqual(output[1].fileName, 'assets/test-7d48a582.ext'); + assert.strictEqual(output[1].fileName, 'assets/test--GjEfoLW.ext'); assert.strictEqual(output[1].source, 'first run'); return rollup.rollup({ @@ -408,10 +408,10 @@ describe('hooks', () => { assert.strictEqual( output[0].code, `console.log('imported');\n\n` + - `var input = new URL('assets/test-791d43e2.ext', import.meta.url).href;\n\n` + + `var input = new URL('assets/test--NJ9-A8g.ext', import.meta.url).href;\n\n` + `export { input as default };\n` ); - assert.strictEqual(output[1].fileName, 'assets/test-791d43e2.ext'); + assert.strictEqual(output[1].fileName, 'assets/test--NJ9-A8g.ext'); assert.strictEqual(output[1].source, 'second run'); }); }); @@ -446,11 +446,11 @@ describe('hooks', () => { .then(({ output }) => { assert.strictEqual( output[0].code, - `var input = new URL('assets/test-b94d27b9.ext', import.meta.url).href;\n\nexport { input as default };\n` + `var input = new URL('assets/test-x7YVzHWH.ext', import.meta.url).href;\n\nexport { input as default };\n` ); - assert.strictEqual(output[1].fileName, 'assets/test-b94d27b9.ext'); + assert.strictEqual(output[1].fileName, 'assets/test-x7YVzHWH.ext'); assert.strictEqual(output[1].source, 'hello world'); - assert.strictEqual(output[1].fileName, 'assets/test-b94d27b9.ext'); + assert.strictEqual(output[1].fileName, 'assets/test-x7YVzHWH.ext'); assert.strictEqual(output[1].source, 'hello world'); return rollup.rollup({ diff --git a/test/misc/bundle-information.js b/test/misc/bundle-information.js index 1b9ae79ff..a30dfd0a6 100644 --- a/test/misc/bundle-information.js +++ b/test/misc/bundle-information.js @@ -28,14 +28,14 @@ describe('The bundle object', () => { .then(({ output }) => { assert.deepEqual( output.map(chunk => chunk.fileName), - ['input1-fffbf648.js', 'input2-ee435193.js', 'generated-shared-4eca6591.js'], + ['input1-e1JxsyY1.js', 'input2-82mPINil.js', 'generated-shared-8B_aVNG6.js'], 'fileName' ); assert.deepEqual( output.map(chunk => chunk.code), [ - `import { u as used, s as shared } from './generated-shared-4eca6591.js';\n\nconsole.log("input1", used, shared);const out = true;\n\nexport { out };\n`, - `import './generated-shared-4eca6591.js';\n\nconsole.log("input2");var input2 = 42;\n\nexport { input2 as default };\n`, + `import { u as used, s as shared } from './generated-shared-8B_aVNG6.js';\n\nconsole.log("input1", used, shared);const out = true;\n\nexport { out };\n`, + `import './generated-shared-8B_aVNG6.js';\n\nconsole.log("input2");var input2 = 42;\n\nexport { input2 as default };\n`, `console.log("shared");const used = "used"; var shared = "stuff";\n\nexport { shared as s, used as u };\n` ], 'code' @@ -62,14 +62,14 @@ describe('The bundle object', () => { ); assert.deepEqual( output.map(chunk => chunk.imports), - [['generated-shared-4eca6591.js'], ['generated-shared-4eca6591.js'], []], + [['generated-shared-8B_aVNG6.js'], ['generated-shared-8B_aVNG6.js'], []], 'imports' ); assert.deepEqual( output.map(chunk => chunk.importedBindings), [ - { 'generated-shared-4eca6591.js': ['u', 's'] }, - { 'generated-shared-4eca6591.js': [] }, + { 'generated-shared-8B_aVNG6.js': ['u', 's'] }, + { 'generated-shared-8B_aVNG6.js': [] }, {} ], 'importedBindings' diff --git a/test/misc/misc.js b/test/misc/misc.js index 560af20f2..11b22d244 100644 --- a/test/misc/misc.js +++ b/test/misc/misc.js @@ -109,7 +109,7 @@ describe('misc', () => { assert.equal(warnings.length, 0); assert.deepEqual( output.map(({ fileName }) => fileName), - ['main1.js', 'main2.js', 'dep-9394ae8f.js', 'dyndep-d5d54b59.js'] + ['main1.js', 'main2.js', 'dep-OBdYcLqx.js', 'dyndep-t4Fvao3e.js'] ); }); }); diff --git a/wasm/bindings_wasm.d.ts b/wasm/bindings_wasm.d.ts index 07c63eddf..8823988c4 100644 --- a/wasm/bindings_wasm.d.ts +++ b/wasm/bindings_wasm.d.ts @@ -2,9 +2,15 @@ /* eslint-disable */ /** * @param {string} code +* @param {boolean} allow_return_outside_function * @returns {Uint8Array} */ -export function parse(code: string): Uint8Array; +export function parse(code: string, allow_return_outside_function: boolean): Uint8Array; +/** +* @param {Uint8Array} input +* @returns {string} +*/ +export function xxhash_base64_url(input: Uint8Array): string; /** * @param {string} query * @param {any} opts @@ -16,7 +22,8 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl export interface InitOutput { readonly memory: WebAssembly.Memory; - readonly parse: (a: number, b: number, c: number) => void; + readonly parse: (a: number, b: number, c: number, d: number) => void; + readonly xxhash_base64_url: (a: number, b: number) => void; readonly browserslist: (a: number, b: number, c: number, d: number) => void; readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; diff --git a/wasm/bindings_wasm_bg.wasm.d.ts b/wasm/bindings_wasm_bg.wasm.d.ts index 2c81912b7..08c257c79 100644 --- a/wasm/bindings_wasm_bg.wasm.d.ts +++ b/wasm/bindings_wasm_bg.wasm.d.ts @@ -1,7 +1,8 @@ /* tslint:disable */ /* eslint-disable */ export const memory: WebAssembly.Memory; -export function parse(a: number, b: number, c: number): void; +export function parse(a: number, b: number, c: number, d: number): void; +export function xxhash_base64_url(a: number, b: number): void; export function browserslist(a: number, b: number, c: number, d: number): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; From 4e562e52db3f55832de17ce02fabcc05c292861f Mon Sep 17 00:00:00 2001 From: XiaoPi <530257315@qq.com> Date: Mon, 2 Oct 2023 12:42:42 +0800 Subject: [PATCH 11/44] [v4.0] fix: also strip BOM from code strings in JS (#5164) fix: also strip BOM from code strings in JS --- src/Module.ts | 5 +++++ test/function/samples/strip-bom/_config.js | 3 +++ test/function/samples/strip-bom/main.js | 1 + 3 files changed, 9 insertions(+) create mode 100644 test/function/samples/strip-bom/_config.js create mode 100644 test/function/samples/strip-bom/main.js diff --git a/src/Module.ts b/src/Module.ts index df3ac8b15..5ca23568c 100644 --- a/src/Module.ts +++ b/src/Module.ts @@ -798,6 +798,11 @@ export default class Module { resolvedIds?: ResolvedIdMap; transformFiles?: EmittedFile[] | undefined; }): void { + /* eslint-disable-next-line unicorn/number-literal-case */ + if (code.charCodeAt(0) === 0xfe_ff) { + code = code.slice(1); + } + timeStart('generate ast', 3); this.info.code = code; diff --git a/test/function/samples/strip-bom/_config.js b/test/function/samples/strip-bom/_config.js new file mode 100644 index 000000000..9aaa60289 --- /dev/null +++ b/test/function/samples/strip-bom/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'Works correctly with BOM files.' +}); diff --git a/test/function/samples/strip-bom/main.js b/test/function/samples/strip-bom/main.js new file mode 100644 index 000000000..15253645c --- /dev/null +++ b/test/function/samples/strip-bom/main.js @@ -0,0 +1 @@ +export const msg = 'foo'; From bfbea66569491f5466fbba99de2ba6a0225f851b Mon Sep 17 00:00:00 2001 From: XiaoPi <530257315@qq.com> Date: Tue, 3 Oct 2023 12:37:17 +0800 Subject: [PATCH 12/44] [v4.0] feat: preserve shebang in entry module for CJS and ESM outputs (#5163) * feat: preserve shebang in entry module for CJS and ESM outputs * Remove the shebang insertion during cli build * Parse shebang in JS code * Render shebang in chunk.render() --------- Co-authored-by: Lukas Taegert-Atkinson --- build-plugins/add-cli-entry.ts | 9 --------- cli/cli.ts | 1 + rust/parse_ast/src/convert_ast/converter.rs | 7 ++++--- src/Chunk.ts | 4 ++++ src/Graph.ts | 4 ++-- src/Module.ts | 9 +++++++-- src/utils/convert-ast.ts | 11 ++++++----- test/form/samples/hashbang/_config.js | 3 --- .../samples/leading-comments/_expected.js | 1 + test/form/samples/shebang-1/_config.js | 19 +++++++++++++++++++ test/form/samples/shebang-1/_expected/amd.js | 5 +++++ test/form/samples/shebang-1/_expected/cjs.js | 4 ++++ test/form/samples/shebang-1/_expected/es.js | 2 ++ test/form/samples/shebang-1/_expected/iife.js | 6 ++++++ .../samples/shebang-1/_expected/system.js | 10 ++++++++++ test/form/samples/shebang-1/_expected/umd.js | 8 ++++++++ test/form/samples/shebang-1/main.js | 2 ++ test/form/samples/shebang-2/_config.js | 15 +++++++++++++++ test/form/samples/shebang-2/_expected/amd.js | 5 +++++ test/form/samples/shebang-2/_expected/cjs.js | 3 +++ test/form/samples/shebang-2/_expected/es.js | 1 + test/form/samples/shebang-2/_expected/iife.js | 6 ++++++ .../samples/shebang-2/_expected/system.js | 10 ++++++++++ test/form/samples/shebang-2/_expected/umd.js | 8 ++++++++ test/form/samples/shebang-2/dep.js | 2 ++ test/form/samples/shebang-2/main.js | 1 + test/form/samples/shebang-3/_config.js | 3 +++ .../{hashbang => shebang-3}/_expected.js | 1 + .../samples/{hashbang => shebang-3}/main.js | 0 .../samples/{hashbang => shebang-3}/other.js | 0 30 files changed, 136 insertions(+), 24 deletions(-) delete mode 100644 test/form/samples/hashbang/_config.js create mode 100644 test/form/samples/shebang-1/_config.js create mode 100644 test/form/samples/shebang-1/_expected/amd.js create mode 100644 test/form/samples/shebang-1/_expected/cjs.js create mode 100644 test/form/samples/shebang-1/_expected/es.js create mode 100644 test/form/samples/shebang-1/_expected/iife.js create mode 100644 test/form/samples/shebang-1/_expected/system.js create mode 100644 test/form/samples/shebang-1/_expected/umd.js create mode 100644 test/form/samples/shebang-1/main.js create mode 100644 test/form/samples/shebang-2/_config.js create mode 100644 test/form/samples/shebang-2/_expected/amd.js create mode 100644 test/form/samples/shebang-2/_expected/cjs.js create mode 100644 test/form/samples/shebang-2/_expected/es.js create mode 100644 test/form/samples/shebang-2/_expected/iife.js create mode 100644 test/form/samples/shebang-2/_expected/system.js create mode 100644 test/form/samples/shebang-2/_expected/umd.js create mode 100644 test/form/samples/shebang-2/dep.js create mode 100644 test/form/samples/shebang-2/main.js create mode 100644 test/form/samples/shebang-3/_config.js rename test/form/samples/{hashbang => shebang-3}/_expected.js (68%) rename test/form/samples/{hashbang => shebang-3}/main.js (100%) rename test/form/samples/{hashbang => shebang-3}/other.js (100%) diff --git a/build-plugins/add-cli-entry.ts b/build-plugins/add-cli-entry.ts index 81e2931fc..b3b6a207a 100644 --- a/build-plugins/add-cli-entry.ts +++ b/build-plugins/add-cli-entry.ts @@ -1,6 +1,5 @@ import { chmod } from 'node:fs/promises'; import { resolve } from 'node:path'; -import MagicString from 'magic-string'; import type { Plugin } from 'rollup'; const CLI_CHUNK = 'bin/rollup'; @@ -16,14 +15,6 @@ export default function addCliEntry(): Plugin { }); }, name: 'add-cli-entry', - renderChunk(code, chunkInfo) { - if (chunkInfo.fileName === CLI_CHUNK) { - const magicString = new MagicString(code); - magicString.prepend('#!/usr/bin/env node\n\n'); - return { code: magicString.toString(), map: magicString.generateMap({ hires: true }) }; - } - return null; - }, writeBundle({ dir }) { return chmod(resolve(dir!, CLI_CHUNK), '755'); } diff --git a/cli/cli.ts b/cli/cli.ts index d06f13c84..b43cc105a 100644 --- a/cli/cli.ts +++ b/cli/cli.ts @@ -1,3 +1,4 @@ +#!/usr/bin/env node import process from 'node:process'; import help from 'help.md'; import { version } from 'package.json'; diff --git a/rust/parse_ast/src/convert_ast/converter.rs b/rust/parse_ast/src/convert_ast/converter.rs index bd41fa03b..8eaa8a643 100644 --- a/rust/parse_ast/src/convert_ast/converter.rs +++ b/rust/parse_ast/src/convert_ast/converter.rs @@ -28,10 +28,11 @@ use crate::convert_ast::converter::utf16_positions::{ }; mod analyze_code; -pub mod node_types; mod string_constants; mod utf16_positions; +pub mod node_types; + pub struct AstConverter<'a> { buffer: Vec, code: &'a [u8], @@ -194,10 +195,10 @@ impl<'a> AstConverter<'a> { fn convert_program(&mut self, node: &Program) { match node { Program::Module(module) => { - self.store_program(ModuleItemsOrStatements::ModuleItems(&module.body)) + self.store_program(ModuleItemsOrStatements::ModuleItems(&module.body)); } Program::Script(script) => { - self.store_program(ModuleItemsOrStatements::Statements(&script.body)) + self.store_program(ModuleItemsOrStatements::Statements(&script.body)); } } } diff --git a/src/Chunk.ts b/src/Chunk.ts index 93b36968d..116704417 100644 --- a/src/Chunk.ts +++ b/src/Chunk.ts @@ -701,6 +701,10 @@ export default class Chunk { outputOptions ); if (banner) magicString.prepend(banner); + if (format === 'es' || format === 'cjs') { + const shebang = facadeModule !== null && facadeModule.info.isEntry && facadeModule.shebang; + shebang && magicString.prepend(`#!${shebang}\n`); + } if (footer) magicString.append(footer); return { diff --git a/src/Graph.ts b/src/Graph.ts index 408b07965..a532c5227 100644 --- a/src/Graph.ts +++ b/src/Graph.ts @@ -18,7 +18,7 @@ import type { import { PluginDriver } from './utils/PluginDriver'; import Queue from './utils/Queue'; import { BuildPhase } from './utils/buildPhase'; -import { convertProgram } from './utils/convert-ast'; +import { convertProgram, type ProgramAst } from './utils/convert-ast'; import { analyseModuleExecution } from './utils/executionOrder'; import getReadStringFunction from './utils/getReadStringFunction'; import { LOGLEVEL_WARN } from './utils/logging'; @@ -126,7 +126,7 @@ export default class Graph { contextParse( code: string, { allowReturnOutsideFunction = false }: { allowReturnOutsideFunction?: boolean } = {} - ): AstNode { + ): ProgramAst { const astBuffer = parse(code, allowReturnOutsideFunction); const readString = getReadStringFunction(astBuffer); return convertProgram(astBuffer.buffer, readString); diff --git a/src/Module.ts b/src/Module.ts index 5ca23568c..c1488c95e 100644 --- a/src/Module.ts +++ b/src/Module.ts @@ -28,7 +28,6 @@ import NamespaceVariable from './ast/variables/NamespaceVariable'; import SyntheticNamedExportVariable from './ast/variables/SyntheticNamedExportVariable'; import type Variable from './ast/variables/Variable'; import type { - AstNode, CustomPluginOptions, DecodedSourceMapOrMissing, EmittedFile, @@ -48,6 +47,7 @@ import type { } from './rollup/types'; import { EMPTY_OBJECT } from './utils/blank'; import { BuildPhase } from './utils/buildPhase'; +import type { ProgramAst } from './utils/convert-ast'; import { decodedSourcemap, resetSourcemapCache } from './utils/decodedSourcemap'; import { getId } from './utils/getId'; import { getNewSet, getOrCreate } from './utils/getOrCreate'; @@ -217,6 +217,7 @@ export default class Module { readonly importDescriptions = new Map(); readonly importMetas: MetaProperty[] = []; importedFromNotTreeshaken = false; + shebang: undefined | string; readonly importers: string[] = []; readonly includedDynamicImporters: Module[] = []; readonly includedImports = new Set(); @@ -798,6 +799,10 @@ export default class Module { resolvedIds?: ResolvedIdMap; transformFiles?: EmittedFile[] | undefined; }): void { + if (code.startsWith('#!')) { + const shebangEndPosition = code.indexOf('\n'); + this.shebang = code.slice(2, shebangEndPosition); + } /* eslint-disable-next-line unicorn/number-literal-case */ if (code.charCodeAt(0) === 0xfe_ff) { code = code.slice(1); @@ -1321,7 +1326,7 @@ export default class Module { this.exports.set(name, MISSING_EXPORT_SHIM_DESCRIPTION); } - private tryParse(): AstNode { + private tryParse(): ProgramAst { try { return this.graph.contextParse(this.info.code!); } catch (error_: any) { diff --git a/src/utils/convert-ast.ts b/src/utils/convert-ast.ts index a94308f65..5b42b5cd1 100644 --- a/src/utils/convert-ast.ts +++ b/src/utils/convert-ast.ts @@ -5,7 +5,7 @@ import { error } from './logs'; type ReadString = (start: number, length: number) => string; -export const convertProgram = (buffer: ArrayBuffer, readString: ReadString): any => +export const convertProgram = (buffer: ArrayBuffer, readString: ReadString): ProgramAst => convertNode(0, new Uint32Array(buffer), readString); const convertNode = (position: number, buffer: Uint32Array, readString: ReadString): any => { @@ -826,7 +826,7 @@ const nodeConverters: ((position: number, buffer: Uint32Array, readString: ReadS }; }, // index:53; Program - (position, buffer, readString): Program & AstNode => { + (position, buffer, readString): ProgramAst => { const start = buffer[position++]; const end = buffer[position++]; const annotations = convertAnnotationList(buffer[position++], buffer); @@ -1262,6 +1262,7 @@ interface ArrowFunctionExpression extends estree.ArrowFunctionExpression { [ANNOTATION_KEY]?: RollupAnnotation[]; } -interface Program extends estree.Program { - [INVALID_ANNOTATION_KEY]?: RollupAnnotation[]; -} +export type ProgramAst = estree.Program & + AstNode & { + [INVALID_ANNOTATION_KEY]?: RollupAnnotation[]; + }; diff --git a/test/form/samples/hashbang/_config.js b/test/form/samples/hashbang/_config.js deleted file mode 100644 index 36eb1925f..000000000 --- a/test/form/samples/hashbang/_config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = defineTest({ - description: 'supports input files with leading hashbang comment' -}); diff --git a/test/form/samples/leading-comments/_expected.js b/test/form/samples/leading-comments/_expected.js index 9975cfbc8..88ed7dae0 100644 --- a/test/form/samples/leading-comments/_expected.js +++ b/test/form/samples/leading-comments/_expected.js @@ -1,3 +1,4 @@ +#! /usr/bin/env node import 'external'; // comment dep 1/3 diff --git a/test/form/samples/shebang-1/_config.js b/test/form/samples/shebang-1/_config.js new file mode 100644 index 000000000..6f262e6b6 --- /dev/null +++ b/test/form/samples/shebang-1/_config.js @@ -0,0 +1,19 @@ +const assert = require('node:assert'); + +module.exports = defineTest({ + description: 'preserve shebang in entry module for CJS and ESM outputs', + options: { + plugins: [ + { + generateBundle(options, outputBundle) { + const keys = Object.keys(outputBundle); + if (options.format === 'cjs' || options.format === 'es') { + assert.ok(outputBundle[keys[0]].code.startsWith('#!')); + } else { + assert.ok(!outputBundle[keys[0]].code.includes('#!')); + } + } + } + ] + } +}); diff --git a/test/form/samples/shebang-1/_expected/amd.js b/test/form/samples/shebang-1/_expected/amd.js new file mode 100644 index 000000000..b479d3212 --- /dev/null +++ b/test/form/samples/shebang-1/_expected/amd.js @@ -0,0 +1,5 @@ +define((function () { 'use strict'; + + assert.ok('shebang'); + +})); diff --git a/test/form/samples/shebang-1/_expected/cjs.js b/test/form/samples/shebang-1/_expected/cjs.js new file mode 100644 index 000000000..3e516269f --- /dev/null +++ b/test/form/samples/shebang-1/_expected/cjs.js @@ -0,0 +1,4 @@ +#!/usr/bin/env node +'use strict'; + +assert.ok('shebang'); diff --git a/test/form/samples/shebang-1/_expected/es.js b/test/form/samples/shebang-1/_expected/es.js new file mode 100644 index 000000000..26cf235f5 --- /dev/null +++ b/test/form/samples/shebang-1/_expected/es.js @@ -0,0 +1,2 @@ +#!/usr/bin/env node +assert.ok('shebang'); diff --git a/test/form/samples/shebang-1/_expected/iife.js b/test/form/samples/shebang-1/_expected/iife.js new file mode 100644 index 000000000..6a482e486 --- /dev/null +++ b/test/form/samples/shebang-1/_expected/iife.js @@ -0,0 +1,6 @@ +(function () { + 'use strict'; + + assert.ok('shebang'); + +})(); diff --git a/test/form/samples/shebang-1/_expected/system.js b/test/form/samples/shebang-1/_expected/system.js new file mode 100644 index 000000000..4b84c65ac --- /dev/null +++ b/test/form/samples/shebang-1/_expected/system.js @@ -0,0 +1,10 @@ +System.register([], (function () { + 'use strict'; + return { + execute: (function () { + + assert.ok('shebang'); + + }) + }; +})); diff --git a/test/form/samples/shebang-1/_expected/umd.js b/test/form/samples/shebang-1/_expected/umd.js new file mode 100644 index 000000000..ce034fde7 --- /dev/null +++ b/test/form/samples/shebang-1/_expected/umd.js @@ -0,0 +1,8 @@ +(function (factory) { + typeof define === 'function' && define.amd ? define(factory) : + factory(); +})((function () { 'use strict'; + + assert.ok('shebang'); + +})); diff --git a/test/form/samples/shebang-1/main.js b/test/form/samples/shebang-1/main.js new file mode 100644 index 000000000..26cf235f5 --- /dev/null +++ b/test/form/samples/shebang-1/main.js @@ -0,0 +1,2 @@ +#!/usr/bin/env node +assert.ok('shebang'); diff --git a/test/form/samples/shebang-2/_config.js b/test/form/samples/shebang-2/_config.js new file mode 100644 index 000000000..fc6831280 --- /dev/null +++ b/test/form/samples/shebang-2/_config.js @@ -0,0 +1,15 @@ +const assert = require('node:assert'); + +module.exports = defineTest({ + description: 'remove shebang in non-entry module for all format outputs', + options: { + plugins: [ + { + generateBundle(_, outputBundle) { + const keys = Object.keys(outputBundle); + assert.ok(!outputBundle[keys[0]].code.includes('#!')); + } + } + ] + } +}); diff --git a/test/form/samples/shebang-2/_expected/amd.js b/test/form/samples/shebang-2/_expected/amd.js new file mode 100644 index 000000000..b479d3212 --- /dev/null +++ b/test/form/samples/shebang-2/_expected/amd.js @@ -0,0 +1,5 @@ +define((function () { 'use strict'; + + assert.ok('shebang'); + +})); diff --git a/test/form/samples/shebang-2/_expected/cjs.js b/test/form/samples/shebang-2/_expected/cjs.js new file mode 100644 index 000000000..550b528f6 --- /dev/null +++ b/test/form/samples/shebang-2/_expected/cjs.js @@ -0,0 +1,3 @@ +'use strict'; + +assert.ok('shebang'); diff --git a/test/form/samples/shebang-2/_expected/es.js b/test/form/samples/shebang-2/_expected/es.js new file mode 100644 index 000000000..27239e876 --- /dev/null +++ b/test/form/samples/shebang-2/_expected/es.js @@ -0,0 +1 @@ +assert.ok('shebang'); diff --git a/test/form/samples/shebang-2/_expected/iife.js b/test/form/samples/shebang-2/_expected/iife.js new file mode 100644 index 000000000..6a482e486 --- /dev/null +++ b/test/form/samples/shebang-2/_expected/iife.js @@ -0,0 +1,6 @@ +(function () { + 'use strict'; + + assert.ok('shebang'); + +})(); diff --git a/test/form/samples/shebang-2/_expected/system.js b/test/form/samples/shebang-2/_expected/system.js new file mode 100644 index 000000000..4b84c65ac --- /dev/null +++ b/test/form/samples/shebang-2/_expected/system.js @@ -0,0 +1,10 @@ +System.register([], (function () { + 'use strict'; + return { + execute: (function () { + + assert.ok('shebang'); + + }) + }; +})); diff --git a/test/form/samples/shebang-2/_expected/umd.js b/test/form/samples/shebang-2/_expected/umd.js new file mode 100644 index 000000000..ce034fde7 --- /dev/null +++ b/test/form/samples/shebang-2/_expected/umd.js @@ -0,0 +1,8 @@ +(function (factory) { + typeof define === 'function' && define.amd ? define(factory) : + factory(); +})((function () { 'use strict'; + + assert.ok('shebang'); + +})); diff --git a/test/form/samples/shebang-2/dep.js b/test/form/samples/shebang-2/dep.js new file mode 100644 index 000000000..26cf235f5 --- /dev/null +++ b/test/form/samples/shebang-2/dep.js @@ -0,0 +1,2 @@ +#!/usr/bin/env node +assert.ok('shebang'); diff --git a/test/form/samples/shebang-2/main.js b/test/form/samples/shebang-2/main.js new file mode 100644 index 000000000..d6cf3b024 --- /dev/null +++ b/test/form/samples/shebang-2/main.js @@ -0,0 +1 @@ +import './dep.js'; diff --git a/test/form/samples/shebang-3/_config.js b/test/form/samples/shebang-3/_config.js new file mode 100644 index 000000000..bf37319da --- /dev/null +++ b/test/form/samples/shebang-3/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'supports input files with leading shebang comment' +}); diff --git a/test/form/samples/hashbang/_expected.js b/test/form/samples/shebang-3/_expected.js similarity index 68% rename from test/form/samples/hashbang/_expected.js rename to test/form/samples/shebang-3/_expected.js index 180a2a592..2dcbbb30d 100644 --- a/test/form/samples/hashbang/_expected.js +++ b/test/form/samples/shebang-3/_expected.js @@ -1,3 +1,4 @@ +#!/usr/bin/env node console.log('other'); console.log('main'); diff --git a/test/form/samples/hashbang/main.js b/test/form/samples/shebang-3/main.js similarity index 100% rename from test/form/samples/hashbang/main.js rename to test/form/samples/shebang-3/main.js diff --git a/test/form/samples/hashbang/other.js b/test/form/samples/shebang-3/other.js similarity index 100% rename from test/form/samples/hashbang/other.js rename to test/form/samples/shebang-3/other.js From dd709c3fab369232c7c08089162981e1a44bdd60 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Tue, 3 Oct 2023 06:37:35 +0200 Subject: [PATCH 13/44] [v4.0] warn for invalid annotations (#5165) * Remove annotations for partially removed declarations * Warn for invalid annotations --- browser/package.json | 2 +- docs/configuration-options/index.md | 10 ++- package-lock.json | 4 +- package.json | 2 +- src/ast/nodes/VariableDeclaration.ts | 1 + src/ast/nodes/shared/Node.ts | 16 ++++- src/utils/convert-ast.ts | 2 +- src/utils/logs.ts | 17 ++++- src/utils/urls.ts | 2 + .../samples/nested-pure-comments/_config.js | 3 +- .../_config.js | 3 +- .../pure-comment-line-break/_config.js | 3 +- .../pure-comment-scenarios-complex/_config.js | 3 +- .../pure-comment-scenarios-simple/_config.js | 3 +- .../samples/pure-comments-disabled/_config.js | 3 +- .../remove-invalid-pure-comments/_config.js | 3 +- .../_config.js | 4 ++ .../_expected.js | 5 ++ .../remove-no-side-effects-variable/main.js | 9 +++ .../_config.js | 3 +- .../warn-misplaced-annotations/_config.js | 63 +++++++++++++++++++ .../warn-misplaced-annotations/main.js | 4 ++ 22 files changed, 149 insertions(+), 16 deletions(-) create mode 100644 test/form/samples/remove-no-side-effects-variable/_config.js create mode 100644 test/form/samples/remove-no-side-effects-variable/_expected.js create mode 100644 test/form/samples/remove-no-side-effects-variable/main.js create mode 100644 test/function/samples/warn-misplaced-annotations/_config.js create mode 100644 test/function/samples/warn-misplaced-annotations/main.js diff --git a/browser/package.json b/browser/package.json index 1e66f1b45..7de0b3359 100644 --- a/browser/package.json +++ b/browser/package.json @@ -1,6 +1,6 @@ { "name": "@rollup/browser", - "version": "4.0.0-23", + "version": "4.0.0-24", "description": "Next-generation ES module bundler browser build", "main": "dist/rollup.browser.js", "module": "dist/es/rollup.browser.js", diff --git a/docs/configuration-options/index.md b/docs/configuration-options/index.md index d41549fd5..ec73cac2a 100755 --- a/docs/configuration-options/index.md +++ b/docs/configuration-options/index.md @@ -2082,9 +2082,13 @@ class Impure { } } -/*@__PURE__*/ new Impure(); +/*@__PURE__ There may be additional text in the comment */ new Impure(); ``` +Such an annotation is considered _valid_ if it directly precedes a function call or constructor invocation and is only separated from the callee by white-space or comments. The only exception are parentheses that wrap a call or invocation. + +Invalid annotations are removed and Rollup emits a warning. Valid annotations remain in the code unless their function call or constructor invocation is removed as well. + ##### `@__NO_SIDE_EFFECTS__` Comments containing `@__NO_SIDE_EFFECTS__` or `#__NO_SIDE_EFFECTS__` mark a function declaration itself as side effect free. When a function has been marked as having no side effects, all calls to that function will be considered to be side effect free. The following code will be completely tree-shaken unless this option is set to `false`, in which case it will remain unchanged. @@ -2104,6 +2108,10 @@ impure(); // <-- call will be considered as side effect free impureArrowFn(); // <-- call will be considered as side effect free ``` +Such an annotation is considered _valid_ if it directly precedes a function declaration or a constant variable declaration where the first declared variable is a function and is only separated from the declaration by white-space or comments. + +Invalid annotations are removed and Rollup emits a warning. Valid annotations remain in the code unless their declaration is removed as well + #### treeshake.correctVarValueBeforeDeclaration | | | diff --git a/package-lock.json b/package-lock.json index 08a4c95b6..770e716db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rollup", - "version": "4.0.0-23", + "version": "4.0.0-24", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rollup", - "version": "4.0.0-23", + "version": "4.0.0-24", "license": "MIT", "bin": { "rollup": "dist/bin/rollup" diff --git a/package.json b/package.json index 2906e1120..088393505 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rollup", - "version": "4.0.0-23", + "version": "4.0.0-24", "description": "Next-generation ES module bundler", "main": "dist/rollup.js", "module": "dist/es/rollup.js", diff --git a/src/ast/nodes/VariableDeclaration.ts b/src/ast/nodes/VariableDeclaration.ts index f6846527d..8898d8aff 100644 --- a/src/ast/nodes/VariableDeclaration.ts +++ b/src/ast/nodes/VariableDeclaration.ts @@ -179,6 +179,7 @@ export default class VariableDeclaration extends NodeBase { for (const { node, start, separator, contentEnd, end } of separatedNodes) { if (!node.included) { code.remove(start, end); + node.removeAnnotations(code); continue; } node.render(code, options); diff --git a/src/ast/nodes/shared/Node.ts b/src/ast/nodes/shared/Node.ts index 47ca814dc..4b3b58315 100644 --- a/src/ast/nodes/shared/Node.ts +++ b/src/ast/nodes/shared/Node.ts @@ -4,6 +4,8 @@ import type { AstContext } from '../../../Module'; import type { AstNode, NormalizedTreeshakingOptions } from '../../../rollup/types'; import type { RollupAnnotation } from '../../../utils/convert-ast'; import { ANNOTATION_KEY, INVALID_ANNOTATION_KEY } from '../../../utils/convert-ast'; +import { LOGLEVEL_WARN } from '../../../utils/logging'; +import { logInvalidAnnotation } from '../../../utils/logs'; import type { NodeRenderOptions, RenderOptions } from '../../../utils/renderHelpers'; import type { DeoptimizableEntity } from '../../DeoptimizableEntity'; import type { Entity } from '../../Entity'; @@ -273,8 +275,20 @@ export class NodeBase extends ExpressionEntity implements ExpressionNode { this.annotationPure = annotations.some(comment => comment.type === 'pure'); } } else if (key === INVALID_ANNOTATION_KEY) { - for (const { start, end } of value as RollupAnnotation[]) + for (const { start, end, type } of value as RollupAnnotation[]) { this.context.magicString.remove(start, end); + if (type === 'pure' || type === 'noSideEffects') { + this.context.log( + LOGLEVEL_WARN, + logInvalidAnnotation( + this.context.code.slice(start, end), + this.context.module.id, + type + ), + start + ); + } + } } } else if (typeof value !== 'object' || value === null) { (this as GenericEsTreeNode)[key] = value; diff --git a/src/utils/convert-ast.ts b/src/utils/convert-ast.ts index 5b42b5cd1..eb33b6760 100644 --- a/src/utils/convert-ast.ts +++ b/src/utils/convert-ast.ts @@ -1234,7 +1234,7 @@ interface ImportExpression extends estree.ImportExpression { export const ANNOTATION_KEY = '_rollupAnnotations'; export const INVALID_ANNOTATION_KEY = '_rollupRemoved'; -type AnnotationType = 'pure' | 'noSideEffects'; +export type AnnotationType = 'pure' | 'noSideEffects'; export interface RollupAnnotation { start: number; diff --git a/src/utils/logs.ts b/src/utils/logs.ts index 57922cf54..27dd4892b 100644 --- a/src/utils/logs.ts +++ b/src/utils/logs.ts @@ -6,6 +6,7 @@ import type { NormalizedInputOptions, RollupLog } from '../rollup/types'; +import type { AnnotationType } from './convert-ast'; import getCodeFrame from './getCodeFrame'; import { LOGLEVEL_WARN } from './logging'; import { extname } from './path'; @@ -26,7 +27,9 @@ import { URL_OUTPUT_NAME, URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT, URL_THIS_IS_UNDEFINED, - URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY + URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY, + URL_TREESHAKE_NOSIDEEFFECTS, + URL_TREESHAKE_PURE } from './urls'; export function error(base: Error | RollupLog): never { @@ -97,6 +100,7 @@ const ADDON_ERROR = 'ADDON_ERROR', ILLEGAL_IDENTIFIER_AS_NAME = 'ILLEGAL_IDENTIFIER_AS_NAME', ILLEGAL_REASSIGNMENT = 'ILLEGAL_REASSIGNMENT', INCONSISTENT_IMPORT_ATTRIBUTES = 'INCONSISTENT_IMPORT_ATTRIBUTES', + INVALID_ANNOTATION = 'INVALID_ANNOTATION', INPUT_HOOK_IN_OUTPUT_PLUGIN = 'INPUT_HOOK_IN_OUTPUT_PLUGIN', INVALID_CHUNK = 'INVALID_CHUNK', INVALID_CONFIG_MODULE_FORMAT = 'INVALID_CONFIG_MODULE_FORMAT', @@ -423,6 +427,17 @@ const formatAttributes = (attributes: Record): string => { return entries.map(([key, value]) => `"${key}": "${value}"`).join(', '); }; +export function logInvalidAnnotation(comment: string, id: string, type: AnnotationType): RollupLog { + return { + code: INVALID_ANNOTATION, + id, + message: `A comment\n\n"${comment}"\n\nin "${relativeId( + id + )}" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment will be removed to avoid issues.`, + url: getRollupUrl(type === 'noSideEffects' ? URL_TREESHAKE_NOSIDEEFFECTS : URL_TREESHAKE_PURE) + }; +} + export function logInputHookInOutputPlugin(pluginName: string, hookName: string): RollupLog { return { code: INPUT_HOOK_IN_OUTPUT_PLUGIN, diff --git a/src/utils/urls.ts b/src/utils/urls.ts index 8546606ee..75ad400be 100644 --- a/src/utils/urls.ts +++ b/src/utils/urls.ts @@ -30,6 +30,8 @@ export const URL_OUTPUT_SOURCEMAPBASEURL = 'configuration-options/#output-source export const URL_OUTPUT_SOURCEMAPFILE = 'configuration-options/#output-sourcemapfile'; export const URL_PRESERVEENTRYSIGNATURES = 'configuration-options/#preserveentrysignatures'; export const URL_TREESHAKE = 'configuration-options/#treeshake'; +export const URL_TREESHAKE_PURE = 'configuration-options/#pure'; +export const URL_TREESHAKE_NOSIDEEFFECTS = 'configuration-options/#no-side-effects'; export const URL_TREESHAKE_MODULESIDEEFFECTS = 'configuration-options/#treeshake-modulesideeffects'; export const URL_WATCH = 'configuration-options/#watch'; diff --git a/test/form/samples/nested-pure-comments/_config.js b/test/form/samples/nested-pure-comments/_config.js index 0891a42f0..8f300142c 100644 --- a/test/form/samples/nested-pure-comments/_config.js +++ b/test/form/samples/nested-pure-comments/_config.js @@ -1,3 +1,4 @@ module.exports = defineTest({ - description: 'correctly associates pure comments before sequence expressions etc.' + description: 'correctly associates pure comments before sequence expressions etc.', + expectedWarnings: ['INVALID_ANNOTATION'] }); diff --git a/test/form/samples/no-side-effects-function-declaration-preserve/_config.js b/test/form/samples/no-side-effects-function-declaration-preserve/_config.js index 098620f28..7878d064a 100644 --- a/test/form/samples/no-side-effects-function-declaration-preserve/_config.js +++ b/test/form/samples/no-side-effects-function-declaration-preserve/_config.js @@ -1,3 +1,4 @@ module.exports = defineTest({ - description: 'preserve __NO_SIDE_EFFECTS__ annotations for function declarations' + description: 'preserve __NO_SIDE_EFFECTS__ annotations for function declarations', + expectedWarnings: ['INVALID_ANNOTATION'] }); diff --git a/test/form/samples/pure-comment-line-break/_config.js b/test/form/samples/pure-comment-line-break/_config.js index 7e663b33f..fc087cdd4 100644 --- a/test/form/samples/pure-comment-line-break/_config.js +++ b/test/form/samples/pure-comment-line-break/_config.js @@ -1,3 +1,4 @@ module.exports = defineTest({ - description: 'adjust line-break handling when dealing with pure annotations' + description: 'adjust line-break handling when dealing with pure annotations', + expectedWarnings: ['INVALID_ANNOTATION'] }); diff --git a/test/form/samples/pure-comment-scenarios-complex/_config.js b/test/form/samples/pure-comment-scenarios-complex/_config.js index 9d7bbd86f..c3f85cff1 100644 --- a/test/form/samples/pure-comment-scenarios-complex/_config.js +++ b/test/form/samples/pure-comment-scenarios-complex/_config.js @@ -1,5 +1,6 @@ // tests compiled from https://github.com/mishoo/UglifyJS2/blob/bcebacbb9e7ddac7d9c0e4ca2c7e0faf0e0bca7c/test/compress/issue-1261.js module.exports = defineTest({ - description: 'correctly handles various advanced pure comment scenarios' + description: 'correctly handles various advanced pure comment scenarios', + expectedWarnings: ['INVALID_ANNOTATION'] }); diff --git a/test/form/samples/pure-comment-scenarios-simple/_config.js b/test/form/samples/pure-comment-scenarios-simple/_config.js index 910ed3946..9bf852418 100644 --- a/test/form/samples/pure-comment-scenarios-simple/_config.js +++ b/test/form/samples/pure-comment-scenarios-simple/_config.js @@ -1,5 +1,6 @@ // tests compiled from https://github.com/mishoo/UglifyJS2/blob/88c8f4e363e0d585b33ea29df560243d3dc74ce1/test/compress/pure_funcs.js module.exports = defineTest({ - description: 'correctly handles various pure comment scenarios' + description: 'correctly handles various pure comment scenarios', + expectedWarnings: ['INVALID_ANNOTATION'] }); diff --git a/test/form/samples/pure-comments-disabled/_config.js b/test/form/samples/pure-comments-disabled/_config.js index ab9f76495..6964d13f7 100644 --- a/test/form/samples/pure-comments-disabled/_config.js +++ b/test/form/samples/pure-comments-disabled/_config.js @@ -4,5 +4,6 @@ module.exports = defineTest({ treeshake: { annotations: false } - } + }, + expectedWarnings: ['INVALID_ANNOTATION'] }); diff --git a/test/form/samples/remove-invalid-pure-comments/_config.js b/test/form/samples/remove-invalid-pure-comments/_config.js index a05717b05..4e959ed7e 100644 --- a/test/form/samples/remove-invalid-pure-comments/_config.js +++ b/test/form/samples/remove-invalid-pure-comments/_config.js @@ -1,3 +1,4 @@ module.exports = defineTest({ - description: 'removes invalidly placed pure annotations' + description: 'removes invalidly placed pure annotations', + expectedWarnings: ['INVALID_ANNOTATION'] }); diff --git a/test/form/samples/remove-no-side-effects-variable/_config.js b/test/form/samples/remove-no-side-effects-variable/_config.js new file mode 100644 index 000000000..48a324a37 --- /dev/null +++ b/test/form/samples/remove-no-side-effects-variable/_config.js @@ -0,0 +1,4 @@ +module.exports = defineTest({ + description: + 'removes __NO_SIDE_EFFECTS__ annotation if the variable declaration is only removed partially' +}); diff --git a/test/form/samples/remove-no-side-effects-variable/_expected.js b/test/form/samples/remove-no-side-effects-variable/_expected.js new file mode 100644 index 000000000..7203af1c1 --- /dev/null +++ b/test/form/samples/remove-no-side-effects-variable/_expected.js @@ -0,0 +1,5 @@ +const bar = () => console.log(); + +// should be retained, but the annotation needs to be removed, otherwise it +// will appear to be side effect free for downstream consumers. +bar(); diff --git a/test/form/samples/remove-no-side-effects-variable/main.js b/test/form/samples/remove-no-side-effects-variable/main.js new file mode 100644 index 000000000..d6cccd381 --- /dev/null +++ b/test/form/samples/remove-no-side-effects-variable/main.js @@ -0,0 +1,9 @@ +/*@__NO_SIDE_EFFECTS__*/ +const foo = () => console.log(), bar = () => console.log(); + +// should be removed +foo(); + +// should be retained, but the annotation needs to be removed, otherwise it +// will appear to be side effect free for downstream consumers. +bar(); diff --git a/test/form/samples/remove-tree-shaken-pure-comments/_config.js b/test/form/samples/remove-tree-shaken-pure-comments/_config.js index 64d1ca3fb..64ffd0ec6 100644 --- a/test/form/samples/remove-tree-shaken-pure-comments/_config.js +++ b/test/form/samples/remove-tree-shaken-pure-comments/_config.js @@ -1,3 +1,4 @@ module.exports = defineTest({ - description: 'removes pure comments of tree-shaken nodes' + description: 'removes pure comments of tree-shaken nodes', + expectedWarnings: ['INVALID_ANNOTATION'] }); diff --git a/test/function/samples/warn-misplaced-annotations/_config.js b/test/function/samples/warn-misplaced-annotations/_config.js new file mode 100644 index 000000000..8a84d70a3 --- /dev/null +++ b/test/function/samples/warn-misplaced-annotations/_config.js @@ -0,0 +1,63 @@ +const { join } = require('node:path'); +const ID_MAIN = join(__dirname, 'main.js'); + +module.exports = defineTest({ + description: 'warns for misplaced annotations', + warnings: [ + { + code: 'INVALID_ANNOTATION', + id: ID_MAIN, + message: + 'A comment\n\n"/*@__NO_SIDE_EFFECTS__*/"\n\nin "main.js" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment will be removed to avoid issues.', + url: 'https://rollupjs.org/configuration-options/#no-side-effects', + pos: 45, + loc: { + column: 0, + file: ID_MAIN, + line: 2 + }, + frame: ` + 1: /*@__PURE__*/ const x = () => console.log(); + 2: /*@__NO_SIDE_EFFECTS__*/ const foo = 1, + ^ + 3: bar = () => console.log(); + 4: /*@__NO_SIDE_EFFECTS__*/ assert.ok(true);` + }, + { + code: 'INVALID_ANNOTATION', + id: ID_MAIN, + message: + 'A comment\n\n"/*@__NO_SIDE_EFFECTS__*/"\n\nin "main.js" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment will be removed to avoid issues.', + url: 'https://rollupjs.org/configuration-options/#no-side-effects', + pos: 113, + loc: { + column: 0, + file: ID_MAIN, + line: 4 + }, + frame: ` + 2: /*@__NO_SIDE_EFFECTS__*/ const foo = 1, + 3: bar = () => console.log(); + 4: /*@__NO_SIDE_EFFECTS__*/ assert.ok(true); + ^` + }, + { + code: 'INVALID_ANNOTATION', + id: ID_MAIN, + message: + 'A comment\n\n"/*@__PURE__*/"\n\nin "main.js" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment will be removed to avoid issues.', + url: 'https://rollupjs.org/configuration-options/#pure', + pos: 0, + loc: { + column: 0, + file: ID_MAIN, + line: 1 + }, + frame: ` + 1: /*@__PURE__*/ const x = () => console.log(); + ^ + 2: /*@__NO_SIDE_EFFECTS__*/ const foo = 1, + 3: bar = () => console.log();` + } + ] +}); diff --git a/test/function/samples/warn-misplaced-annotations/main.js b/test/function/samples/warn-misplaced-annotations/main.js new file mode 100644 index 000000000..6ca367d28 --- /dev/null +++ b/test/function/samples/warn-misplaced-annotations/main.js @@ -0,0 +1,4 @@ +/*@__PURE__*/ const x = () => console.log(); +/*@__NO_SIDE_EFFECTS__*/ const foo = 1, + bar = () => console.log(); +/*@__NO_SIDE_EFFECTS__*/ assert.ok(true); From cade24fbf3390a31734301a1f803b24e34b6cedd Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Thu, 5 Oct 2023 12:33:51 +0200 Subject: [PATCH 14/44] [v4.0] Ensure we support new import attribute "with" syntax (#5168) * Update dependencies * Use new import attribute syntax in test files --- package-lock.json | 158 +- package.json | 24 +- rust/Cargo.lock | 471 +-- rust/bindings_napi/Cargo.toml | 4 +- rust/parse_ast/Cargo.toml | 18 +- .../removes-dynamic-assertions/main.js | 12 +- .../removes-static-attributes/main.js | 10 +- .../attribute-shapes/main.js | 4 +- .../keep-dynamic-assertions/_config.js | 28 + .../keep-dynamic-assertions/_expected/amd.js | 27 + .../keep-dynamic-assertions/_expected/cjs.js | 8 + .../keep-dynamic-assertions/_expected/es.js | 6 + .../keep-dynamic-assertions/_expected/iife.js | 11 + .../_expected/system.js | 15 + .../keep-dynamic-assertions/_expected/umd.js | 13 + .../keep-dynamic-assertions/main.js | 6 + .../keep-dynamic-attributes/_expected/es.js | 4 +- .../keep-dynamic-attributes/main.js | 12 +- .../keeps-static-assertions/_config.js | 11 + .../keeps-static-assertions/_expected/amd.js | 35 + .../keeps-static-assertions/_expected/cjs.js | 39 + .../keeps-static-assertions/_expected/es.js | 7 + .../keeps-static-assertions/_expected/iife.js | 38 + .../_expected/system.js | 28 + .../keeps-static-assertions/_expected/umd.js | 39 + .../keeps-static-assertions/main.js | 9 + .../keeps-static-attributes/main.js | 10 +- .../main.js | 4 +- .../plugin-attributes-resolveid/main.js | 10 +- .../removes-dynamic-attributes/main.js | 12 +- .../removes-static-attributes/main.js | 10 +- .../samples/supports-core-js/_expected.js | 3106 +++++++++-------- .../externalImportAssertions/main.js | 12 +- .../warn-assertion-conflicts/_config.js | 18 +- .../warn-assertion-conflicts/main.js | 8 +- .../warn-assertion-conflicts/other.js | 4 +- 36 files changed, 2312 insertions(+), 1919 deletions(-) create mode 100644 test/form/samples/import-attributes/keep-dynamic-assertions/_config.js create mode 100644 test/form/samples/import-attributes/keep-dynamic-assertions/_expected/amd.js create mode 100644 test/form/samples/import-attributes/keep-dynamic-assertions/_expected/cjs.js create mode 100644 test/form/samples/import-attributes/keep-dynamic-assertions/_expected/es.js create mode 100644 test/form/samples/import-attributes/keep-dynamic-assertions/_expected/iife.js create mode 100644 test/form/samples/import-attributes/keep-dynamic-assertions/_expected/system.js create mode 100644 test/form/samples/import-attributes/keep-dynamic-assertions/_expected/umd.js create mode 100644 test/form/samples/import-attributes/keep-dynamic-assertions/main.js create mode 100644 test/form/samples/import-attributes/keeps-static-assertions/_config.js create mode 100644 test/form/samples/import-attributes/keeps-static-assertions/_expected/amd.js create mode 100644 test/form/samples/import-attributes/keeps-static-assertions/_expected/cjs.js create mode 100644 test/form/samples/import-attributes/keeps-static-assertions/_expected/es.js create mode 100644 test/form/samples/import-attributes/keeps-static-assertions/_expected/iife.js create mode 100644 test/form/samples/import-attributes/keeps-static-assertions/_expected/system.js create mode 100644 test/form/samples/import-attributes/keeps-static-assertions/_expected/umd.js create mode 100644 test/form/samples/import-attributes/keeps-static-assertions/main.js diff --git a/package-lock.json b/package-lock.json index 770e716db..8a68e5b1f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,15 +12,15 @@ "rollup": "dist/bin/rollup" }, "devDependencies": { - "@codemirror/commands": "^6.2.5", + "@codemirror/commands": "^6.3.0", "@codemirror/lang-javascript": "^6.2.1", "@codemirror/language": "^6.9.1", "@codemirror/search": "^6.5.4", "@codemirror/state": "^6.2.1", - "@codemirror/view": "^6.20.2", + "@codemirror/view": "^6.21.2", "@jridgewell/sourcemap-codec": "^1.4.15", "@mermaid-js/mermaid-cli": "^10.4.0", - "@napi-rs/cli": "^2.16.2", + "@napi-rs/cli": "^2.16.3", "@rollup/plugin-alias": "^5.0.0", "@rollup/plugin-buble": "^1.0.2", "@rollup/plugin-commonjs": "^25.0.4", @@ -28,14 +28,14 @@ "@rollup/plugin-node-resolve": "^15.2.1", "@rollup/plugin-replace": "^5.0.2", "@rollup/plugin-terser": "^0.4.3", - "@rollup/plugin-typescript": "11.1.2", + "@rollup/plugin-typescript": "11.1.4", "@rollup/pluginutils": "^5.0.4", "@types/estree": "1.0.2", - "@types/mocha": "^10.0.1", + "@types/mocha": "^10.0.2", "@types/node": "18.0.0", "@types/yargs-parser": "^21.0.1", - "@typescript-eslint/eslint-plugin": "^6.7.3", - "@typescript-eslint/parser": "^6.7.3", + "@typescript-eslint/eslint-plugin": "^6.7.4", + "@typescript-eslint/parser": "^6.7.4", "@vue/eslint-config-prettier": "^8.0.0", "@vue/eslint-config-typescript": "^12.0.0", "acorn": "^8.10.0", @@ -45,7 +45,7 @@ "chokidar": "^3.5.3", "colorette": "^2.0.20", "concurrently": "^8.2.1", - "core-js": "^3.32.2", + "core-js": "^3.33.0", "date-time": "^4.0.0", "es5-shim": "^4.6.7", "es6-shim": "^0.35.8", @@ -65,7 +65,7 @@ "is-reference": "^3.0.2", "lint-staged": "^14.0.1", "locate-character": "^3.0.0", - "magic-string": "^0.30.3", + "magic-string": "^0.30.4", "mocha": "^10.2.0", "nyc": "^15.1.0", "pinia": "^2.1.6", @@ -73,7 +73,7 @@ "pretty-bytes": "^6.1.1", "pretty-ms": "^8.0.0", "requirejs": "^2.3.6", - "rollup": "^3.29.3", + "rollup": "^3.29.4", "rollup-plugin-license": "^3.1.0", "rollup-plugin-string": "^3.0.0", "rollup-plugin-thatworks": "^1.0.4", @@ -83,10 +83,10 @@ "source-map": "^0.7.4", "source-map-support": "^0.5.21", "systemjs": "^6.14.2", - "terser": "^5.20.0", + "terser": "^5.21.0", "tslib": "^2.6.2", "typescript": "^5.2.2", - "vite": "^4.4.9", + "vite": "^4.4.11", "vitepress": "^1.0.0-rc.20", "vue": "^3.3.4", "wasm-pack": "^0.12.1", @@ -755,15 +755,15 @@ } }, "node_modules/@codemirror/commands": { - "version": "6.2.5", - "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.2.5.tgz", - "integrity": "sha512-dSi7ow2P2YgPBZflR9AJoaTHvqmeGIgkhignYMd5zK5y6DANTvxKxp6eMEpIDUJkRAaOY/TFZ4jP1ADIO/GLVA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.3.0.tgz", + "integrity": "sha512-tFfcxRIlOWiQDFhjBSWJ10MxcvbCIsRr6V64SgrcaY0MwNk32cUOcCuNlWo8VjV4qRQCgNgUAnIeo0svkk4R5Q==", "dev": true, "dependencies": { "@codemirror/language": "^6.0.0", "@codemirror/state": "^6.2.0", "@codemirror/view": "^6.0.0", - "@lezer/common": "^1.0.0" + "@lezer/common": "^1.1.0" } }, "node_modules/@codemirror/lang-javascript": { @@ -824,9 +824,9 @@ "dev": true }, "node_modules/@codemirror/view": { - "version": "6.20.2", - "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.20.2.tgz", - "integrity": "sha512-tZ9F0UZU2P3eTRtgljg3DaCOTn2FIjQU/ktTCjSz9/6he3GHDNxSCDAPidMtF+09r23o0h9H/5U7xibtUuEgdg==", + "version": "6.21.2", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.21.2.tgz", + "integrity": "sha512-EZ/Q1WeMWVarWiZHcy4E2aOjjDySeipVkPawOIu2iViZ1YNaZXPBqJBd9/2zLJtN/MrXKm0V1mHB8Cxn50t91A==", "dev": true, "dependencies": { "@codemirror/state": "^6.1.4", @@ -1550,9 +1550,9 @@ } }, "node_modules/@napi-rs/cli": { - "version": "2.16.2", - "resolved": "https://registry.npmjs.org/@napi-rs/cli/-/cli-2.16.2.tgz", - "integrity": "sha512-U2aZfnr0s9KkXpZlYC0l5WxWCXL7vJUNpCnWMwq3T9GG9rhYAAUM9CTZsi1Z+0iR2LcHbfq9EfMgoqnuTyUjfg==", + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/@napi-rs/cli/-/cli-2.16.3.tgz", + "integrity": "sha512-3mLNPlbbOhpbIUKicLrJtIearlHXUuXL3UeueYyRRplpVMNkdn8xCyzY6PcYZi3JXR8bmCOiWgkVmLnrSL7DKw==", "dev": true, "bin": { "napi": "scripts/index.js" @@ -1857,9 +1857,9 @@ } }, "node_modules/@rollup/plugin-typescript": { - "version": "11.1.2", - "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-11.1.2.tgz", - "integrity": "sha512-0ghSOCMcA7fl1JM+0gYRf+Q/HWyg+zg7/gDSc+fRLmlJWcW5K1I+CLRzaRhXf4Y3DRyPnnDo4M2ktw+a6JcDEg==", + "version": "11.1.4", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-11.1.4.tgz", + "integrity": "sha512-WZRh5LBVLQXdKFICUId5J3eIpmjGURaBqntfg3GSZACgeOAFS+lOSMGTwfzDkELTaZVp/lWdMVNU3UkwCUBg/Q==", "dev": true, "dependencies": { "@rollup/pluginutils": "^5.0.1", @@ -2056,16 +2056,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.3.tgz", - "integrity": "sha512-vntq452UHNltxsaaN+L9WyuMch8bMd9CqJ3zhzTPXXidwbf5mqqKCVXEuvRZUqLJSTLeWE65lQwyXsRGnXkCTA==", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.4.tgz", + "integrity": "sha512-DAbgDXwtX+pDkAHwiGhqP3zWUGpW49B7eqmgpPtg+BKJXwdct79ut9+ifqOFPJGClGKSHXn2PTBatCnldJRUoA==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.7.3", - "@typescript-eslint/type-utils": "6.7.3", - "@typescript-eslint/utils": "6.7.3", - "@typescript-eslint/visitor-keys": "6.7.3", + "@typescript-eslint/scope-manager": "6.7.4", + "@typescript-eslint/type-utils": "6.7.4", + "@typescript-eslint/utils": "6.7.4", + "@typescript-eslint/visitor-keys": "6.7.4", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -2091,15 +2091,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.7.3.tgz", - "integrity": "sha512-TlutE+iep2o7R8Lf+yoer3zU6/0EAUc8QIBB3GYBc1KGz4c4TRm83xwXUZVPlZ6YCLss4r77jbu6j3sendJoiQ==", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.7.4.tgz", + "integrity": "sha512-I5zVZFY+cw4IMZUeNCU7Sh2PO5O57F7Lr0uyhgCJmhN/BuTlnc55KxPonR4+EM3GBdfiCyGZye6DgMjtubQkmA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.7.3", - "@typescript-eslint/types": "6.7.3", - "@typescript-eslint/typescript-estree": "6.7.3", - "@typescript-eslint/visitor-keys": "6.7.3", + "@typescript-eslint/scope-manager": "6.7.4", + "@typescript-eslint/types": "6.7.4", + "@typescript-eslint/typescript-estree": "6.7.4", + "@typescript-eslint/visitor-keys": "6.7.4", "debug": "^4.3.4" }, "engines": { @@ -2119,13 +2119,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.7.3.tgz", - "integrity": "sha512-wOlo0QnEou9cHO2TdkJmzF7DFGvAKEnB82PuPNHpT8ZKKaZu6Bm63ugOTn9fXNJtvuDPanBc78lGUGGytJoVzQ==", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.7.4.tgz", + "integrity": "sha512-SdGqSLUPTXAXi7c3Ob7peAGVnmMoGzZ361VswK2Mqf8UOYcODiYvs8rs5ILqEdfvX1lE7wEZbLyELCW+Yrql1A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.7.3", - "@typescript-eslint/visitor-keys": "6.7.3" + "@typescript-eslint/types": "6.7.4", + "@typescript-eslint/visitor-keys": "6.7.4" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -2136,13 +2136,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.7.3.tgz", - "integrity": "sha512-Fc68K0aTDrKIBvLnKTZ5Pf3MXK495YErrbHb1R6aTpfK5OdSFj0rVN7ib6Tx6ePrZ2gsjLqr0s98NG7l96KSQw==", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.7.4.tgz", + "integrity": "sha512-n+g3zi1QzpcAdHFP9KQF+rEFxMb2KxtnJGID3teA/nxKHOVi3ylKovaqEzGBbVY2pBttU6z85gp0D00ufLzViQ==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.7.3", - "@typescript-eslint/utils": "6.7.3", + "@typescript-eslint/typescript-estree": "6.7.4", + "@typescript-eslint/utils": "6.7.4", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -2163,9 +2163,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.7.3.tgz", - "integrity": "sha512-4g+de6roB2NFcfkZb439tigpAMnvEIg3rIjWQ+EM7IBaYt/CdJt6em9BJ4h4UpdgaBWdmx2iWsafHTrqmgIPNw==", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.7.4.tgz", + "integrity": "sha512-o9XWK2FLW6eSS/0r/tgjAGsYasLAnOWg7hvZ/dGYSSNjCh+49k5ocPN8OmG5aZcSJ8pclSOyVKP2x03Sj+RrCA==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -2176,13 +2176,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.3.tgz", - "integrity": "sha512-YLQ3tJoS4VxLFYHTw21oe1/vIZPRqAO91z6Uv0Ss2BKm/Ag7/RVQBcXTGcXhgJMdA4U+HrKuY5gWlJlvoaKZ5g==", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.4.tgz", + "integrity": "sha512-ty8b5qHKatlNYd9vmpHooQz3Vki3gG+3PchmtsA4TgrZBKWHNjWfkQid7K7xQogBqqc7/BhGazxMD5vr6Ha+iQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.7.3", - "@typescript-eslint/visitor-keys": "6.7.3", + "@typescript-eslint/types": "6.7.4", + "@typescript-eslint/visitor-keys": "6.7.4", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -2203,17 +2203,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.7.3.tgz", - "integrity": "sha512-vzLkVder21GpWRrmSR9JxGZ5+ibIUSudXlW52qeKpzUEQhRSmyZiVDDj3crAth7+5tmN1ulvgKaCU2f/bPRCzg==", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.7.4.tgz", + "integrity": "sha512-PRQAs+HUn85Qdk+khAxsVV+oULy3VkbH3hQ8hxLRJXWBEd7iI+GbQxH5SEUSH7kbEoTp6oT1bOwyga24ELALTA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.7.3", - "@typescript-eslint/types": "6.7.3", - "@typescript-eslint/typescript-estree": "6.7.3", + "@typescript-eslint/scope-manager": "6.7.4", + "@typescript-eslint/types": "6.7.4", + "@typescript-eslint/typescript-estree": "6.7.4", "semver": "^7.5.4" }, "engines": { @@ -2228,12 +2228,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.3.tgz", - "integrity": "sha512-HEVXkU9IB+nk9o63CeICMHxFWbHWr3E1mpilIQBe9+7L/lH97rleFLVtYsfnWB+JVMaiFnEaxvknvmIzX+CqVg==", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.4.tgz", + "integrity": "sha512-pOW37DUhlTZbvph50x5zZCkFn3xzwkGtNoJHzIM3svpiSkJzwOYr/kVBaXmf+RAQiUDs1AHEZVNPg6UJCJpwRA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.7.3", + "@typescript-eslint/types": "6.7.4", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -3747,9 +3747,9 @@ "dev": true }, "node_modules/core-js": { - "version": "3.32.2", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.32.2.tgz", - "integrity": "sha512-pxXSw1mYZPDGvTQqEc5vgIb83jGQKFGYWY76z4a7weZXUolw3G+OvpZqSRcfYOoOVUQJYEPsWeQK8pKEnUtWxQ==", + "version": "3.33.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.33.0.tgz", + "integrity": "sha512-HoZr92+ZjFEKar5HS6MC776gYslNOKHt75mEBKWKnPeFDpZ6nH5OeF3S6HFT1mUAUZKrzkez05VboaX8myjSuw==", "dev": true, "hasInstallScript": true, "funding": { @@ -6811,9 +6811,9 @@ } }, "node_modules/magic-string": { - "version": "0.30.3", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.3.tgz", - "integrity": "sha512-B7xGbll2fG/VjP+SWg4sX3JynwIU0mjoTc6MPpKNuIvftk6u6vqhDnk1R80b8C2GBR6ywqy+1DcKBrevBg+bmw==", + "version": "0.30.4", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.4.tgz", + "integrity": "sha512-Q/TKtsC5BPm0kGqgBIF9oXAs/xEf2vRKiIB4wCRQTJOQIByZ1d+NnUOotvJOvNpi5RNIgVOMC3pOuaP1ZTDlVg==", "dev": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" @@ -9723,9 +9723,9 @@ "dev": true }, "node_modules/terser": { - "version": "5.20.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.20.0.tgz", - "integrity": "sha512-e56ETryaQDyebBwJIWYB2TT6f2EZ0fL0sW/JRXNMN26zZdKi2u/E/5my5lG6jNxym6qsrVXfFRmOdV42zlAgLQ==", + "version": "5.21.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.21.0.tgz", + "integrity": "sha512-WtnFKrxu9kaoXuiZFSGrcAvvBqAdmKx0SFNmVNYdJamMu9yyN3I/QF0FbH4QcqJQ+y1CJnzxGIKH0cSj+FGYRw==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -10180,9 +10180,9 @@ } }, "node_modules/vite": { - "version": "4.4.9", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.9.tgz", - "integrity": "sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==", + "version": "4.4.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.11.tgz", + "integrity": "sha512-ksNZJlkcU9b0lBwAGZGGaZHCMqHsc8OpgtoYhsQ4/I2v5cnpmmmqe5pM4nv/4Hn6G/2GhTdj0DhZh2e+Er1q5A==", "dev": true, "dependencies": { "esbuild": "^0.18.10", diff --git a/package.json b/package.json index 088393505..8a2cc558b 100644 --- a/package.json +++ b/package.json @@ -103,15 +103,15 @@ "@rollup/plugin-typescript": "It appears that 11.1.3 breaks sourcemaps" }, "devDependencies": { - "@codemirror/commands": "^6.2.5", + "@codemirror/commands": "^6.3.0", "@codemirror/lang-javascript": "^6.2.1", "@codemirror/language": "^6.9.1", "@codemirror/search": "^6.5.4", "@codemirror/state": "^6.2.1", - "@codemirror/view": "^6.20.2", + "@codemirror/view": "^6.21.2", "@jridgewell/sourcemap-codec": "^1.4.15", "@mermaid-js/mermaid-cli": "^10.4.0", - "@napi-rs/cli": "^2.16.2", + "@napi-rs/cli": "^2.16.3", "@rollup/plugin-alias": "^5.0.0", "@rollup/plugin-buble": "^1.0.2", "@rollup/plugin-commonjs": "^25.0.4", @@ -119,14 +119,14 @@ "@rollup/plugin-node-resolve": "^15.2.1", "@rollup/plugin-replace": "^5.0.2", "@rollup/plugin-terser": "^0.4.3", - "@rollup/plugin-typescript": "11.1.2", + "@rollup/plugin-typescript": "11.1.4", "@rollup/pluginutils": "^5.0.4", "@types/estree": "1.0.2", - "@types/mocha": "^10.0.1", + "@types/mocha": "^10.0.2", "@types/node": "18.0.0", "@types/yargs-parser": "^21.0.1", - "@typescript-eslint/eslint-plugin": "^6.7.3", - "@typescript-eslint/parser": "^6.7.3", + "@typescript-eslint/eslint-plugin": "^6.7.4", + "@typescript-eslint/parser": "^6.7.4", "@vue/eslint-config-prettier": "^8.0.0", "@vue/eslint-config-typescript": "^12.0.0", "acorn": "^8.10.0", @@ -136,7 +136,7 @@ "chokidar": "^3.5.3", "colorette": "^2.0.20", "concurrently": "^8.2.1", - "core-js": "^3.32.2", + "core-js": "^3.33.0", "date-time": "^4.0.0", "es5-shim": "^4.6.7", "es6-shim": "^0.35.8", @@ -156,7 +156,7 @@ "is-reference": "^3.0.2", "lint-staged": "^14.0.1", "locate-character": "^3.0.0", - "magic-string": "^0.30.3", + "magic-string": "^0.30.4", "mocha": "^10.2.0", "nyc": "^15.1.0", "pinia": "^2.1.6", @@ -164,7 +164,7 @@ "pretty-bytes": "^6.1.1", "pretty-ms": "^8.0.0", "requirejs": "^2.3.6", - "rollup": "^3.29.3", + "rollup": "^3.29.4", "rollup-plugin-license": "^3.1.0", "rollup-plugin-string": "^3.0.0", "rollup-plugin-thatworks": "^1.0.4", @@ -174,10 +174,10 @@ "source-map": "^0.7.4", "source-map-support": "^0.5.21", "systemjs": "^6.14.2", - "terser": "^5.20.0", + "terser": "^5.21.0", "tslib": "^2.6.2", "typescript": "^5.2.2", - "vite": "^4.4.9", + "vite": "^4.4.11", "vitepress": "^1.0.0-rc.20", "vue": "^3.3.4", "wasm-pack": "^0.12.1", diff --git a/rust/Cargo.lock b/rust/Cargo.lock index b902dd103..b6156c721 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -14,9 +14,9 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -42,9 +42,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" dependencies = [ "memchr", ] @@ -66,9 +66,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.72" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "arrayvec" @@ -86,7 +86,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.27", + "syn 2.0.37", ] [[package]] @@ -120,9 +120,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -183,9 +183,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "block-buffer" @@ -223,15 +223,18 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfg-if" @@ -241,17 +244,16 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", - "time", "wasm-bindgen", - "winapi", + "windows-targets", ] [[package]] @@ -278,16 +280,6 @@ dependencies = [ "libc", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - [[package]] name = "crossbeam-deque" version = "0.8.3" @@ -333,22 +325,22 @@ dependencies = [ [[package]] name = "ctor" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f34ba9a9bcb8645379e9de8cb3ecfcf4d1c85ba66d90deb3259206fa5aa193b" +checksum = "37e366bff8cd32dd8754b0991fb66b279dc48f598c3a18914852a6673deef583" dependencies = [ "quote", - "syn 2.0.27", + "syn 2.0.37", ] [[package]] name = "dashmap" -version = "5.5.0" +version = "5.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6943ae99c34386c84a470c499d3414f66502a41340aa895406e0d2e4a207b91d" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.14.0", + "hashbrown 0.14.1", "lock_api", "once_cell", "parking_lot_core", @@ -386,6 +378,12 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "fixedbitset" version = "0.4.2" @@ -410,7 +408,7 @@ dependencies = [ "pmutil", "proc-macro2", "swc_macros_common", - "syn 2.0.27", + "syn 2.0.37", ] [[package]] @@ -432,15 +430,15 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "wasm-bindgen", ] [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "hashbrown" @@ -459,9 +457,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" [[package]] name = "hermit-abi" @@ -474,9 +472,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "iana-time-zone" @@ -528,6 +526,16 @@ dependencies = [ "serde", ] +[[package]] +name = "indexmap" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" +dependencies = [ + "equivalent", + "hashbrown 0.14.1", +] + [[package]] name = "is-macro" version = "0.3.0" @@ -538,7 +546,7 @@ dependencies = [ "pmutil", "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.37", ] [[package]] @@ -588,9 +596,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" [[package]] name = "libloading" @@ -614,9 +622,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lru" @@ -629,9 +637,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.2" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5486aed0026218e61b8a01d5fbd5a0a134649abb71a0e53b7bc088529dced86e" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memoffset" @@ -690,11 +698,11 @@ dependencies = [ [[package]] name = "napi" -version = "2.13.2" +version = "2.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ede2d12cd6fce44da537a4be1f5510c73be2506c2e32dfaaafd1f36968f3a0e" +checksum = "fd063c93b900149304e3ba96ce5bf210cd4f81ef5eb80ded0d100df3e85a3ac0" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.0", "ctor", "napi-derive", "napi-sys", @@ -732,7 +740,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "semver 1.0.18", + "semver 1.0.19", "syn 1.0.109", ] @@ -772,9 +780,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg", "num-integer", @@ -807,15 +815,15 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.3", "libc", ] [[package]] name = "object" -version = "0.31.1" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -891,12 +899,12 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "petgraph" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap", + "indexmap 2.0.2", ] [[package]] @@ -945,9 +953,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.10" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pmutil" @@ -957,7 +965,7 @@ checksum = "52a40bc70c2c58040d2d8b167ba9a5ff59fc9dab7ad44771cfde3dcfde7a09c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.37", ] [[package]] @@ -984,7 +992,7 @@ dependencies = [ "dashmap", "from_variant", "once_cell", - "semver 1.0.18", + "semver 1.0.19", "serde", "st-map", "tracing", @@ -1022,9 +1030,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -1040,9 +1048,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.32" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -1085,9 +1093,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" dependencies = [ "either", "rayon-core", @@ -1095,14 +1103,12 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] @@ -1116,9 +1122,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.1" +version = "1.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" dependencies = [ "aho-corasick", "memchr", @@ -1128,9 +1134,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.3" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" +checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" dependencies = [ "aho-corasick", "memchr", @@ -1139,9 +1145,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "rustc-demangle" @@ -1199,9 +1205,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" dependencies = [ "serde", ] @@ -1214,9 +1220,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.175" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d25439cd7397d044e2748a6fe2432b5e85db703d6d097bd014b3c0ad1ebff0b" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] @@ -1234,20 +1240,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.175" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b23f7ade6f110613c0d63858ddb8b94c1041f550eab58a16b371bdf2c9c80ab4" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.37", ] [[package]] name = "serde_json" -version = "1.0.103" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", @@ -1267,15 +1273,15 @@ dependencies = [ [[package]] name = "siphasher" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "smallvec" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "smartstring" @@ -1290,15 +1296,15 @@ dependencies = [ [[package]] name = "smawk" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" +checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" [[package]] name = "sourcemap" -version = "6.3.0" +version = "6.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8df03d85f2767c45e61b4453eb6144153c80399e4fdd6407a6d16cb87cc0347" +checksum = "e4cbf65ca7dc576cf50e21f8d0712d96d4fcfd797389744b7b222a85cdf5bd90" dependencies = [ "data-encoding", "debugid", @@ -1348,7 +1354,7 @@ dependencies = [ "pmutil", "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.37", ] [[package]] @@ -1393,7 +1399,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.27", + "syn 2.0.37", ] [[package]] @@ -1426,15 +1432,15 @@ dependencies = [ [[package]] name = "swc" -version = "0.265.8" +version = "0.266.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0d5177297253ff4013d2730770b4d28d227d168dbb5b3d7bc9dd785d1b07dc0" +checksum = "d34095ecd01255e4eb0dc0e62f3a2a3f4cdf546584b3e0cea3bc4b2e2dbc98ea" dependencies = [ "anyhow", "base64 0.13.1", "dashmap", "either", - "indexmap", + "indexmap 1.9.3", "jsonc-parser", "lru", "once_cell", @@ -1448,6 +1454,7 @@ dependencies = [ "swc_atoms", "swc_cached", "swc_common", + "swc_compiler_base", "swc_config", "swc_ecma_ast", "swc_ecma_codegen", @@ -1501,9 +1508,9 @@ dependencies = [ [[package]] name = "swc_common" -version = "0.32.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39cb7fcd56655c8ae7dcf2344f0be6cbff4d9c7cb401fe3ec8e56e1de8dfe582" +checksum = "9c84742fc22df1c293da5354c1cc8a5b45a045e9dc941005c1fd9cb4e9bdabc1" dependencies = [ "ahash", "ast_node", @@ -1528,13 +1535,35 @@ dependencies = [ "url", ] +[[package]] +name = "swc_compiler_base" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e584232fc052442fef404e73f19c61152794cd55e904b1ca59d27ce892c5901" +dependencies = [ + "anyhow", + "base64 0.13.1", + "pathdiff", + "serde", + "sourcemap", + "swc_atoms", + "swc_common", + "swc_config", + "swc_ecma_ast", + "swc_ecma_codegen", + "swc_ecma_minifier", + "swc_ecma_parser", + "swc_ecma_visit", + "swc_timer", +] + [[package]] name = "swc_config" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ba1c7a40d38f9dd4e9a046975d3faf95af42937b34b2b963be4d8f01239584b" dependencies = [ - "indexmap", + "indexmap 1.9.3", "serde", "serde_json", "swc_config_macro", @@ -1550,16 +1579,16 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.27", + "syn 2.0.37", ] [[package]] name = "swc_ecma_ast" -version = "0.109.0" +version = "0.109.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bc2286cedd688a68f214faa1c19bb5cceab7c9c54d0cbe3273e4c1704e38f69" +checksum = "e063a1614daed3ea8be56e5dd8edb17003409088d2fc9ce4aca3378879812607" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.0", "is-macro", "num-bigint", "scoped-tls", @@ -1572,9 +1601,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "0.144.1" +version = "0.145.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e62ba2c0ed1f119fc1a76542d007f1b2c12854d54dea15f5491363227debe11" +checksum = "547ed57b827ea4df3e2c27cea153482f8b2ce2d271ae30c456fbb2d5a5ecc19d" dependencies = [ "memchr", "num-bigint", @@ -1599,14 +1628,14 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.27", + "syn 2.0.37", ] [[package]] name = "swc_ecma_ext_transforms" -version = "0.108.0" +version = "0.109.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57eb7bbfbd7d0b4c2d5abf6936efb16d5a228508246a19795d59c849dbff073e" +checksum = "2180a180a4ddf53d645be35f155fd2cd96f84dbba9399a9c52e795b15f7dcf76" dependencies = [ "phf", "swc_atoms", @@ -1618,9 +1647,9 @@ dependencies = [ [[package]] name = "swc_ecma_lints" -version = "0.87.3" +version = "0.88.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5f56635e73df9d6f4fa1ecbc1c65e9175ad2593fada76b13b05c5d2895b8a1d" +checksum = "289a6f347173c502f9ec95916a424f566ad0d1e9e8514d4fa754d400b8f4d29d" dependencies = [ "auto_impl", "dashmap", @@ -1638,9 +1667,9 @@ dependencies = [ [[package]] name = "swc_ecma_loader" -version = "0.44.2" +version = "0.44.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7d7c322462657ae27ac090a2c89f7e456c94416284a2f5ecf66c43a6a3c19d1" +checksum = "7b2b3a3ec38fc9c691b787d32ac2aa5eb6871d1fe74ac4a10638fbd9b9bc407b" dependencies = [ "anyhow", "dashmap", @@ -1659,12 +1688,12 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "0.186.6" +version = "0.187.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17745ea0c4f10846a29dfc1fe8d5e5141b57682a5645373be1252efa04d6937c" +checksum = "737807edd59a7027b323ffe9b4f997d04d9be75ae523d7d0d72f49276a42a518" dependencies = [ "arrayvec", - "indexmap", + "indexmap 1.9.3", "num-bigint", "num_cpus", "once_cell", @@ -1693,9 +1722,9 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "0.139.0" +version = "0.140.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eab46cb863bc5cd61535464e07e5b74d5f792fa26a27b9f6fd4c8daca9903b7" +checksum = "3c968599841fcecfdc2e490188ad93251897a1bb912882547e6889e14a368399" dependencies = [ "either", "num-bigint", @@ -1713,17 +1742,17 @@ dependencies = [ [[package]] name = "swc_ecma_preset_env" -version = "0.200.5" +version = "0.201.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb0e2940accc1b1d9f6bbe06190a84a43b1b7436d3fdae93f486a1971a045727" +checksum = "d32427f265c65e691e6917c8146d90ab5b63bea09776e2f1e93a4f5fedceb135" dependencies = [ "anyhow", "dashmap", - "indexmap", + "indexmap 1.9.3", "once_cell", "preset_env_base", "rustc-hash", - "semver 1.0.18", + "semver 1.0.19", "serde", "serde_json", "st-map", @@ -1738,9 +1767,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "0.223.4" +version = "0.224.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18ab21459fd0b85928da4654852ec875bb0f86d4ff17cc3de90ede6997e0ae56" +checksum = "49978f8430c1a975f0eecd966a6739eee76efe57af855d121f025b1017bb78d5" dependencies = [ "swc_atoms", "swc_common", @@ -1758,13 +1787,13 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "0.132.3" +version = "0.133.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e082ff07a2d31fd8e480dc590dd81efb75106e79bec24483dbece03630ca67b3" +checksum = "7632e73dd031d97279579b4f2442ca2956fa8d523053aae10544b3392ac7c7de" dependencies = [ "better_scoped_tls", - "bitflags 2.3.3", - "indexmap", + "bitflags 2.4.0", + "indexmap 1.9.3", "once_cell", "phf", "rustc-hash", @@ -1781,9 +1810,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_classes" -version = "0.121.3" +version = "0.122.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71f54c8ce83b25e89dc60d09686ebc8c4d0376bc82c21ac1a14a1b0a339c714f" +checksum = "32c1cd6b6b89fc2f4b2df5beb77b2f7c0311dc047394a753d331f6459f879e13" dependencies = [ "swc_atoms", "swc_common", @@ -1795,12 +1824,12 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_compat" -version = "0.158.4" +version = "0.159.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4da9073b7bfa9b2fd0a46f98fae9c1a205d1c7e8b91d8cd43c4077ce598c75b7" +checksum = "edda36087deb901decd80aa310eafdc1b0ca99eb6b450985c0526c1fa81c5b3e" dependencies = [ "arrayvec", - "indexmap", + "indexmap 1.9.3", "is-macro", "num-bigint", "serde", @@ -1828,19 +1857,19 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.27", + "syn 2.0.37", ] [[package]] name = "swc_ecma_transforms_module" -version = "0.175.4" +version = "0.176.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18db89901084ec9dddd7e2c32f00df335dfcd3b1e99dc146918223a625dc4638" +checksum = "2a6f6691e475c3221f0a71111d36db1b82c564797eff50ec52a60556570bf3dd" dependencies = [ "Inflector", "anyhow", - "bitflags 2.3.3", - "indexmap", + "bitflags 2.4.0", + "indexmap 1.9.3", "is-macro", "path-clean", "pathdiff", @@ -1860,12 +1889,12 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "0.192.4" +version = "0.193.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a364e8747c2f2ef9715bf9626eefd3462e3b50fa137927dfa156276bf53f38aa" +checksum = "7a05f5f1b9ee949c11f8b09b8a91a1f33c9071a170582f4da89d55acb63b5f33" dependencies = [ "dashmap", - "indexmap", + "indexmap 1.9.3", "once_cell", "petgraph", "rustc-hash", @@ -1884,9 +1913,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_proposal" -version = "0.166.4" +version = "0.167.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f2e61b71de4a1b403e6451d0c0fbeb66e27ef369c341a52b3827c9cf6df052c" +checksum = "dabacad5ab4169d12170bd02724655b995182face7e3f7359829c5f395daf4f7" dependencies = [ "either", "rustc-hash", @@ -1904,13 +1933,13 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "0.178.4" +version = "0.179.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2313ff98bf87985b16be2d6ca7a3a9988888b6a02550a0eaa2a74cf2d2c7347" +checksum = "f96690d7ae5574f720b02347a759ebf7841c484546c40ae164cb7f095aa02d7a" dependencies = [ "base64 0.13.1", "dashmap", - "indexmap", + "indexmap 1.9.3", "once_cell", "serde", "sha-1", @@ -1928,10 +1957,11 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "0.182.4" +version = "0.183.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4be392ce94eecdb6e7afacec9080fb5be3cc36cfc376cd33f7e933ce6600768" +checksum = "bf6feca762a992c3859c92a58b0c679a2a23e9d5b258dfafe7c853e8df2f88c8" dependencies = [ + "ryu-js", "serde", "swc_atoms", "swc_common", @@ -1944,11 +1974,11 @@ dependencies = [ [[package]] name = "swc_ecma_usage_analyzer" -version = "0.18.1" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1aabf52dfd20abdbe5087107273d250d134f5b0fa2251cbb42bbfbec88404af" +checksum = "c9aff7e336152eab07d074602bce9e2d43a3384f9b7d8397e78441b83fc0f1ed" dependencies = [ - "indexmap", + "indexmap 1.9.3", "rustc-hash", "swc_atoms", "swc_common", @@ -1961,11 +1991,11 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "0.122.0" +version = "0.123.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11006a3398ffd4693c4d3b0a1b1a5030edbdc04228159f5301120a6178144708" +checksum = "51d3f8e4d11d124d9527d04ba7fc9f1efec376a67598ad7affda0440a48b13c1" dependencies = [ - "indexmap", + "indexmap 1.9.3", "num_cpus", "once_cell", "rustc-hash", @@ -1979,9 +2009,9 @@ dependencies = [ [[package]] name = "swc_ecma_visit" -version = "0.95.0" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f628ec196e76e67892441e14eef2e423a738543d32bffdabfeec20c29582117" +checksum = "2774848b306e17fa280c598ecb192cc2c72a1163942b02d48606514336e9e7c5" dependencies = [ "num-bigint", "swc_atoms", @@ -2000,14 +2030,14 @@ dependencies = [ "pmutil", "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.37", ] [[package]] name = "swc_error_reporters" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6530d0def50c33d14064a43837b7e3c1fe8716ee6c3495a478835793caae2c97" +checksum = "c76b479ad1a69bec65b261354b8e2dec8ed0f9ed43c7b54ab053dc4923e1c90e" dependencies = [ "anyhow", "miette", @@ -2018,11 +2048,11 @@ dependencies = [ [[package]] name = "swc_fast_graph" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a407fff2eb5ce3bee7513bdd9531a7be0285bc1213500b6d98ad235428d94cce" +checksum = "e2f7297cdefdb54d8d09e0294c1aec3826825b1feefd0c25978365aa7f447a1c" dependencies = [ - "indexmap", + "indexmap 1.9.3", "petgraph", "rustc-hash", "swc_common", @@ -2037,14 +2067,14 @@ dependencies = [ "pmutil", "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.37", ] [[package]] name = "swc_node_comments" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73cee5dededc1e0d19e53dd0a41a343a43e21ed9b62c3df0fdd5801c11533bc9" +checksum = "b2b9597573f1ab8bae72329eef550d214ced0955c7a4f1b6b4ae5e216219e710" dependencies = [ "dashmap", "swc_atoms", @@ -2053,9 +2083,9 @@ dependencies = [ [[package]] name = "swc_timer" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95c548665c811d1c5def583d3d6ca0291e5397122c0de6362bb201cc2de8beff" +checksum = "b740ce6b402ed04176bd28dc4f4f92c764fe0defe8437c2f3b6e1b5818b4e10c" dependencies = [ "tracing", ] @@ -2068,7 +2098,7 @@ checksum = "ff9719b6085dd2824fd61938a881937be14b08f95e2d27c64c825a9f65e052ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.37", ] [[package]] @@ -2092,7 +2122,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.27", + "syn 2.0.37", ] [[package]] @@ -2108,9 +2138,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.27" +version = "2.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" dependencies = [ "proc-macro2", "quote", @@ -2140,33 +2170,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.44" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.44" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", -] - -[[package]] -name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", + "syn 2.0.37", ] [[package]] @@ -2204,7 +2223,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.37", ] [[package]] @@ -2234,9 +2253,9 @@ checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-bidi" @@ -2246,15 +2265,15 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-id" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d70b6494226b36008c8366c288d77190b3fad2eb4c10533139c1c1f461127f1a" +checksum = "b1b6def86329695390197b82c1e244a54a131ceb66c996f2088a3876e2ae083f" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-linebreak" @@ -2279,15 +2298,15 @@ checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "url" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -2306,12 +2325,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2339,7 +2352,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.37", "wasm-bindgen-shared", ] @@ -2361,7 +2374,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.37", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2405,9 +2418,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -2420,45 +2433,45 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "xxhash" diff --git a/rust/bindings_napi/Cargo.toml b/rust/bindings_napi/Cargo.toml index 1d7203866..4ce67cd3c 100644 --- a/rust/bindings_napi/Cargo.toml +++ b/rust/bindings_napi/Cargo.toml @@ -10,8 +10,8 @@ crate-type = ["cdylib"] [dependencies] # Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix -napi = { version = "2.12.2", default-features = false, features = ["napi4"] } -napi-derive = "2.12.2" +napi = { version = "2.13.3", default-features = false, features = ["napi4"] } +napi-derive = "2.13.0" parse_ast = { path = "../parse_ast" } xxhash = { path = "../xxhash" } diff --git a/rust/parse_ast/Cargo.toml b/rust/parse_ast/Cargo.toml index faefca303..cde32caf8 100644 --- a/rust/parse_ast/Cargo.toml +++ b/rust/parse_ast/Cargo.toml @@ -6,13 +6,13 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -anyhow = "1.0.71" -swc = "0.265.7" -swc_common = "0.32.0" -swc_ecma_ast = "0.109.0" -swc_ecma_parser = "0.139.0" -swc_error_reporters = "0.16.0" +anyhow = "1.0.75" +swc = "0.266.36" +swc_common = "0.32.1" +swc_ecma_ast = "0.109.1" +swc_ecma_parser = "0.140.0" +swc_error_reporters = "0.16.1" parking_lot = "0.12.1" -swc_ecma_lints = "0.87.2" -swc_ecma_transforms_base = "0.132.2" -swc_ecma_visit = "0.95.0" +swc_ecma_lints = "0.88.7" +swc_ecma_transforms_base = "0.133.6" +swc_ecma_visit = "0.95.1" diff --git a/test/form/samples/deprecated/removes-dynamic-assertions/main.js b/test/form/samples/deprecated/removes-dynamic-assertions/main.js index 38bfed638..025b60451 100644 --- a/test/form/samples/deprecated/removes-dynamic-assertions/main.js +++ b/test/form/samples/deprecated/removes-dynamic-assertions/main.js @@ -1,6 +1,6 @@ -import('external', { assert: { type: 'special' } }); -import(globalThis.unknown, { assert: { type: 'special' } }); -import(`external-${globalThis.unknown}`, { assert: { type: 'special' } }); -import('external' + globalThis.unknown, { assert: { type: 'special' } }); -import('external-resolved', { assert: { type: 'special' } }); -import('unresolved', { assert: { type: 'special' } }); +import('external', { with: { type: 'special' } }); +import(globalThis.unknown, { with: { type: 'special' } }); +import(`external-${globalThis.unknown}`, { with: { type: 'special' } }); +import('external' + globalThis.unknown, { with: { type: 'special' } }); +import('external-resolved', { with: { type: 'special' } }); +import('unresolved', { with: { type: 'special' } }); diff --git a/test/form/samples/deprecated/removes-static-attributes/main.js b/test/form/samples/deprecated/removes-static-attributes/main.js index 02b154c86..645381650 100644 --- a/test/form/samples/deprecated/removes-static-attributes/main.js +++ b/test/form/samples/deprecated/removes-static-attributes/main.js @@ -1,8 +1,8 @@ -import { a } from 'a' assert { type: 'a', extra: 'extra' }; -import * as b from 'b' assert { type: 'b' }; -export { c } from 'c' assert { type: 'c' }; -export * from 'd' assert { type: 'd' }; -import 'unresolved' assert { type: 'e' }; +import { a } from 'a' with { type: 'a', extra: 'extra' }; +import * as b from 'b' with { type: 'b' }; +export { c } from 'c' with { type: 'c' }; +export * from 'd' with { type: 'd' }; +import 'unresolved' with { type: 'e' }; console.log(a, b, d); diff --git a/test/form/samples/import-attributes/attribute-shapes/main.js b/test/form/samples/import-attributes/attribute-shapes/main.js index a82cad812..63f5bb69b 100644 --- a/test/form/samples/import-attributes/attribute-shapes/main.js +++ b/test/form/samples/import-attributes/attribute-shapes/main.js @@ -1,4 +1,4 @@ -import('external-a', { 'assert': { 'type': 'json', foo: 1, ...{} } }); -import('external-b', { assert: {} }); +import('external-a', { 'with': { 'type': 'json', foo: 1, ...{} } }); +import('external-b', { with: {} }); import('external-c', { ...{} }); import('external-d', {}); diff --git a/test/form/samples/import-attributes/keep-dynamic-assertions/_config.js b/test/form/samples/import-attributes/keep-dynamic-assertions/_config.js new file mode 100644 index 000000000..a75f18189 --- /dev/null +++ b/test/form/samples/import-attributes/keep-dynamic-assertions/_config.js @@ -0,0 +1,28 @@ +module.exports = defineTest({ + description: 'keep import attributes for dynamic imports', + expectedWarnings: ['UNRESOLVED_IMPORT'], + options: { + external: id => { + if (id === 'unresolved') return null; + return true; + }, + plugins: [ + { + name: 'test', + resolveDynamicImport(specifier) { + if (typeof specifier === 'object') { + if (specifier.type === 'TemplateLiteral') { + return "'resolvedString'"; + } + if (specifier.type === 'BinaryExpression') { + return { id: 'resolved-id', external: true }; + } + } else if (specifier === 'external-resolved') { + return { id: 'resolved-different', external: true }; + } + return null; + } + } + ] + } +}); diff --git a/test/form/samples/import-attributes/keep-dynamic-assertions/_expected/amd.js b/test/form/samples/import-attributes/keep-dynamic-assertions/_expected/amd.js new file mode 100644 index 000000000..e9478c8fc --- /dev/null +++ b/test/form/samples/import-attributes/keep-dynamic-assertions/_expected/amd.js @@ -0,0 +1,27 @@ +define(['require'], (function (require) { 'use strict'; + + function _interopNamespaceDefault(e) { + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { return e[k]; } + }); + } + }); + } + n.default = e; + return Object.freeze(n); + } + + new Promise(function (resolve, reject) { require(['external'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); + (function (t) { return new Promise(function (resolve, reject) { require([t], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); })(globalThis.unknown); + (function (t) { return new Promise(function (resolve, reject) { require([t], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); })('resolvedString'); + new Promise(function (resolve, reject) { require(['resolved-id'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); + new Promise(function (resolve, reject) { require(['resolved-different'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); + new Promise(function (resolve, reject) { require(['unresolved'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); + +})); diff --git a/test/form/samples/import-attributes/keep-dynamic-assertions/_expected/cjs.js b/test/form/samples/import-attributes/keep-dynamic-assertions/_expected/cjs.js new file mode 100644 index 000000000..e1cd2b6d0 --- /dev/null +++ b/test/form/samples/import-attributes/keep-dynamic-assertions/_expected/cjs.js @@ -0,0 +1,8 @@ +'use strict'; + +import('external'); +import(globalThis.unknown); +import('resolvedString'); +import('resolved-id'); +import('resolved-different'); +import('unresolved'); diff --git a/test/form/samples/import-attributes/keep-dynamic-assertions/_expected/es.js b/test/form/samples/import-attributes/keep-dynamic-assertions/_expected/es.js new file mode 100644 index 000000000..87164b787 --- /dev/null +++ b/test/form/samples/import-attributes/keep-dynamic-assertions/_expected/es.js @@ -0,0 +1,6 @@ +import('external', { assert: { type: 'special' } }); +import(globalThis.unknown, { assert: { type: 'special' } }); +import('resolvedString', { assert: { type: 'special' } }); +import('resolved-id', { assert: { type: 'special' } }); +import('resolved-different', { assert: { type: 'special' } }); +import('unresolved', { assert: { type: 'special' } }); diff --git a/test/form/samples/import-attributes/keep-dynamic-assertions/_expected/iife.js b/test/form/samples/import-attributes/keep-dynamic-assertions/_expected/iife.js new file mode 100644 index 000000000..0da800282 --- /dev/null +++ b/test/form/samples/import-attributes/keep-dynamic-assertions/_expected/iife.js @@ -0,0 +1,11 @@ +(function () { + 'use strict'; + + import('external'); + import(globalThis.unknown); + import('resolvedString'); + import('resolved-id'); + import('resolved-different'); + import('unresolved'); + +})(); diff --git a/test/form/samples/import-attributes/keep-dynamic-assertions/_expected/system.js b/test/form/samples/import-attributes/keep-dynamic-assertions/_expected/system.js new file mode 100644 index 000000000..44c758c29 --- /dev/null +++ b/test/form/samples/import-attributes/keep-dynamic-assertions/_expected/system.js @@ -0,0 +1,15 @@ +System.register([], (function (exports, module) { + 'use strict'; + return { + execute: (function () { + + module.import('external'); + module.import(globalThis.unknown); + module.import('resolvedString'); + module.import('resolved-id'); + module.import('resolved-different'); + module.import('unresolved'); + + }) + }; +})); diff --git a/test/form/samples/import-attributes/keep-dynamic-assertions/_expected/umd.js b/test/form/samples/import-attributes/keep-dynamic-assertions/_expected/umd.js new file mode 100644 index 000000000..cd9d7642d --- /dev/null +++ b/test/form/samples/import-attributes/keep-dynamic-assertions/_expected/umd.js @@ -0,0 +1,13 @@ +(function (factory) { + typeof define === 'function' && define.amd ? define(factory) : + factory(); +})((function () { 'use strict'; + + import('external'); + import(globalThis.unknown); + import('resolvedString'); + import('resolved-id'); + import('resolved-different'); + import('unresolved'); + +})); diff --git a/test/form/samples/import-attributes/keep-dynamic-assertions/main.js b/test/form/samples/import-attributes/keep-dynamic-assertions/main.js new file mode 100644 index 000000000..38bfed638 --- /dev/null +++ b/test/form/samples/import-attributes/keep-dynamic-assertions/main.js @@ -0,0 +1,6 @@ +import('external', { assert: { type: 'special' } }); +import(globalThis.unknown, { assert: { type: 'special' } }); +import(`external-${globalThis.unknown}`, { assert: { type: 'special' } }); +import('external' + globalThis.unknown, { assert: { type: 'special' } }); +import('external-resolved', { assert: { type: 'special' } }); +import('unresolved', { assert: { type: 'special' } }); diff --git a/test/form/samples/import-attributes/keep-dynamic-attributes/_expected/es.js b/test/form/samples/import-attributes/keep-dynamic-attributes/_expected/es.js index 87164b787..511aa8d86 100644 --- a/test/form/samples/import-attributes/keep-dynamic-attributes/_expected/es.js +++ b/test/form/samples/import-attributes/keep-dynamic-attributes/_expected/es.js @@ -1,6 +1,6 @@ import('external', { assert: { type: 'special' } }); -import(globalThis.unknown, { assert: { type: 'special' } }); -import('resolvedString', { assert: { type: 'special' } }); +import(globalThis.unknown, { with: { type: 'special' } }); +import('resolvedString', { with: { type: 'special' } }); import('resolved-id', { assert: { type: 'special' } }); import('resolved-different', { assert: { type: 'special' } }); import('unresolved', { assert: { type: 'special' } }); diff --git a/test/form/samples/import-attributes/keep-dynamic-attributes/main.js b/test/form/samples/import-attributes/keep-dynamic-attributes/main.js index 38bfed638..025b60451 100644 --- a/test/form/samples/import-attributes/keep-dynamic-attributes/main.js +++ b/test/form/samples/import-attributes/keep-dynamic-attributes/main.js @@ -1,6 +1,6 @@ -import('external', { assert: { type: 'special' } }); -import(globalThis.unknown, { assert: { type: 'special' } }); -import(`external-${globalThis.unknown}`, { assert: { type: 'special' } }); -import('external' + globalThis.unknown, { assert: { type: 'special' } }); -import('external-resolved', { assert: { type: 'special' } }); -import('unresolved', { assert: { type: 'special' } }); +import('external', { with: { type: 'special' } }); +import(globalThis.unknown, { with: { type: 'special' } }); +import(`external-${globalThis.unknown}`, { with: { type: 'special' } }); +import('external' + globalThis.unknown, { with: { type: 'special' } }); +import('external-resolved', { with: { type: 'special' } }); +import('unresolved', { with: { type: 'special' } }); diff --git a/test/form/samples/import-attributes/keeps-static-assertions/_config.js b/test/form/samples/import-attributes/keeps-static-assertions/_config.js new file mode 100644 index 000000000..5dfbc1b2c --- /dev/null +++ b/test/form/samples/import-attributes/keeps-static-assertions/_config.js @@ -0,0 +1,11 @@ +module.exports = defineTest({ + description: 'keeps any import assertions on input', + expectedWarnings: ['UNRESOLVED_IMPORT'], + options: { + external: id => { + if (id === 'unresolved') return null; + return true; + }, + output: { name: 'bundle' } + } +}); diff --git a/test/form/samples/import-attributes/keeps-static-assertions/_expected/amd.js b/test/form/samples/import-attributes/keeps-static-assertions/_expected/amd.js new file mode 100644 index 000000000..a062f43e7 --- /dev/null +++ b/test/form/samples/import-attributes/keeps-static-assertions/_expected/amd.js @@ -0,0 +1,35 @@ +define(['exports', 'a', 'b', 'c', 'd', 'unresolved'], (function (exports, a, b, c, d$1, unresolved) { 'use strict'; + + function _interopNamespaceDefault(e) { + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { return e[k]; } + }); + } + }); + } + n.default = e; + return Object.freeze(n); + } + + var b__namespace = /*#__PURE__*/_interopNamespaceDefault(b); + + console.log(a.a, b__namespace, d); + + Object.defineProperty(exports, 'c', { + enumerable: true, + get: function () { return c.c; } + }); + Object.keys(d$1).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { + enumerable: true, + get: function () { return d$1[k]; } + }); + }); + +})); diff --git a/test/form/samples/import-attributes/keeps-static-assertions/_expected/cjs.js b/test/form/samples/import-attributes/keeps-static-assertions/_expected/cjs.js new file mode 100644 index 000000000..edfd57fa1 --- /dev/null +++ b/test/form/samples/import-attributes/keeps-static-assertions/_expected/cjs.js @@ -0,0 +1,39 @@ +'use strict'; + +var a = require('a'); +var b = require('b'); +var c = require('c'); +var d$1 = require('d'); +require('unresolved'); + +function _interopNamespaceDefault(e) { + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { return e[k]; } + }); + } + }); + } + n.default = e; + return Object.freeze(n); +} + +var b__namespace = /*#__PURE__*/_interopNamespaceDefault(b); + +console.log(a.a, b__namespace, d); + +Object.defineProperty(exports, 'c', { + enumerable: true, + get: function () { return c.c; } +}); +Object.keys(d$1).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { + enumerable: true, + get: function () { return d$1[k]; } + }); +}); diff --git a/test/form/samples/import-attributes/keeps-static-assertions/_expected/es.js b/test/form/samples/import-attributes/keeps-static-assertions/_expected/es.js new file mode 100644 index 000000000..ba6c7ba45 --- /dev/null +++ b/test/form/samples/import-attributes/keeps-static-assertions/_expected/es.js @@ -0,0 +1,7 @@ +import { a } from 'a' assert { type: 'a', extra: 'extra' }; +import * as b from 'b' assert { type: 'b' }; +export { c } from 'c' assert { type: 'c' }; +export * from 'd' assert { type: 'd' }; +import 'unresolved' assert { type: 'e' }; + +console.log(a, b, d); diff --git a/test/form/samples/import-attributes/keeps-static-assertions/_expected/iife.js b/test/form/samples/import-attributes/keeps-static-assertions/_expected/iife.js new file mode 100644 index 000000000..bb4f140e1 --- /dev/null +++ b/test/form/samples/import-attributes/keeps-static-assertions/_expected/iife.js @@ -0,0 +1,38 @@ +var bundle = (function (exports, a, b, c, d$1) { + 'use strict'; + + function _interopNamespaceDefault(e) { + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { return e[k]; } + }); + } + }); + } + n.default = e; + return Object.freeze(n); + } + + var b__namespace = /*#__PURE__*/_interopNamespaceDefault(b); + + console.log(a.a, b__namespace, d); + + Object.defineProperty(exports, 'c', { + enumerable: true, + get: function () { return c.c; } + }); + Object.keys(d$1).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { + enumerable: true, + get: function () { return d$1[k]; } + }); + }); + + return exports; + +})({}, a, b, c, d$1); diff --git a/test/form/samples/import-attributes/keeps-static-assertions/_expected/system.js b/test/form/samples/import-attributes/keeps-static-assertions/_expected/system.js new file mode 100644 index 000000000..e1e3a6ae4 --- /dev/null +++ b/test/form/samples/import-attributes/keeps-static-assertions/_expected/system.js @@ -0,0 +1,28 @@ +System.register('bundle', ['a', 'b', 'c', 'd', 'unresolved'], (function (exports) { + 'use strict'; + var _starExcludes = { + default: 1, + c: 1 + }; + var a, b; + return { + setters: [function (module) { + a = module.a; + }, function (module) { + b = module; + }, function (module) { + exports('c', module.c); + }, function (module) { + var setter = {}; + for (var name in module) { + if (!_starExcludes[name]) setter[name] = module[name]; + } + exports(setter); + }, null], + execute: (function () { + + console.log(a, b, d); + + }) + }; +})); diff --git a/test/form/samples/import-attributes/keeps-static-assertions/_expected/umd.js b/test/form/samples/import-attributes/keeps-static-assertions/_expected/umd.js new file mode 100644 index 000000000..0b8de0fef --- /dev/null +++ b/test/form/samples/import-attributes/keeps-static-assertions/_expected/umd.js @@ -0,0 +1,39 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('a'), require('b'), require('c'), require('d'), require('unresolved')) : + typeof define === 'function' && define.amd ? define(['exports', 'a', 'b', 'c', 'd', 'unresolved'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {}, global.a, global.b, global.c, global.d$1)); +})(this, (function (exports, a, b, c, d$1) { 'use strict'; + + function _interopNamespaceDefault(e) { + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { return e[k]; } + }); + } + }); + } + n.default = e; + return Object.freeze(n); + } + + var b__namespace = /*#__PURE__*/_interopNamespaceDefault(b); + + console.log(a.a, b__namespace, d); + + Object.defineProperty(exports, 'c', { + enumerable: true, + get: function () { return c.c; } + }); + Object.keys(d$1).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { + enumerable: true, + get: function () { return d$1[k]; } + }); + }); + +})); diff --git a/test/form/samples/import-attributes/keeps-static-assertions/main.js b/test/form/samples/import-attributes/keeps-static-assertions/main.js new file mode 100644 index 000000000..02b154c86 --- /dev/null +++ b/test/form/samples/import-attributes/keeps-static-assertions/main.js @@ -0,0 +1,9 @@ +import { a } from 'a' assert { type: 'a', extra: 'extra' }; +import * as b from 'b' assert { type: 'b' }; +export { c } from 'c' assert { type: 'c' }; +export * from 'd' assert { type: 'd' }; +import 'unresolved' assert { type: 'e' }; + +console.log(a, b, d); + + diff --git a/test/form/samples/import-attributes/keeps-static-attributes/main.js b/test/form/samples/import-attributes/keeps-static-attributes/main.js index 02b154c86..645381650 100644 --- a/test/form/samples/import-attributes/keeps-static-attributes/main.js +++ b/test/form/samples/import-attributes/keeps-static-attributes/main.js @@ -1,8 +1,8 @@ -import { a } from 'a' assert { type: 'a', extra: 'extra' }; -import * as b from 'b' assert { type: 'b' }; -export { c } from 'c' assert { type: 'c' }; -export * from 'd' assert { type: 'd' }; -import 'unresolved' assert { type: 'e' }; +import { a } from 'a' with { type: 'a', extra: 'extra' }; +import * as b from 'b' with { type: 'b' }; +export { c } from 'c' with { type: 'c' }; +export * from 'd' with { type: 'd' }; +import 'unresolved' with { type: 'e' }; console.log(a, b, d); diff --git a/test/form/samples/import-attributes/plugin-attributes-resolvedynamicimport/main.js b/test/form/samples/import-attributes/plugin-attributes-resolvedynamicimport/main.js index 6d8a892a6..d4fd36770 100644 --- a/test/form/samples/import-attributes/plugin-attributes-resolvedynamicimport/main.js +++ b/test/form/samples/import-attributes/plugin-attributes-resolvedynamicimport/main.js @@ -1,4 +1,4 @@ -import('a', { assert: { type: 'special' } }); -import(globalThis.unknown, { assert: { type: 'special', extra: 'value' } }); +import('a', { with: { type: 'special' } }); +import(globalThis.unknown, { with: { type: 'special', extra: 'value' } }); import('b'); import(`external-${globalThis.unknown}`); diff --git a/test/form/samples/import-attributes/plugin-attributes-resolveid/main.js b/test/form/samples/import-attributes/plugin-attributes-resolveid/main.js index 7781ebfe7..239d32572 100644 --- a/test/form/samples/import-attributes/plugin-attributes-resolveid/main.js +++ b/test/form/samples/import-attributes/plugin-attributes-resolveid/main.js @@ -1,9 +1,9 @@ -import { a } from 'a' assert { type: 'a', extra: 'extra' }; -import * as b from 'b' assert { type: 'b' }; -export { c } from 'c' assert { type: 'c' }; -export * from 'd' assert { type: 'd' }; +import { a } from 'a' with { type: 'a', extra: 'extra' }; +import * as b from 'b' with { type: 'b' }; +export { c } from 'c' with { type: 'c' }; +export * from 'd' with { type: 'd' }; import 'e'; console.log(a, b, d); -import('f', { assert: { type: 'f' } }); +import('f', { with: { type: 'f' } }); import('g'); diff --git a/test/form/samples/import-attributes/removes-dynamic-attributes/main.js b/test/form/samples/import-attributes/removes-dynamic-attributes/main.js index 38bfed638..025b60451 100644 --- a/test/form/samples/import-attributes/removes-dynamic-attributes/main.js +++ b/test/form/samples/import-attributes/removes-dynamic-attributes/main.js @@ -1,6 +1,6 @@ -import('external', { assert: { type: 'special' } }); -import(globalThis.unknown, { assert: { type: 'special' } }); -import(`external-${globalThis.unknown}`, { assert: { type: 'special' } }); -import('external' + globalThis.unknown, { assert: { type: 'special' } }); -import('external-resolved', { assert: { type: 'special' } }); -import('unresolved', { assert: { type: 'special' } }); +import('external', { with: { type: 'special' } }); +import(globalThis.unknown, { with: { type: 'special' } }); +import(`external-${globalThis.unknown}`, { with: { type: 'special' } }); +import('external' + globalThis.unknown, { with: { type: 'special' } }); +import('external-resolved', { with: { type: 'special' } }); +import('unresolved', { with: { type: 'special' } }); diff --git a/test/form/samples/import-attributes/removes-static-attributes/main.js b/test/form/samples/import-attributes/removes-static-attributes/main.js index 02b154c86..645381650 100644 --- a/test/form/samples/import-attributes/removes-static-attributes/main.js +++ b/test/form/samples/import-attributes/removes-static-attributes/main.js @@ -1,8 +1,8 @@ -import { a } from 'a' assert { type: 'a', extra: 'extra' }; -import * as b from 'b' assert { type: 'b' }; -export { c } from 'c' assert { type: 'c' }; -export * from 'd' assert { type: 'd' }; -import 'unresolved' assert { type: 'e' }; +import { a } from 'a' with { type: 'a', extra: 'extra' }; +import * as b from 'b' with { type: 'b' }; +export { c } from 'c' with { type: 'c' }; +export * from 'd' with { type: 'd' }; +import 'unresolved' with { type: 'e' }; console.log(a, b, d); diff --git a/test/form/samples/supports-core-js/_expected.js b/test/form/samples/supports-core-js/_expected.js index 3935a61b9..0dfb82654 100644 --- a/test/form/samples/supports-core-js/_expected.js +++ b/test/form/samples/supports-core-js/_expected.js @@ -87,21 +87,21 @@ var functionUncurryThis = NATIVE_BIND$3 ? uncurryThisWithBind : function (fn) { }; }; -var uncurryThis$1T = functionUncurryThis; +var uncurryThis$1U = functionUncurryThis; -var toString$K = uncurryThis$1T({}.toString); -var stringSlice$l = uncurryThis$1T(''.slice); +var toString$L = uncurryThis$1U({}.toString); +var stringSlice$l = uncurryThis$1U(''.slice); var classofRaw$2 = function (it) { - return stringSlice$l(toString$K(it), 8, -1); + return stringSlice$l(toString$L(it), 8, -1); }; -var uncurryThis$1S = functionUncurryThis; +var uncurryThis$1T = functionUncurryThis; var fails$1r = fails$1u; var classof$r = classofRaw$2; var $Object$8 = Object; -var split$4 = uncurryThis$1S(''.split); +var split$4 = uncurryThis$1T(''.split); // fallback for non-array-like ES3 and non-enumerable old V8 strings var indexedObject = fails$1r(function () { @@ -125,7 +125,7 @@ var $TypeError$I = TypeError; // `RequireObjectCoercible` abstract operation // https://tc39.es/ecma262/#sec-requireobjectcoercible var requireObjectCoercible$p = function (it) { - if (isNullOrUndefined$j(it)) throw $TypeError$I("Can't call method on " + it); + if (isNullOrUndefined$j(it)) throw new $TypeError$I("Can't call method on " + it); return it; }; @@ -154,37 +154,37 @@ var documentAll$1 = $documentAll$1.all; // `IsCallable` abstract operation // https://tc39.es/ecma262/#sec-iscallable -var isCallable$K = $documentAll$1.IS_HTMLDDA ? function (argument) { +var isCallable$J = $documentAll$1.IS_HTMLDDA ? function (argument) { return typeof argument == 'function' || argument === documentAll$1; } : function (argument) { return typeof argument == 'function'; }; -var isCallable$J = isCallable$K; +var isCallable$I = isCallable$J; var $documentAll = documentAll_1; var documentAll = $documentAll.all; var isObject$K = $documentAll.IS_HTMLDDA ? function (it) { - return typeof it == 'object' ? it !== null : isCallable$J(it) || it === documentAll; + return typeof it == 'object' ? it !== null : isCallable$I(it) || it === documentAll; } : function (it) { - return typeof it == 'object' ? it !== null : isCallable$J(it); + return typeof it == 'object' ? it !== null : isCallable$I(it); }; var global$15 = global$16; -var isCallable$I = isCallable$K; +var isCallable$H = isCallable$J; var aFunction = function (argument) { - return isCallable$I(argument) ? argument : undefined; + return isCallable$H(argument) ? argument : undefined; }; var getBuiltIn$M = function (namespace, method) { return arguments.length < 2 ? aFunction(global$15[namespace]) : global$15[namespace] && global$15[namespace][method]; }; -var uncurryThis$1R = functionUncurryThis; +var uncurryThis$1S = functionUncurryThis; -var objectIsPrototypeOf = uncurryThis$1R({}.isPrototypeOf); +var objectIsPrototypeOf = uncurryThis$1S({}.isPrototypeOf); var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || ''; @@ -243,7 +243,7 @@ var useSymbolAsUid = NATIVE_SYMBOL$7 && typeof Symbol.iterator == 'symbol'; var getBuiltIn$L = getBuiltIn$M; -var isCallable$H = isCallable$K; +var isCallable$G = isCallable$J; var isPrototypeOf$e = objectIsPrototypeOf; var USE_SYMBOL_AS_UID$1 = useSymbolAsUid; @@ -253,7 +253,7 @@ var isSymbol$8 = USE_SYMBOL_AS_UID$1 ? function (it) { return typeof it == 'symbol'; } : function (it) { var $Symbol = getBuiltIn$L('Symbol'); - return isCallable$H($Symbol) && isPrototypeOf$e($Symbol.prototype, $Object$7(it)); + return isCallable$G($Symbol) && isPrototypeOf$e($Symbol.prototype, $Object$7(it)); }; var $String$8 = String; @@ -266,15 +266,15 @@ var tryToString$7 = function (argument) { } }; -var isCallable$G = isCallable$K; +var isCallable$F = isCallable$J; var tryToString$6 = tryToString$7; var $TypeError$H = TypeError; // `Assert: IsCallable(argument) is true` var aCallable$N = function (argument) { - if (isCallable$G(argument)) return argument; - throw $TypeError$H(tryToString$6(argument) + ' is not a function'); + if (isCallable$F(argument)) return argument; + throw new $TypeError$H(tryToString$6(argument) + ' is not a function'); }; var aCallable$M = aCallable$N; @@ -288,7 +288,7 @@ var getMethod$l = function (V, P) { }; var call$1h = functionCall; -var isCallable$F = isCallable$K; +var isCallable$E = isCallable$J; var isObject$J = isObject$K; var $TypeError$G = TypeError; @@ -297,10 +297,10 @@ var $TypeError$G = TypeError; // https://tc39.es/ecma262/#sec-ordinarytoprimitive var ordinaryToPrimitive$2 = function (input, pref) { var fn, val; - if (pref === 'string' && isCallable$F(fn = input.toString) && !isObject$J(val = call$1h(fn, input))) return val; - if (isCallable$F(fn = input.valueOf) && !isObject$J(val = call$1h(fn, input))) return val; - if (pref !== 'string' && isCallable$F(fn = input.toString) && !isObject$J(val = call$1h(fn, input))) return val; - throw $TypeError$G("Can't convert object to primitive value"); + if (pref === 'string' && isCallable$E(fn = input.toString) && !isObject$J(val = call$1h(fn, input))) return val; + if (isCallable$E(fn = input.valueOf) && !isObject$J(val = call$1h(fn, input))) return val; + if (pref !== 'string' && isCallable$E(fn = input.toString) && !isObject$J(val = call$1h(fn, input))) return val; + throw new $TypeError$G("Can't convert object to primitive value"); }; var shared$b = {exports: {}}; @@ -333,10 +333,10 @@ var store$4 = sharedStore; (shared$b.exports = function (key, value) { return store$4[key] || (store$4[key] = value !== undefined ? value : {}); })('versions', []).push({ - version: '3.32.2', + version: '3.33.0', mode: 'global', copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)', - license: 'https://github.com/zloirock/core-js/blob/v3.32.2/LICENSE', + license: 'https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE', source: 'https://github.com/zloirock/core-js' }); @@ -352,10 +352,10 @@ var toObject$D = function (argument) { return $Object$6(requireObjectCoercible$n(argument)); }; -var uncurryThis$1Q = functionUncurryThis; +var uncurryThis$1R = functionUncurryThis; var toObject$C = toObject$D; -var hasOwnProperty = uncurryThis$1Q({}.hasOwnProperty); +var hasOwnProperty = uncurryThis$1R({}.hasOwnProperty); // `HasOwnProperty` abstract operation // https://tc39.es/ecma262/#sec-hasownproperty @@ -364,14 +364,14 @@ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) { return hasOwnProperty(toObject$C(it), key); }; -var uncurryThis$1P = functionUncurryThis; +var uncurryThis$1Q = functionUncurryThis; var id$2 = 0; var postfix = Math.random(); -var toString$J = uncurryThis$1P(1.0.toString); +var toString$K = uncurryThis$1Q(1.0.toString); var uid$7 = function (key) { - return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$J(++id$2 + postfix, 36); + return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$K(++id$2 + postfix, 36); }; var global$10 = global$16; @@ -385,7 +385,7 @@ var Symbol$7 = global$10.Symbol; var WellKnownSymbolsStore$2 = shared$a('wks'); var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$7['for'] || Symbol$7 : Symbol$7 && Symbol$7.withoutSetter || uid$6; -var wellKnownSymbol$T = function (name) { +var wellKnownSymbol$S = function (name) { if (!hasOwn$F(WellKnownSymbolsStore$2, name)) { WellKnownSymbolsStore$2[name] = NATIVE_SYMBOL$6 && hasOwn$F(Symbol$7, name) ? Symbol$7[name] @@ -398,10 +398,10 @@ var isObject$I = isObject$K; var isSymbol$7 = isSymbol$8; var getMethod$k = getMethod$l; var ordinaryToPrimitive$1 = ordinaryToPrimitive$2; -var wellKnownSymbol$S = wellKnownSymbol$T; +var wellKnownSymbol$R = wellKnownSymbol$S; var $TypeError$F = TypeError; -var TO_PRIMITIVE$1 = wellKnownSymbol$S('toPrimitive'); +var TO_PRIMITIVE$1 = wellKnownSymbol$R('toPrimitive'); // `ToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-toprimitive @@ -413,7 +413,7 @@ var toPrimitive$4 = function (input, pref) { if (pref === undefined) pref = 'default'; result = call$1g(exoticToPrim, input, pref); if (!isObject$I(result) || isSymbol$7(result)) return result; - throw $TypeError$F("Can't convert object to primitive value"); + throw new $TypeError$F("Can't convert object to primitive value"); } if (pref === undefined) pref = 'number'; return ordinaryToPrimitive$1(input, pref); @@ -498,7 +498,7 @@ var $TypeError$E = TypeError; // `Assert: Type(argument) is Object` var anObject$1f = function (argument) { if (isObject$G(argument)) return argument; - throw $TypeError$E($String$7(argument) + ' is not an object'); + throw new $TypeError$E($String$7(argument) + ' is not an object'); }; var DESCRIPTORS$P = descriptors; @@ -540,7 +540,7 @@ objectDefineProperty.f = DESCRIPTORS$P ? V8_PROTOTYPE_DEFINE_BUG$1 ? function de if (IE8_DOM_DEFINE) try { return $defineProperty$1(O, P, Attributes); } catch (error) { /* empty */ } - if ('get' in Attributes || 'set' in Attributes) throw $TypeError$D('Accessors not supported'); + if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$D('Accessors not supported'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; @@ -576,14 +576,14 @@ var functionName = { CONFIGURABLE: CONFIGURABLE }; -var uncurryThis$1O = functionUncurryThis; -var isCallable$E = isCallable$K; +var uncurryThis$1P = functionUncurryThis; +var isCallable$D = isCallable$J; var store$3 = sharedStore; -var functionToString$1 = uncurryThis$1O(Function.toString); +var functionToString$1 = uncurryThis$1P(Function.toString); // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper -if (!isCallable$E(store$3.inspectSource)) { +if (!isCallable$D(store$3.inspectSource)) { store$3.inspectSource = function (it) { return functionToString$1(it); }; @@ -592,11 +592,11 @@ if (!isCallable$E(store$3.inspectSource)) { var inspectSource$4 = store$3.inspectSource; var global$_ = global$16; -var isCallable$D = isCallable$K; +var isCallable$C = isCallable$J; var WeakMap$5 = global$_.WeakMap; -var weakMapBasicDetection = isCallable$D(WeakMap$5) && /native code/.test(String(WeakMap$5)); +var weakMapBasicDetection = isCallable$C(WeakMap$5) && /native code/.test(String(WeakMap$5)); var shared$9 = sharedExports; var uid$5 = uid$7; @@ -631,7 +631,7 @@ var getterFor$2 = function (TYPE) { return function (it) { var state; if (!isObject$F(it) || (state = get$6(it)).type !== TYPE) { - throw TypeError$9('Incompatible receiver, ' + TYPE + ' required'); + throw new TypeError$9('Incompatible receiver, ' + TYPE + ' required'); } return state; }; }; @@ -644,7 +644,7 @@ if (NATIVE_WEAK_MAP$1 || shared$8.state) { store$2.set = store$2.set; /* eslint-enable no-self-assign -- prototype methods protection */ set$b = function (it, metadata) { - if (store$2.has(it)) throw TypeError$9(OBJECT_ALREADY_INITIALIZED); + if (store$2.has(it)) throw new TypeError$9(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; store$2.set(it, metadata); return metadata; @@ -659,7 +659,7 @@ if (NATIVE_WEAK_MAP$1 || shared$8.state) { var STATE = sharedKey$3('state'); hiddenKeys$5[STATE] = true; set$b = function (it, metadata) { - if (hasOwn$C(it, STATE)) throw TypeError$9(OBJECT_ALREADY_INITIALIZED); + if (hasOwn$C(it, STATE)) throw new TypeError$9(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; createNonEnumerableProperty$j(it, STATE, metadata); return metadata; @@ -680,9 +680,9 @@ var internalState = { getterFor: getterFor$2 }; -var uncurryThis$1N = functionUncurryThis; +var uncurryThis$1O = functionUncurryThis; var fails$1n = fails$1u; -var isCallable$C = isCallable$K; +var isCallable$B = isCallable$J; var hasOwn$B = hasOwnProperty_1; var DESCRIPTORS$M = descriptors; var CONFIGURABLE_FUNCTION_NAME$2 = functionName.CONFIGURABLE; @@ -694,9 +694,9 @@ var getInternalState$g = InternalStateModule$n.get; var $String$6 = String; // eslint-disable-next-line es/no-object-defineproperty -- safe var defineProperty$h = Object.defineProperty; -var stringSlice$k = uncurryThis$1N(''.slice); -var replace$c = uncurryThis$1N(''.replace); -var join$9 = uncurryThis$1N([].join); +var stringSlice$k = uncurryThis$1O(''.slice); +var replace$d = uncurryThis$1O(''.replace); +var join$9 = uncurryThis$1O([].join); var CONFIGURABLE_LENGTH = DESCRIPTORS$M && !fails$1n(function () { return defineProperty$h(function () { /* empty */ }, 'length', { value: 8 }).length !== 8; @@ -706,7 +706,7 @@ var TEMPLATE = String(String).split('String'); var makeBuiltIn$4 = makeBuiltIn$5.exports = function (value, name, options) { if (stringSlice$k($String$6(name), 0, 7) === 'Symbol(') { - name = '[' + replace$c($String$6(name), /^Symbol\(([^)]*)\)/, '$1') + ']'; + name = '[' + replace$d($String$6(name), /^Symbol\(([^)]*)\)/, '$1') + ']'; } if (options && options.getter) name = 'get ' + name; if (options && options.setter) name = 'set ' + name; @@ -732,12 +732,12 @@ var makeBuiltIn$4 = makeBuiltIn$5.exports = function (value, name, options) { // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative // eslint-disable-next-line no-extend-native -- required Function.prototype.toString = makeBuiltIn$4(function toString() { - return isCallable$C(this) && getInternalState$g(this).source || inspectSource$3(this); + return isCallable$B(this) && getInternalState$g(this).source || inspectSource$3(this); }, 'toString'); var makeBuiltInExports = makeBuiltIn$5.exports; -var isCallable$B = isCallable$K; +var isCallable$A = isCallable$J; var definePropertyModule$a = objectDefineProperty; var makeBuiltIn$3 = makeBuiltInExports; var defineGlobalProperty$1 = defineGlobalProperty$3; @@ -746,7 +746,7 @@ var defineBuiltIn$u = function (O, key, value, options) { if (!options) options = {}; var simple = options.enumerable; var name = options.name !== undefined ? options.name : key; - if (isCallable$B(value)) makeBuiltIn$3(value, name, options); + if (isCallable$A(value)) makeBuiltIn$3(value, name, options); if (options.global) { if (simple) O[key] = value; else defineGlobalProperty$1(key, value); @@ -778,14 +778,14 @@ var mathTrunc = Math.trunc || function trunc(x) { return (n > 0 ? floor$a : ceil$1)(n); }; -var trunc$2 = mathTrunc; +var trunc$1 = mathTrunc; // `ToIntegerOrInfinity` abstract operation // https://tc39.es/ecma262/#sec-tointegerorinfinity var toIntegerOrInfinity$p = function (argument) { var number = +argument; // eslint-disable-next-line no-self-compare -- NaN check - return number !== number || number === 0 ? 0 : trunc$2(number); + return number !== number || number === 0 ? 0 : trunc$1(number); }; var toIntegerOrInfinity$o = toIntegerOrInfinity$p; @@ -852,13 +852,13 @@ var arrayIncludes = { indexOf: createMethod$8(false) }; -var uncurryThis$1M = functionUncurryThis; +var uncurryThis$1N = functionUncurryThis; var hasOwn$A = hasOwnProperty_1; var toIndexedObject$h = toIndexedObject$k; var indexOf$2 = arrayIncludes.indexOf; var hiddenKeys$4 = hiddenKeys$6; -var push$s = uncurryThis$1M([].push); +var push$s = uncurryThis$1N([].push); var objectKeysInternal = function (object, names) { var O = toIndexedObject$h(object); @@ -902,12 +902,12 @@ var objectGetOwnPropertySymbols = {}; objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols; var getBuiltIn$K = getBuiltIn$M; -var uncurryThis$1L = functionUncurryThis; +var uncurryThis$1M = functionUncurryThis; var getOwnPropertyNamesModule$2 = objectGetOwnPropertyNames; var getOwnPropertySymbolsModule$3 = objectGetOwnPropertySymbols; var anObject$1d = anObject$1f; -var concat$4 = uncurryThis$1L([].concat); +var concat$4 = uncurryThis$1M([].concat); // all object keys, includes non-enumerable and symbols var ownKeys$3 = getBuiltIn$K('Reflect', 'ownKeys') || function ownKeys(it) { @@ -934,7 +934,7 @@ var copyConstructorProperties$6 = function (target, source, exceptions) { }; var fails$1m = fails$1u; -var isCallable$A = isCallable$K; +var isCallable$z = isCallable$J; var replacement = /#|\.prototype\./; @@ -942,7 +942,7 @@ var isForced$5 = function (feature, detection) { var value = data[normalize(feature)]; return value === POLYFILL ? true : value === NATIVE ? false - : isCallable$A(detection) ? fails$1m(detection) + : isCallable$z(detection) ? fails$1m(detection) : !!detection; }; @@ -1011,9 +1011,9 @@ var _export = function (options, source) { } }; -var wellKnownSymbol$R = wellKnownSymbol$T; +var wellKnownSymbol$Q = wellKnownSymbol$S; -var TO_STRING_TAG$c = wellKnownSymbol$R('toStringTag'); +var TO_STRING_TAG$c = wellKnownSymbol$Q('toStringTag'); var test$2 = {}; test$2[TO_STRING_TAG$c] = 'z'; @@ -1021,11 +1021,11 @@ test$2[TO_STRING_TAG$c] = 'z'; var toStringTagSupport = String(test$2) === '[object z]'; var TO_STRING_TAG_SUPPORT$2 = toStringTagSupport; -var isCallable$z = isCallable$K; +var isCallable$y = isCallable$J; var classofRaw$1 = classofRaw$2; -var wellKnownSymbol$Q = wellKnownSymbol$T; +var wellKnownSymbol$P = wellKnownSymbol$S; -var TO_STRING_TAG$b = wellKnownSymbol$Q('toStringTag'); +var TO_STRING_TAG$b = wellKnownSymbol$P('toStringTag'); var $Object$5 = Object; // ES3 wrong here @@ -1047,15 +1047,15 @@ var classof$q = TO_STRING_TAG_SUPPORT$2 ? classofRaw$1 : function (it) { // builtinTag case : CORRECT_ARGUMENTS ? classofRaw$1(O) // ES3 arguments fallback - : (result = classofRaw$1(O)) === 'Object' && isCallable$z(O.callee) ? 'Arguments' : result; + : (result = classofRaw$1(O)) === 'Object' && isCallable$y(O.callee) ? 'Arguments' : result; }; var classof$p = classof$q; var $String$5 = String; -var toString$I = function (argument) { - if (classof$p(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string'); +var toString$J = function (argument) { + if (classof$p(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string'); return $String$5(argument); }; @@ -1245,9 +1245,9 @@ var defineBuiltInAccessor$o = function (target, name, descriptor) { var wellKnownSymbolWrapped = {}; -var wellKnownSymbol$P = wellKnownSymbol$T; +var wellKnownSymbol$O = wellKnownSymbol$S; -wellKnownSymbolWrapped.f = wellKnownSymbol$P; +wellKnownSymbolWrapped.f = wellKnownSymbol$O; var global$X = global$16; @@ -1267,14 +1267,14 @@ var wellKnownSymbolDefine = function (NAME) { var call$1e = functionCall; var getBuiltIn$I = getBuiltIn$M; -var wellKnownSymbol$O = wellKnownSymbol$T; +var wellKnownSymbol$N = wellKnownSymbol$S; var defineBuiltIn$s = defineBuiltIn$u; var symbolDefineToPrimitive = function () { var Symbol = getBuiltIn$I('Symbol'); var SymbolPrototype = Symbol && Symbol.prototype; var valueOf = SymbolPrototype && SymbolPrototype.valueOf; - var TO_PRIMITIVE = wellKnownSymbol$O('toPrimitive'); + var TO_PRIMITIVE = wellKnownSymbol$N('toPrimitive'); if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) { // `Symbol.prototype[@@toPrimitive]` method @@ -1288,9 +1288,9 @@ var symbolDefineToPrimitive = function () { var defineProperty$e = objectDefineProperty.f; var hasOwn$x = hasOwnProperty_1; -var wellKnownSymbol$N = wellKnownSymbol$T; +var wellKnownSymbol$M = wellKnownSymbol$S; -var TO_STRING_TAG$a = wellKnownSymbol$N('toStringTag'); +var TO_STRING_TAG$a = wellKnownSymbol$M('toStringTag'); var setToStringTag$d = function (target, TAG, STATIC) { if (target && !STATIC) target = target.prototype; @@ -1300,20 +1300,20 @@ var setToStringTag$d = function (target, TAG, STATIC) { }; var classofRaw = classofRaw$2; -var uncurryThis$1K = functionUncurryThis; +var uncurryThis$1L = functionUncurryThis; var functionUncurryThisClause = function (fn) { // Nashorn bug: // https://github.com/zloirock/core-js/issues/1128 // https://github.com/zloirock/core-js/issues/1130 - if (classofRaw(fn) === 'Function') return uncurryThis$1K(fn); + if (classofRaw(fn) === 'Function') return uncurryThis$1L(fn); }; -var uncurryThis$1J = functionUncurryThisClause; +var uncurryThis$1K = functionUncurryThisClause; var aCallable$L = aCallable$N; var NATIVE_BIND$2 = functionBindNative; -var bind$v = uncurryThis$1J(uncurryThis$1J.bind); +var bind$v = uncurryThis$1K(uncurryThis$1K.bind); // optional / simple context binding var functionBindContext = function (fn, that) { @@ -1332,9 +1332,9 @@ var isArray$b = Array.isArray || function isArray(argument) { return classof$n(argument) === 'Array'; }; -var uncurryThis$1I = functionUncurryThis; +var uncurryThis$1J = functionUncurryThis; var fails$1l = fails$1u; -var isCallable$y = isCallable$K; +var isCallable$x = isCallable$J; var classof$m = classof$q; var getBuiltIn$H = getBuiltIn$M; var inspectSource$2 = inspectSource$4; @@ -1343,11 +1343,11 @@ var noop = function () { /* empty */ }; var empty = []; var construct$1 = getBuiltIn$H('Reflect', 'construct'); var constructorRegExp = /^\s*(?:class|function)\b/; -var exec$g = uncurryThis$1I(constructorRegExp.exec); -var INCORRECT_TO_STRING$2 = !constructorRegExp.exec(noop); +var exec$g = uncurryThis$1J(constructorRegExp.exec); +var INCORRECT_TO_STRING$2 = !constructorRegExp.test(noop); var isConstructorModern = function isConstructor(argument) { - if (!isCallable$y(argument)) return false; + if (!isCallable$x(argument)) return false; try { construct$1(noop, empty, argument); return true; @@ -1357,7 +1357,7 @@ var isConstructorModern = function isConstructor(argument) { }; var isConstructorLegacy = function isConstructor(argument) { - if (!isCallable$y(argument)) return false; + if (!isCallable$x(argument)) return false; switch (classof$m(argument)) { case 'AsyncFunction': case 'GeneratorFunction': @@ -1388,9 +1388,9 @@ var isConstructor$a = !construct$1 || fails$1l(function () { var isArray$a = isArray$b; var isConstructor$9 = isConstructor$a; var isObject$E = isObject$K; -var wellKnownSymbol$M = wellKnownSymbol$T; +var wellKnownSymbol$L = wellKnownSymbol$S; -var SPECIES$6 = wellKnownSymbol$M('species'); +var SPECIES$6 = wellKnownSymbol$L('species'); var $Array$b = Array; // a part of `ArraySpeciesCreate` abstract operation @@ -1417,13 +1417,13 @@ var arraySpeciesCreate$5 = function (originalArray, length) { }; var bind$u = functionBindContext; -var uncurryThis$1H = functionUncurryThis; +var uncurryThis$1I = functionUncurryThis; var IndexedObject$6 = indexedObject; var toObject$B = toObject$D; var lengthOfArrayLike$z = lengthOfArrayLike$C; var arraySpeciesCreate$4 = arraySpeciesCreate$5; -var push$r = uncurryThis$1H([].push); +var push$r = uncurryThis$1I([].push); // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation var createMethod$7 = function (TYPE) { @@ -1490,10 +1490,10 @@ var arrayIteration = { filterReject: createMethod$7(7) }; -var $$5q = _export; +var $$5r = _export; var global$W = global$16; var call$1d = functionCall; -var uncurryThis$1G = functionUncurryThis; +var uncurryThis$1H = functionUncurryThis; var DESCRIPTORS$K = descriptors; var NATIVE_SYMBOL$5 = symbolConstructorDetection; var fails$1k = fails$1u; @@ -1502,7 +1502,7 @@ var isPrototypeOf$d = objectIsPrototypeOf; var anObject$1a = anObject$1f; var toIndexedObject$e = toIndexedObject$k; var toPropertyKey$6 = toPropertyKey$a; -var $toString$3 = toString$I; +var $toString$3 = toString$J; var createPropertyDescriptor$9 = createPropertyDescriptor$d; var nativeObjectCreate = objectCreate$1; var objectKeys$4 = objectKeys$6; @@ -1519,7 +1519,7 @@ var shared$7 = sharedExports; var sharedKey$1 = sharedKey$4; var hiddenKeys$1 = hiddenKeys$6; var uid$4 = uid$7; -var wellKnownSymbol$L = wellKnownSymbol$T; +var wellKnownSymbol$K = wellKnownSymbol$S; var wrappedWellKnownSymbolModule = wellKnownSymbolWrapped; var defineWellKnownSymbol$l = wellKnownSymbolDefine; var defineSymbolToPrimitive$1 = symbolDefineToPrimitive; @@ -1537,13 +1537,14 @@ var getInternalState$f = InternalStateModule$m.getterFor(SYMBOL); var ObjectPrototype$5 = Object[PROTOTYPE$1]; var $Symbol = global$W.Symbol; var SymbolPrototype$1 = $Symbol && $Symbol[PROTOTYPE$1]; +var RangeError$5 = global$W.RangeError; var TypeError$8 = global$W.TypeError; var QObject = global$W.QObject; var nativeGetOwnPropertyDescriptor$2 = getOwnPropertyDescriptorModule$5.f; var nativeDefineProperty$1 = definePropertyModule$6.f; var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f; var nativePropertyIsEnumerable = propertyIsEnumerableModule$1.f; -var push$q = uncurryThis$1G([].push); +var push$q = uncurryThis$1H([].push); var AllSymbols = shared$7('symbols'); var ObjectPrototypeSymbols = shared$7('op-symbols'); @@ -1553,18 +1554,20 @@ var WellKnownSymbolsStore$1 = shared$7('wks'); var USE_SETTER = !QObject || !QObject[PROTOTYPE$1] || !QObject[PROTOTYPE$1].findChild; // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 -var setSymbolDescriptor = DESCRIPTORS$K && fails$1k(function () { - return nativeObjectCreate(nativeDefineProperty$1({}, 'a', { - get: function () { return nativeDefineProperty$1(this, 'a', { value: 7 }).a; } - })).a !== 7; -}) ? function (O, P, Attributes) { +var fallbackDefineProperty = function (O, P, Attributes) { var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor$2(ObjectPrototype$5, P); if (ObjectPrototypeDescriptor) delete ObjectPrototype$5[P]; nativeDefineProperty$1(O, P, Attributes); if (ObjectPrototypeDescriptor && O !== ObjectPrototype$5) { nativeDefineProperty$1(ObjectPrototype$5, P, ObjectPrototypeDescriptor); } -} : nativeDefineProperty$1; +}; + +var setSymbolDescriptor = DESCRIPTORS$K && fails$1k(function () { + return nativeObjectCreate(nativeDefineProperty$1({}, 'a', { + get: function () { return nativeDefineProperty$1(this, 'a', { value: 7 }).a; } + })).a !== 7; +}) ? fallbackDefineProperty : nativeDefineProperty$1; var wrap = function (tag, description) { var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype$1); @@ -1651,13 +1654,19 @@ var $getOwnPropertySymbols = function (O) { // https://tc39.es/ecma262/#sec-symbol-constructor if (!NATIVE_SYMBOL$5) { $Symbol = function Symbol() { - if (isPrototypeOf$d(SymbolPrototype$1, this)) throw TypeError$8('Symbol is not a constructor'); + if (isPrototypeOf$d(SymbolPrototype$1, this)) throw new TypeError$8('Symbol is not a constructor'); var description = !arguments.length || arguments[0] === undefined ? undefined : $toString$3(arguments[0]); var tag = uid$4(description); var setter = function (value) { if (this === ObjectPrototype$5) call$1d(setter, ObjectPrototypeSymbols, value); if (hasOwn$w(this, HIDDEN) && hasOwn$w(this[HIDDEN], tag)) this[HIDDEN][tag] = false; - setSymbolDescriptor(this, tag, createPropertyDescriptor$9(1, value)); + var descriptor = createPropertyDescriptor$9(1, value); + try { + setSymbolDescriptor(this, tag, descriptor); + } catch (error) { + if (!(error instanceof RangeError$5)) throw error; + fallbackDefineProperty(this, tag, descriptor); + } }; if (DESCRIPTORS$K && USE_SETTER) setSymbolDescriptor(ObjectPrototype$5, tag, { configurable: true, set: setter }); return wrap(tag, description); @@ -1681,7 +1690,7 @@ if (!NATIVE_SYMBOL$5) { getOwnPropertySymbolsModule$2.f = $getOwnPropertySymbols; wrappedWellKnownSymbolModule.f = function (name) { - return wrap(wellKnownSymbol$L(name), name); + return wrap(wellKnownSymbol$K(name), name); }; if (DESCRIPTORS$K) { @@ -1698,7 +1707,7 @@ if (!NATIVE_SYMBOL$5) { } } -$$5q({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL$5, sham: !NATIVE_SYMBOL$5 }, { +$$5r({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL$5, sham: !NATIVE_SYMBOL$5 }, { Symbol: $Symbol }); @@ -1706,12 +1715,12 @@ $forEach$3(objectKeys$4(WellKnownSymbolsStore$1), function (name) { defineWellKnownSymbol$l(name); }); -$$5q({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL$5 }, { +$$5r({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL$5 }, { useSetter: function () { USE_SETTER = true; }, useSimple: function () { USE_SETTER = false; } }); -$$5q({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL$5, sham: !DESCRIPTORS$K }, { +$$5r({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL$5, sham: !DESCRIPTORS$K }, { // `Object.create` method // https://tc39.es/ecma262/#sec-object.create create: $create, @@ -1726,7 +1735,7 @@ $$5q({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL$5, sham: !DESCRIPTOR getOwnPropertyDescriptor: $getOwnPropertyDescriptor }); -$$5q({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL$5 }, { +$$5r({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL$5 }, { // `Object.getOwnPropertyNames` method // https://tc39.es/ecma262/#sec-object.getownpropertynames getOwnPropertyNames: $getOwnPropertyNames @@ -1747,10 +1756,10 @@ var NATIVE_SYMBOL$4 = symbolConstructorDetection; /* eslint-disable es/no-symbol -- safe */ var symbolRegistryDetection = NATIVE_SYMBOL$4 && !!Symbol['for'] && !!Symbol.keyFor; -var $$5p = _export; +var $$5q = _export; var getBuiltIn$G = getBuiltIn$M; var hasOwn$v = hasOwnProperty_1; -var toString$H = toString$I; +var toString$I = toString$J; var shared$6 = sharedExports; var NATIVE_SYMBOL_REGISTRY$1 = symbolRegistryDetection; @@ -1759,9 +1768,9 @@ var SymbolToStringRegistry$1 = shared$6('symbol-to-string-registry'); // `Symbol.for` method // https://tc39.es/ecma262/#sec-symbol.for -$$5p({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY$1 }, { +$$5q({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY$1 }, { 'for': function (key) { - var string = toString$H(key); + var string = toString$I(key); if (hasOwn$v(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string]; var symbol = getBuiltIn$G('Symbol')(string); StringToSymbolRegistry[string] = symbol; @@ -1770,7 +1779,7 @@ $$5p({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY$1 }, { } }); -var $$5o = _export; +var $$5p = _export; var hasOwn$u = hasOwnProperty_1; var isSymbol$5 = isSymbol$8; var tryToString$5 = tryToString$7; @@ -1781,9 +1790,9 @@ var SymbolToStringRegistry = shared$5('symbol-to-string-registry'); // `Symbol.keyFor` method // https://tc39.es/ecma262/#sec-symbol.keyfor -$$5o({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, { +$$5p({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, { keyFor: function keyFor(sym) { - if (!isSymbol$5(sym)) throw TypeError(tryToString$5(sym) + ' is not a symbol'); + if (!isSymbol$5(sym)) throw new TypeError(tryToString$5(sym) + ' is not a symbol'); if (hasOwn$u(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym]; } }); @@ -1799,27 +1808,27 @@ var functionApply$1 = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIN return call$1c.apply(apply$e, arguments); }); -var uncurryThis$1F = functionUncurryThis; +var uncurryThis$1G = functionUncurryThis; -var arraySlice$b = uncurryThis$1F([].slice); +var arraySlice$b = uncurryThis$1G([].slice); -var uncurryThis$1E = functionUncurryThis; +var uncurryThis$1F = functionUncurryThis; var isArray$9 = isArray$b; -var isCallable$x = isCallable$K; +var isCallable$w = isCallable$J; var classof$l = classofRaw$2; -var toString$G = toString$I; +var toString$H = toString$J; -var push$p = uncurryThis$1E([].push); +var push$p = uncurryThis$1F([].push); var getJsonReplacerFunction = function (replacer) { - if (isCallable$x(replacer)) return replacer; + if (isCallable$w(replacer)) return replacer; if (!isArray$9(replacer)) return; var rawLength = replacer.length; var keys = []; for (var i = 0; i < rawLength; i++) { var element = replacer[i]; if (typeof element == 'string') push$p(keys, element); - else if (typeof element == 'number' || classof$l(element) === 'Number' || classof$l(element) === 'String') push$p(keys, toString$G(element)); + else if (typeof element == 'number' || classof$l(element) === 'Number' || classof$l(element) === 'String') push$p(keys, toString$H(element)); } var keysLength = keys.length; var root = true; @@ -1833,13 +1842,13 @@ var getJsonReplacerFunction = function (replacer) { }; }; -var $$5n = _export; +var $$5o = _export; var getBuiltIn$F = getBuiltIn$M; var apply$d = functionApply$1; var call$1b = functionCall; -var uncurryThis$1D = functionUncurryThis; +var uncurryThis$1E = functionUncurryThis; var fails$1j = fails$1u; -var isCallable$w = isCallable$K; +var isCallable$v = isCallable$J; var isSymbol$4 = isSymbol$8; var arraySlice$a = arraySlice$b; var getReplacerFunction$1 = getJsonReplacerFunction; @@ -1847,11 +1856,11 @@ var NATIVE_SYMBOL$3 = symbolConstructorDetection; var $String$4 = String; var $stringify$1 = getBuiltIn$F('JSON', 'stringify'); -var exec$f = uncurryThis$1D(/./.exec); -var charAt$k = uncurryThis$1D(''.charAt); -var charCodeAt$8 = uncurryThis$1D(''.charCodeAt); -var replace$b = uncurryThis$1D(''.replace); -var numberToString$3 = uncurryThis$1D(1.0.toString); +var exec$f = uncurryThis$1E(/./.exec); +var charAt$k = uncurryThis$1E(''.charAt); +var charCodeAt$9 = uncurryThis$1E(''.charCodeAt); +var replace$c = uncurryThis$1E(''.replace); +var numberToString$3 = uncurryThis$1E(1.0.toString); var tester = /[\uD800-\uDFFF]/g; var low = /^[\uD800-\uDBFF]$/; @@ -1876,10 +1885,10 @@ var ILL_FORMED_UNICODE = fails$1j(function () { var stringifyWithSymbolsFix = function (it, replacer) { var args = arraySlice$a(arguments); var $replacer = getReplacerFunction$1(replacer); - if (!isCallable$w($replacer) && (it === undefined || isSymbol$4(it))) return; // IE8 returns string on undefined + if (!isCallable$v($replacer) && (it === undefined || isSymbol$4(it))) return; // IE8 returns string on undefined args[1] = function (key, value) { // some old implementations (like WebKit) could pass numbers as keys - if (isCallable$w($replacer)) value = call$1b($replacer, this, $String$4(key), value); + if (isCallable$v($replacer)) value = call$1b($replacer, this, $String$4(key), value); if (!isSymbol$4(value)) return value; }; return apply$d($stringify$1, null, args); @@ -1889,24 +1898,24 @@ var fixIllFormed = function (match, offset, string) { var prev = charAt$k(string, offset - 1); var next = charAt$k(string, offset + 1); if ((exec$f(low, match) && !exec$f(hi, next)) || (exec$f(hi, match) && !exec$f(low, prev))) { - return '\\u' + numberToString$3(charCodeAt$8(match, 0), 16); + return '\\u' + numberToString$3(charCodeAt$9(match, 0), 16); } return match; }; if ($stringify$1) { // `JSON.stringify` method // https://tc39.es/ecma262/#sec-json.stringify - $$5n({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, { + $$5o({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, { // eslint-disable-next-line no-unused-vars -- required for `.length` stringify: function stringify(it, replacer, space) { var args = arraySlice$a(arguments); var result = apply$d(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify$1, null, args); - return ILL_FORMED_UNICODE && typeof result == 'string' ? replace$b(result, tester, fixIllFormed) : result; + return ILL_FORMED_UNICODE && typeof result == 'string' ? replace$c(result, tester, fixIllFormed) : result; } }); } -var $$5m = _export; +var $$5n = _export; var NATIVE_SYMBOL$2 = symbolConstructorDetection; var fails$1i = fails$1u; var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols; @@ -1918,35 +1927,35 @@ var FORCED$E = !NATIVE_SYMBOL$2 || fails$1i(function () { getOwnPropertySymbolsM // `Object.getOwnPropertySymbols` method // https://tc39.es/ecma262/#sec-object.getownpropertysymbols -$$5m({ target: 'Object', stat: true, forced: FORCED$E }, { +$$5n({ target: 'Object', stat: true, forced: FORCED$E }, { getOwnPropertySymbols: function getOwnPropertySymbols(it) { var $getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f; return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject$A(it)) : []; } }); -var $$5l = _export; +var $$5m = _export; var DESCRIPTORS$J = descriptors; var global$V = global$16; -var uncurryThis$1C = functionUncurryThis; +var uncurryThis$1D = functionUncurryThis; var hasOwn$t = hasOwnProperty_1; -var isCallable$v = isCallable$K; +var isCallable$u = isCallable$J; var isPrototypeOf$c = objectIsPrototypeOf; -var toString$F = toString$I; +var toString$G = toString$J; var defineBuiltInAccessor$m = defineBuiltInAccessor$o; var copyConstructorProperties$4 = copyConstructorProperties$6; var NativeSymbol = global$V.Symbol; var SymbolPrototype = NativeSymbol && NativeSymbol.prototype; -if (DESCRIPTORS$J && isCallable$v(NativeSymbol) && (!('description' in SymbolPrototype) || +if (DESCRIPTORS$J && isCallable$u(NativeSymbol) && (!('description' in SymbolPrototype) || // Safari 12 bug NativeSymbol().description !== undefined )) { var EmptyStringDescriptionStore = {}; // wrap Symbol constructor for correct work with undefined description var SymbolWrapper = function Symbol() { - var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString$F(arguments[0]); + var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString$G(arguments[0]); var result = isPrototypeOf$c(SymbolPrototype, this) ? new NativeSymbol(description) // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)' @@ -1960,11 +1969,11 @@ if (DESCRIPTORS$J && isCallable$v(NativeSymbol) && (!('description' in SymbolPro SymbolPrototype.constructor = SymbolWrapper; var NATIVE_SYMBOL$1 = String(NativeSymbol('description detection')) === 'Symbol(description detection)'; - var thisSymbolValue$2 = uncurryThis$1C(SymbolPrototype.valueOf); - var symbolDescriptiveString = uncurryThis$1C(SymbolPrototype.toString); + var thisSymbolValue$2 = uncurryThis$1D(SymbolPrototype.valueOf); + var symbolDescriptiveString = uncurryThis$1D(SymbolPrototype.toString); var regexp = /^Symbol\((.*)\)[^)]+$/; - var replace$a = uncurryThis$1C(''.replace); - var stringSlice$j = uncurryThis$1C(''.slice); + var replace$b = uncurryThis$1D(''.replace); + var stringSlice$j = uncurryThis$1D(''.slice); defineBuiltInAccessor$m(SymbolPrototype, 'description', { configurable: true, @@ -1972,12 +1981,12 @@ if (DESCRIPTORS$J && isCallable$v(NativeSymbol) && (!('description' in SymbolPro var symbol = thisSymbolValue$2(this); if (hasOwn$t(EmptyStringDescriptionStore, symbol)) return ''; var string = symbolDescriptiveString(symbol); - var desc = NATIVE_SYMBOL$1 ? stringSlice$j(string, 7, -1) : replace$a(string, regexp, '$1'); + var desc = NATIVE_SYMBOL$1 ? stringSlice$j(string, 7, -1) : replace$b(string, regexp, '$1'); return desc === '' ? undefined : desc; } }); - $$5l({ global: true, constructor: true, forced: true }, { + $$5m({ global: true, constructor: true, forced: true }, { Symbol: SymbolWrapper }); } @@ -2071,24 +2080,24 @@ var defineWellKnownSymbol$8 = wellKnownSymbolDefine; // https://tc39.es/ecma262/#sec-symbol.unscopables defineWellKnownSymbol$8('unscopables'); -var uncurryThis$1B = functionUncurryThis; +var uncurryThis$1C = functionUncurryThis; var aCallable$K = aCallable$N; var functionUncurryThisAccessor = function (object, key, method) { try { // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe - return uncurryThis$1B(aCallable$K(Object.getOwnPropertyDescriptor(object, key)[method])); + return uncurryThis$1C(aCallable$K(Object.getOwnPropertyDescriptor(object, key)[method])); } catch (error) { /* empty */ } }; -var isCallable$u = isCallable$K; +var isCallable$t = isCallable$J; var $String$3 = String; var $TypeError$C = TypeError; var aPossiblePrototype$2 = function (argument) { - if (typeof argument == 'object' || isCallable$u(argument)) return argument; - throw $TypeError$C("Can't set " + $String$3(argument) + ' as a prototype'); + if (typeof argument == 'object' || isCallable$t(argument)) return argument; + throw new $TypeError$C("Can't set " + $String$3(argument) + ' as a prototype'); }; /* eslint-disable no-proto -- safe */ @@ -2128,7 +2137,7 @@ var proxyAccessor$2 = function (Target, Source, key) { }); }; -var isCallable$t = isCallable$K; +var isCallable$s = isCallable$J; var isObject$D = isObject$K; var setPrototypeOf$a = objectSetPrototypeOf$1; @@ -2139,7 +2148,7 @@ var inheritIfRequired$6 = function ($this, dummy, Wrapper) { // it can work only with native `setPrototypeOf` setPrototypeOf$a && // we haven't completely correct pre-ES6 way for getting `new.target`, so use this - isCallable$t(NewTarget = dummy.constructor) && + isCallable$s(NewTarget = dummy.constructor) && NewTarget !== Wrapper && isObject$D(NewTargetPrototype = NewTarget.prototype) && NewTargetPrototype !== Wrapper.prototype @@ -2147,10 +2156,10 @@ var inheritIfRequired$6 = function ($this, dummy, Wrapper) { return $this; }; -var toString$E = toString$I; +var toString$F = toString$J; var normalizeStringArgument$6 = function (argument, $default) { - return argument === undefined ? arguments.length < 2 ? '' : $default : toString$E(argument); + return argument === undefined ? arguments.length < 2 ? '' : $default : toString$F(argument); }; var isObject$C = isObject$K; @@ -2164,19 +2173,19 @@ var installErrorCause$2 = function (O, options) { } }; -var uncurryThis$1A = functionUncurryThis; +var uncurryThis$1B = functionUncurryThis; var $Error$2 = Error; -var replace$9 = uncurryThis$1A(''.replace); +var replace$a = uncurryThis$1B(''.replace); -var TEST = (function (arg) { return String($Error$2(arg).stack); })('zxcasd'); +var TEST = (function (arg) { return String(new $Error$2(arg).stack); })('zxcasd'); // eslint-disable-next-line redos/no-vulnerable -- safe var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/; var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST); var errorStackClear = function (stack, dropEntries) { if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error$2.prepareStackTrace) { - while (dropEntries--) stack = replace$9(stack, V8_OR_CHAKRA_STACK_ENTRY, ''); + while (dropEntries--) stack = replace$a(stack, V8_OR_CHAKRA_STACK_ENTRY, ''); } return stack; }; @@ -2184,7 +2193,7 @@ var fails$1h = fails$1u; var createPropertyDescriptor$8 = createPropertyDescriptor$d; var errorStackInstallable = !fails$1h(function () { - var error = Error('a'); + var error = new Error('a'); if (!('stack' in error)) return true; // eslint-disable-next-line es/no-object-defineproperty -- safe Object.defineProperty(error, 'stack', createPropertyDescriptor$8(1, 7)); @@ -2270,7 +2279,7 @@ var wrapErrorConstructorWithCause$2 = function (FULL_NAME, wrapper, FORCED, IS_A }; /* eslint-disable no-unused-vars -- required for functions `.length` */ -var $$5k = _export; +var $$5l = _export; var global$U = global$16; var apply$c = functionApply$1; var wrapErrorConstructorWithCause$1 = wrapErrorConstructorWithCause$2; @@ -2278,19 +2287,20 @@ var wrapErrorConstructorWithCause$1 = wrapErrorConstructorWithCause$2; var WEB_ASSEMBLY = 'WebAssembly'; var WebAssembly$1 = global$U[WEB_ASSEMBLY]; -var FORCED$D = Error('e', { cause: 7 }).cause !== 7; +// eslint-disable-next-line es/no-error-cause -- feature detection +var FORCED$D = new Error('e', { cause: 7 }).cause !== 7; var exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) { var O = {}; O[ERROR_NAME] = wrapErrorConstructorWithCause$1(ERROR_NAME, wrapper, FORCED$D); - $$5k({ global: true, constructor: true, arity: 1, forced: FORCED$D }, O); + $$5l({ global: true, constructor: true, arity: 1, forced: FORCED$D }, O); }; var exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) { if (WebAssembly$1 && WebAssembly$1[ERROR_NAME]) { var O = {}; O[ERROR_NAME] = wrapErrorConstructorWithCause$1(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED$D); - $$5k({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED$D }, O); + $$5l({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED$D }, O); } }; @@ -2377,7 +2387,7 @@ var correctPrototypeGetter = !fails$1f(function () { }); var hasOwn$r = hasOwnProperty_1; -var isCallable$s = isCallable$K; +var isCallable$r = isCallable$J; var toObject$z = toObject$D; var sharedKey = sharedKey$4; var CORRECT_PROTOTYPE_GETTER$2 = correctPrototypeGetter; @@ -2393,17 +2403,17 @@ var objectGetPrototypeOf$2 = CORRECT_PROTOTYPE_GETTER$2 ? $Object$4.getPrototype var object = toObject$z(O); if (hasOwn$r(object, IE_PROTO)) return object[IE_PROTO]; var constructor = object.constructor; - if (isCallable$s(constructor) && object instanceof constructor) { + if (isCallable$r(constructor) && object instanceof constructor) { return constructor.prototype; } return object instanceof $Object$4 ? ObjectPrototype$4 : null; }; var iterators = {}; -var wellKnownSymbol$K = wellKnownSymbol$T; +var wellKnownSymbol$J = wellKnownSymbol$S; var Iterators$5 = iterators; -var ITERATOR$b = wellKnownSymbol$K('iterator'); +var ITERATOR$b = wellKnownSymbol$J('iterator'); var ArrayPrototype$1 = Array.prototype; // check on default Array iterator @@ -2415,9 +2425,9 @@ var classof$k = classof$q; var getMethod$j = getMethod$l; var isNullOrUndefined$h = isNullOrUndefined$k; var Iterators$4 = iterators; -var wellKnownSymbol$J = wellKnownSymbol$T; +var wellKnownSymbol$I = wellKnownSymbol$S; -var ITERATOR$a = wellKnownSymbol$J('iterator'); +var ITERATOR$a = wellKnownSymbol$I('iterator'); var getIteratorMethod$8 = function (it) { if (!isNullOrUndefined$h(it)) return getMethod$j(it, ITERATOR$a) @@ -2436,7 +2446,7 @@ var $TypeError$B = TypeError; var getIterator$7 = function (argument, usingIterator) { var iteratorMethod = arguments.length < 2 ? getIteratorMethod$7(argument) : usingIterator; if (aCallable$J(iteratorMethod)) return anObject$17(call$1a(iteratorMethod, argument)); - throw $TypeError$B(tryToString$4(argument) + ' is not iterable'); + throw new $TypeError$B(tryToString$4(argument) + ' is not iterable'); }; var call$19 = functionCall; @@ -2510,7 +2520,7 @@ var iterate$G = function (iterable, unboundFunction, options) { iterator = iterable; } else { iterFn = getIteratorMethod$6(iterable); - if (!iterFn) throw $TypeError$A(tryToString$3(iterable) + ' is not iterable'); + if (!iterFn) throw new $TypeError$A(tryToString$3(iterable) + ' is not iterable'); // optimisation for array iterators if (isArrayIteratorMethod$2(iterFn)) { for (index = 0, length = lengthOfArrayLike$y(iterable); length > index; index++) { @@ -2532,7 +2542,7 @@ var iterate$G = function (iterable, unboundFunction, options) { } return new Result(false); }; -var $$5j = _export; +var $$5k = _export; var isPrototypeOf$9 = objectIsPrototypeOf; var getPrototypeOf$h = objectGetPrototypeOf$2; var setPrototypeOf$8 = objectSetPrototypeOf$1; @@ -2544,9 +2554,9 @@ var installErrorCause = installErrorCause$2; var installErrorStack$1 = errorStackInstall; var iterate$F = iterate$G; var normalizeStringArgument$3 = normalizeStringArgument$6; -var wellKnownSymbol$I = wellKnownSymbol$T; +var wellKnownSymbol$H = wellKnownSymbol$S; -var TO_STRING_TAG$9 = wellKnownSymbol$I('toStringTag'); +var TO_STRING_TAG$9 = wellKnownSymbol$H('toStringTag'); var $Error$1 = Error; var push$o = [].push; @@ -2554,7 +2564,7 @@ var $AggregateError$1 = function AggregateError(errors, message /* , options */) var isInstance = isPrototypeOf$9(AggregateErrorPrototype, this); var that; if (setPrototypeOf$8) { - that = setPrototypeOf$8($Error$1(), isInstance ? getPrototypeOf$h(this) : AggregateErrorPrototype); + that = setPrototypeOf$8(new $Error$1(), isInstance ? getPrototypeOf$h(this) : AggregateErrorPrototype); } else { that = isInstance ? this : create$h(AggregateErrorPrototype); createNonEnumerableProperty$e(that, TO_STRING_TAG$9, 'Error'); @@ -2579,11 +2589,11 @@ var AggregateErrorPrototype = $AggregateError$1.prototype = create$h($Error$1.pr // `AggregateError` constructor // https://tc39.es/ecma262/#sec-aggregate-error-constructor -$$5j({ global: true, constructor: true, arity: 2 }, { +$$5k({ global: true, constructor: true, arity: 2 }, { AggregateError: $AggregateError$1 }); -var $$5i = _export; +var $$5j = _export; var getBuiltIn$C = getBuiltIn$M; var apply$b = functionApply$1; var fails$1e = fails$1u; @@ -2599,18 +2609,18 @@ var FORCED$C = !fails$1e(function () { }); // https://tc39.es/ecma262/#sec-aggregate-error -$$5i({ global: true, constructor: true, arity: 2, forced: FORCED$C }, { +$$5j({ global: true, constructor: true, arity: 2, forced: FORCED$C }, { AggregateError: wrapErrorConstructorWithCause(AGGREGATE_ERROR, function (init) { // eslint-disable-next-line no-unused-vars -- required for functions `.length` return function AggregateError(errors, message) { return apply$b(init, this, arguments); }; }, FORCED$C, true) }); -var wellKnownSymbol$H = wellKnownSymbol$T; +var wellKnownSymbol$G = wellKnownSymbol$S; var create$g = objectCreate$1; var defineProperty$c = objectDefineProperty.f; -var UNSCOPABLES = wellKnownSymbol$H('unscopables'); +var UNSCOPABLES = wellKnownSymbol$G('unscopables'); var ArrayPrototype = Array.prototype; // Array.prototype[@@unscopables] @@ -2627,7 +2637,7 @@ var addToUnscopables$n = function (key) { ArrayPrototype[UNSCOPABLES][key] = true; }; -var $$5h = _export; +var $$5i = _export; var toObject$y = toObject$D; var lengthOfArrayLike$x = lengthOfArrayLike$C; var toIntegerOrInfinity$m = toIntegerOrInfinity$p; @@ -2635,7 +2645,7 @@ var addToUnscopables$m = addToUnscopables$n; // `Array.prototype.at` method // https://tc39.es/ecma262/#sec-array.prototype.at -$$5h({ target: 'Array', proto: true }, { +$$5i({ target: 'Array', proto: true }, { at: function at(index) { var O = toObject$y(this); var len = lengthOfArrayLike$x(O); @@ -2656,10 +2666,10 @@ var doesNotExceedSafeInteger$7 = function (it) { }; var fails$1d = fails$1u; -var wellKnownSymbol$G = wellKnownSymbol$T; +var wellKnownSymbol$F = wellKnownSymbol$S; var V8_VERSION$2 = engineV8Version; -var SPECIES$5 = wellKnownSymbol$G('species'); +var SPECIES$5 = wellKnownSymbol$F('species'); var arrayMethodHasSpeciesSupport$5 = function (METHOD_NAME) { // We can't use this feature detection in V8 since it causes @@ -2675,7 +2685,7 @@ var arrayMethodHasSpeciesSupport$5 = function (METHOD_NAME) { }); }; -var $$5g = _export; +var $$5h = _export; var fails$1c = fails$1u; var isArray$8 = isArray$b; var isObject$B = isObject$K; @@ -2685,10 +2695,10 @@ var doesNotExceedSafeInteger$6 = doesNotExceedSafeInteger$7; var createProperty$9 = createProperty$b; var arraySpeciesCreate$3 = arraySpeciesCreate$5; var arrayMethodHasSpeciesSupport$4 = arrayMethodHasSpeciesSupport$5; -var wellKnownSymbol$F = wellKnownSymbol$T; +var wellKnownSymbol$E = wellKnownSymbol$S; var V8_VERSION$1 = engineV8Version; -var IS_CONCAT_SPREADABLE = wellKnownSymbol$F('isConcatSpreadable'); +var IS_CONCAT_SPREADABLE = wellKnownSymbol$E('isConcatSpreadable'); // We can't use this feature detection in V8 since it causes // deoptimization and serious performance degradation @@ -2710,7 +2720,7 @@ var FORCED$B = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport$4( // `Array.prototype.concat` method // https://tc39.es/ecma262/#sec-array.prototype.concat // with adding support of @@isConcatSpreadable and @@species -$$5g({ target: 'Array', proto: true, arity: 1, forced: FORCED$B }, { +$$5h({ target: 'Array', proto: true, arity: 1, forced: FORCED$B }, { // eslint-disable-next-line no-unused-vars -- required for `.length` concat: function concat(arg) { var O = toObject$x(this); @@ -2738,7 +2748,7 @@ var tryToString$2 = tryToString$7; var $TypeError$y = TypeError; var deletePropertyOrThrow$4 = function (O, P) { - if (!delete O[P]) throw $TypeError$y('Cannot delete property ' + tryToString$2(P) + ' of ' + tryToString$2(O)); + if (!delete O[P]) throw new $TypeError$y('Cannot delete property ' + tryToString$2(P) + ' of ' + tryToString$2(O)); }; var toObject$w = toObject$D; @@ -2772,13 +2782,13 @@ var arrayCopyWithin = [].copyWithin || function copyWithin(target /* = 0 */, sta } return O; }; -var $$5f = _export; +var $$5g = _export; var copyWithin = arrayCopyWithin; var addToUnscopables$l = addToUnscopables$n; // `Array.prototype.copyWithin` method // https://tc39.es/ecma262/#sec-array.prototype.copywithin -$$5f({ target: 'Array', proto: true }, { +$$5g({ target: 'Array', proto: true }, { copyWithin: copyWithin }); @@ -2795,7 +2805,7 @@ var arrayMethodIsStrict$b = function (METHOD_NAME, argument) { }); }; -var $$5e = _export; +var $$5f = _export; var $every$2 = arrayIteration.every; var arrayMethodIsStrict$a = arrayMethodIsStrict$b; @@ -2803,7 +2813,7 @@ var STRICT_METHOD$4 = arrayMethodIsStrict$a('every'); // `Array.prototype.every` method // https://tc39.es/ecma262/#sec-array.prototype.every -$$5e({ target: 'Array', proto: true, forced: !STRICT_METHOD$4 }, { +$$5f({ target: 'Array', proto: true, forced: !STRICT_METHOD$4 }, { every: function every(callbackfn /* , thisArg */) { return $every$2(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } @@ -2826,20 +2836,20 @@ var arrayFill$1 = function fill(value /* , start = 0, end = @length */) { return O; }; -var $$5d = _export; +var $$5e = _export; var fill$1 = arrayFill$1; var addToUnscopables$k = addToUnscopables$n; // `Array.prototype.fill` method // https://tc39.es/ecma262/#sec-array.prototype.fill -$$5d({ target: 'Array', proto: true }, { +$$5e({ target: 'Array', proto: true }, { fill: fill$1 }); // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables$k('fill'); -var $$5c = _export; +var $$5d = _export; var $filter$1 = arrayIteration.filter; var arrayMethodHasSpeciesSupport$3 = arrayMethodHasSpeciesSupport$5; @@ -2848,13 +2858,13 @@ var HAS_SPECIES_SUPPORT$3 = arrayMethodHasSpeciesSupport$3('filter'); // `Array.prototype.filter` method // https://tc39.es/ecma262/#sec-array.prototype.filter // with adding support of @@species -$$5c({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$3 }, { +$$5d({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$3 }, { filter: function filter(callbackfn /* , thisArg */) { return $filter$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); -var $$5b = _export; +var $$5c = _export; var $find$2 = arrayIteration.find; var addToUnscopables$j = addToUnscopables$n; @@ -2867,7 +2877,7 @@ if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES$1 = false; }); // `Array.prototype.find` method // https://tc39.es/ecma262/#sec-array.prototype.find -$$5b({ target: 'Array', proto: true, forced: SKIPS_HOLES$1 }, { +$$5c({ target: 'Array', proto: true, forced: SKIPS_HOLES$1 }, { find: function find(callbackfn /* , that = undefined */) { return $find$2(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } @@ -2876,7 +2886,7 @@ $$5b({ target: 'Array', proto: true, forced: SKIPS_HOLES$1 }, { // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables$j(FIND); -var $$5a = _export; +var $$5b = _export; var $findIndex$1 = arrayIteration.findIndex; var addToUnscopables$i = addToUnscopables$n; @@ -2889,7 +2899,7 @@ if (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES = false; }) // `Array.prototype.findIndex` method // https://tc39.es/ecma262/#sec-array.prototype.findindex -$$5a({ target: 'Array', proto: true, forced: SKIPS_HOLES }, { +$$5b({ target: 'Array', proto: true, forced: SKIPS_HOLES }, { findIndex: function findIndex(callbackfn /* , that = undefined */) { return $findIndex$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } @@ -2933,13 +2943,13 @@ var arrayIterationFromLast = { findLastIndex: createMethod$6(1) }; -var $$59 = _export; +var $$5a = _export; var $findLast$1 = arrayIterationFromLast.findLast; var addToUnscopables$h = addToUnscopables$n; // `Array.prototype.findLast` method // https://tc39.es/ecma262/#sec-array.prototype.findlast -$$59({ target: 'Array', proto: true }, { +$$5a({ target: 'Array', proto: true }, { findLast: function findLast(callbackfn /* , that = undefined */) { return $findLast$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } @@ -2947,13 +2957,13 @@ $$59({ target: 'Array', proto: true }, { addToUnscopables$h('findLast'); -var $$58 = _export; +var $$59 = _export; var $findLastIndex$1 = arrayIterationFromLast.findLastIndex; var addToUnscopables$g = addToUnscopables$n; // `Array.prototype.findLastIndex` method // https://tc39.es/ecma262/#sec-array.prototype.findlastindex -$$58({ target: 'Array', proto: true }, { +$$59({ target: 'Array', proto: true }, { findLastIndex: function findLastIndex(callbackfn /* , that = undefined */) { return $findLastIndex$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } @@ -2995,7 +3005,7 @@ var flattenIntoArray$2 = function (target, original, source, sourceLen, start, d var flattenIntoArray_1 = flattenIntoArray$2; -var $$57 = _export; +var $$58 = _export; var flattenIntoArray$1 = flattenIntoArray_1; var toObject$t = toObject$D; var lengthOfArrayLike$r = lengthOfArrayLike$C; @@ -3004,7 +3014,7 @@ var arraySpeciesCreate$2 = arraySpeciesCreate$5; // `Array.prototype.flat` method // https://tc39.es/ecma262/#sec-array.prototype.flat -$$57({ target: 'Array', proto: true }, { +$$58({ target: 'Array', proto: true }, { flat: function flat(/* depthArg = 1 */) { var depthArg = arguments.length ? arguments[0] : undefined; var O = toObject$t(this); @@ -3015,7 +3025,7 @@ $$57({ target: 'Array', proto: true }, { } }); -var $$56 = _export; +var $$57 = _export; var flattenIntoArray = flattenIntoArray_1; var aCallable$I = aCallable$N; var toObject$s = toObject$D; @@ -3024,7 +3034,7 @@ var arraySpeciesCreate$1 = arraySpeciesCreate$5; // `Array.prototype.flatMap` method // https://tc39.es/ecma262/#sec-array.prototype.flatmap -$$56({ target: 'Array', proto: true }, { +$$57({ target: 'Array', proto: true }, { flatMap: function flatMap(callbackfn /* , thisArg */) { var O = toObject$s(this); var sourceLen = lengthOfArrayLike$q(O); @@ -3048,13 +3058,13 @@ var arrayForEach = !STRICT_METHOD$3 ? function forEach(callbackfn /* , thisArg * // eslint-disable-next-line es/no-array-prototype-foreach -- safe } : [].forEach; -var $$55 = _export; +var $$56 = _export; var forEach$6 = arrayForEach; // `Array.prototype.forEach` method // https://tc39.es/ecma262/#sec-array.prototype.foreach // eslint-disable-next-line es/no-array-prototype-foreach -- safe -$$55({ target: 'Array', proto: true, forced: [].forEach !== forEach$6 }, { +$$56({ target: 'Array', proto: true, forced: [].forEach !== forEach$6 }, { forEach: forEach$6 }); @@ -3116,9 +3126,9 @@ var arrayFrom$1 = function from(arrayLike /* , mapfn = undefined, thisArg = unde return result; }; -var wellKnownSymbol$E = wellKnownSymbol$T; +var wellKnownSymbol$D = wellKnownSymbol$S; -var ITERATOR$9 = wellKnownSymbol$E('iterator'); +var ITERATOR$9 = wellKnownSymbol$D('iterator'); var SAFE_CLOSING = false; try { @@ -3157,7 +3167,7 @@ var checkCorrectnessOfIteration$4 = function (exec, SKIP_CLOSING) { return ITERATION_SUPPORT; }; -var $$54 = _export; +var $$55 = _export; var from$4 = arrayFrom$1; var checkCorrectnessOfIteration$3 = checkCorrectnessOfIteration$4; @@ -3168,11 +3178,11 @@ var INCORRECT_ITERATION = !checkCorrectnessOfIteration$3(function (iterable) { // `Array.from` method // https://tc39.es/ecma262/#sec-array.from -$$54({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, { +$$55({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, { from: from$4 }); -var $$53 = _export; +var $$54 = _export; var $includes$1 = arrayIncludes.includes; var fails$1a = fails$1u; var addToUnscopables$f = addToUnscopables$n; @@ -3185,7 +3195,7 @@ var BROKEN_ON_SPARSE = fails$1a(function () { // `Array.prototype.includes` method // https://tc39.es/ecma262/#sec-array.prototype.includes -$$53({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, { +$$54({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, { includes: function includes(el /* , fromIndex = 0 */) { return $includes$1(this, el, arguments.length > 1 ? arguments[1] : undefined); } @@ -3195,19 +3205,19 @@ $$53({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, { addToUnscopables$f('includes'); /* eslint-disable es/no-array-prototype-indexof -- required for testing */ -var $$52 = _export; -var uncurryThis$1z = functionUncurryThisClause; +var $$53 = _export; +var uncurryThis$1A = functionUncurryThisClause; var $indexOf$1 = arrayIncludes.indexOf; var arrayMethodIsStrict$8 = arrayMethodIsStrict$b; -var nativeIndexOf = uncurryThis$1z([].indexOf); +var nativeIndexOf = uncurryThis$1A([].indexOf); var NEGATIVE_ZERO$1 = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0; var FORCED$A = NEGATIVE_ZERO$1 || !arrayMethodIsStrict$8('indexOf'); // `Array.prototype.indexOf` method // https://tc39.es/ecma262/#sec-array.prototype.indexof -$$52({ target: 'Array', proto: true, forced: FORCED$A }, { +$$53({ target: 'Array', proto: true, forced: FORCED$A }, { indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { var fromIndex = arguments.length > 1 ? arguments[1] : undefined; return NEGATIVE_ZERO$1 @@ -3217,23 +3227,23 @@ $$52({ target: 'Array', proto: true, forced: FORCED$A }, { } }); -var $$51 = _export; +var $$52 = _export; var isArray$6 = isArray$b; // `Array.isArray` method // https://tc39.es/ecma262/#sec-array.isarray -$$51({ target: 'Array', stat: true }, { +$$52({ target: 'Array', stat: true }, { isArray: isArray$6 }); var fails$19 = fails$1u; -var isCallable$r = isCallable$K; +var isCallable$q = isCallable$J; var isObject$A = isObject$K; var getPrototypeOf$g = objectGetPrototypeOf$2; var defineBuiltIn$p = defineBuiltIn$u; -var wellKnownSymbol$D = wellKnownSymbol$T; +var wellKnownSymbol$C = wellKnownSymbol$S; -var ITERATOR$8 = wellKnownSymbol$D('iterator'); +var ITERATOR$8 = wellKnownSymbol$C('iterator'); var BUGGY_SAFARI_ITERATORS$1 = false; // `%IteratorPrototype%` object @@ -3261,7 +3271,7 @@ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$6 = {}; // `%IteratorPrototype%[@@iterator]()` method // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator -if (!isCallable$r(IteratorPrototype$6[ITERATOR$8])) { +if (!isCallable$q(IteratorPrototype$6[ITERATOR$8])) { defineBuiltIn$p(IteratorPrototype$6, ITERATOR$8, function () { return this; }); @@ -3288,17 +3298,17 @@ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUME return IteratorConstructor; }; -var $$50 = _export; +var $$51 = _export; var call$16 = functionCall; var FunctionName$1 = functionName; -var isCallable$q = isCallable$K; +var isCallable$p = isCallable$J; var createIteratorConstructor$6 = iteratorCreateConstructor; var getPrototypeOf$f = objectGetPrototypeOf$2; var setPrototypeOf$7 = objectSetPrototypeOf$1; var setToStringTag$9 = setToStringTag$d; var createNonEnumerableProperty$d = createNonEnumerableProperty$k; var defineBuiltIn$o = defineBuiltIn$u; -var wellKnownSymbol$C = wellKnownSymbol$T; +var wellKnownSymbol$B = wellKnownSymbol$S; var Iterators$2 = iterators; var IteratorsCore = iteratorsCore; @@ -3306,7 +3316,7 @@ var PROPER_FUNCTION_NAME$3 = FunctionName$1.PROPER; var CONFIGURABLE_FUNCTION_NAME$1 = FunctionName$1.CONFIGURABLE; var IteratorPrototype$4 = IteratorsCore.IteratorPrototype; var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; -var ITERATOR$7 = wellKnownSymbol$C('iterator'); +var ITERATOR$7 = wellKnownSymbol$B('iterator'); var KEYS = 'keys'; var VALUES = 'values'; var ENTRIES = 'entries'; @@ -3346,7 +3356,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL if (getPrototypeOf$f(CurrentIteratorPrototype) !== IteratorPrototype$4) { if (setPrototypeOf$7) { setPrototypeOf$7(CurrentIteratorPrototype, IteratorPrototype$4); - } else if (!isCallable$q(CurrentIteratorPrototype[ITERATOR$7])) { + } else if (!isCallable$p(CurrentIteratorPrototype[ITERATOR$7])) { defineBuiltIn$o(CurrentIteratorPrototype, ITERATOR$7, returnThis); } } @@ -3376,7 +3386,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { defineBuiltIn$o(IterablePrototype, KEY, methods[KEY]); } - } else $$50({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); + } else $$51({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); } // define iterator @@ -3456,20 +3466,20 @@ if (DESCRIPTORS$G && values.name !== 'values') try { defineProperty$b(values, 'name', { value: 'values' }); } catch (error) { /* empty */ } -var $$4$ = _export; -var uncurryThis$1y = functionUncurryThis; +var $$50 = _export; +var uncurryThis$1z = functionUncurryThis; var IndexedObject$4 = indexedObject; var toIndexedObject$c = toIndexedObject$k; var arrayMethodIsStrict$7 = arrayMethodIsStrict$b; -var nativeJoin = uncurryThis$1y([].join); +var nativeJoin = uncurryThis$1z([].join); var ES3_STRINGS = IndexedObject$4 !== Object; var FORCED$z = ES3_STRINGS || !arrayMethodIsStrict$7('join', ','); // `Array.prototype.join` method // https://tc39.es/ecma262/#sec-array.prototype.join -$$4$({ target: 'Array', proto: true, forced: FORCED$z }, { +$$50({ target: 'Array', proto: true, forced: FORCED$z }, { join: function join(separator) { return nativeJoin(toIndexedObject$c(this), separator === undefined ? ',' : separator); } @@ -3502,17 +3512,17 @@ var arrayLastIndexOf = FORCED$y ? function lastIndexOf(searchElement /* , fromIn return -1; } : $lastIndexOf$1; -var $$4_ = _export; +var $$4$ = _export; var lastIndexOf = arrayLastIndexOf; // `Array.prototype.lastIndexOf` method // https://tc39.es/ecma262/#sec-array.prototype.lastindexof // eslint-disable-next-line es/no-array-prototype-lastindexof -- required for testing -$$4_({ target: 'Array', proto: true, forced: lastIndexOf !== [].lastIndexOf }, { +$$4$({ target: 'Array', proto: true, forced: lastIndexOf !== [].lastIndexOf }, { lastIndexOf: lastIndexOf }); -var $$4Z = _export; +var $$4_ = _export; var $map$1 = arrayIteration.map; var arrayMethodHasSpeciesSupport$2 = arrayMethodHasSpeciesSupport$5; @@ -3521,13 +3531,13 @@ var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport$2('map'); // `Array.prototype.map` method // https://tc39.es/ecma262/#sec-array.prototype.map // with adding support of @@species -$$4Z({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, { +$$4_({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, { map: function map(callbackfn /* , thisArg */) { return $map$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); -var $$4Y = _export; +var $$4Z = _export; var fails$18 = fails$1u; var isConstructor$7 = isConstructor$a; var createProperty$7 = createProperty$b; @@ -3543,7 +3553,7 @@ var ISNT_GENERIC = fails$18(function () { // `Array.of` method // https://tc39.es/ecma262/#sec-array.of // WebKit Array.of isn't generic -$$4Y({ target: 'Array', stat: true, forced: ISNT_GENERIC }, { +$$4Z({ target: 'Array', stat: true, forced: ISNT_GENERIC }, { of: function of(/* ...args */) { var index = 0; var argumentsLength = arguments.length; @@ -3575,13 +3585,13 @@ var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS$F && !function () { var arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) { if (isArray$5(O) && !getOwnPropertyDescriptor$c(O, 'length').writable) { - throw $TypeError$x('Cannot set read only .length'); + throw new $TypeError$x('Cannot set read only .length'); } return O.length = length; } : function (O, length) { return O.length = length; }; -var $$4X = _export; +var $$4Y = _export; var toObject$q = toObject$D; var lengthOfArrayLike$n = lengthOfArrayLike$C; var setArrayLength$2 = arraySetLength; @@ -3607,7 +3617,7 @@ var FORCED$x = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength$1(); // `Array.prototype.push` method // https://tc39.es/ecma262/#sec-array.prototype.push -$$4X({ target: 'Array', proto: true, arity: 1, forced: FORCED$x }, { +$$4Y({ target: 'Array', proto: true, arity: 1, forced: FORCED$x }, { // eslint-disable-next-line no-unused-vars -- required for `.length` push: function push(item) { var O = toObject$q(this); @@ -3647,7 +3657,7 @@ var createMethod$5 = function (IS_RIGHT) { } index += i; if (IS_RIGHT ? index < 0 : length <= index) { - throw $TypeError$w('Reduce of empty array with no initial value'); + throw new $TypeError$w('Reduce of empty array with no initial value'); } } for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) { @@ -3671,7 +3681,7 @@ var classof$j = classofRaw$2; var engineIsNode = classof$j(global$T.process) === 'process'; -var $$4W = _export; +var $$4X = _export; var $reduce$1 = arrayReduce.left; var arrayMethodIsStrict$5 = arrayMethodIsStrict$b; var CHROME_VERSION$1 = engineV8Version; @@ -3684,14 +3694,14 @@ var FORCED$w = CHROME_BUG$1 || !arrayMethodIsStrict$5('reduce'); // `Array.prototype.reduce` method // https://tc39.es/ecma262/#sec-array.prototype.reduce -$$4W({ target: 'Array', proto: true, forced: FORCED$w }, { +$$4X({ target: 'Array', proto: true, forced: FORCED$w }, { reduce: function reduce(callbackfn /* , initialValue */) { var length = arguments.length; return $reduce$1(this, callbackfn, length, length > 1 ? arguments[1] : undefined); } }); -var $$4V = _export; +var $$4W = _export; var $reduceRight$1 = arrayReduce.right; var arrayMethodIsStrict$4 = arrayMethodIsStrict$b; var CHROME_VERSION = engineV8Version; @@ -3704,24 +3714,24 @@ var FORCED$v = CHROME_BUG || !arrayMethodIsStrict$4('reduceRight'); // `Array.prototype.reduceRight` method // https://tc39.es/ecma262/#sec-array.prototype.reduceright -$$4V({ target: 'Array', proto: true, forced: FORCED$v }, { +$$4W({ target: 'Array', proto: true, forced: FORCED$v }, { reduceRight: function reduceRight(callbackfn /* , initialValue */) { return $reduceRight$1(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); } }); -var $$4U = _export; -var uncurryThis$1x = functionUncurryThis; +var $$4V = _export; +var uncurryThis$1y = functionUncurryThis; var isArray$4 = isArray$b; -var nativeReverse = uncurryThis$1x([].reverse); +var nativeReverse = uncurryThis$1y([].reverse); var test$1 = [1, 2]; // `Array.prototype.reverse` method // https://tc39.es/ecma262/#sec-array.prototype.reverse // fix for Safari 12.0 bug // https://bugs.webkit.org/show_bug.cgi?id=188794 -$$4U({ target: 'Array', proto: true, forced: String(test$1) === String(test$1.reverse()) }, { +$$4V({ target: 'Array', proto: true, forced: String(test$1) === String(test$1.reverse()) }, { reverse: function reverse() { // eslint-disable-next-line no-self-assign -- dirty hack if (isArray$4(this)) this.length = this.length; @@ -3729,7 +3739,7 @@ $$4U({ target: 'Array', proto: true, forced: String(test$1) === String(test$1.re } }); -var $$4T = _export; +var $$4U = _export; var isArray$3 = isArray$b; var isConstructor$6 = isConstructor$a; var isObject$z = isObject$K; @@ -3737,20 +3747,20 @@ var toAbsoluteIndex$6 = toAbsoluteIndex$b; var lengthOfArrayLike$l = lengthOfArrayLike$C; var toIndexedObject$a = toIndexedObject$k; var createProperty$6 = createProperty$b; -var wellKnownSymbol$B = wellKnownSymbol$T; +var wellKnownSymbol$A = wellKnownSymbol$S; var arrayMethodHasSpeciesSupport$1 = arrayMethodHasSpeciesSupport$5; var nativeSlice = arraySlice$b; var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport$1('slice'); -var SPECIES$4 = wellKnownSymbol$B('species'); +var SPECIES$4 = wellKnownSymbol$A('species'); var $Array$8 = Array; var max$8 = Math.max; // `Array.prototype.slice` method // https://tc39.es/ecma262/#sec-array.prototype.slice // fallback for not array-like ES3 strings and DOM objects -$$4T({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, { +$$4U({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, { slice: function slice(start, end) { var O = toIndexedObject$a(this); var length = lengthOfArrayLike$l(O); @@ -3778,7 +3788,7 @@ $$4T({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, { } }); -var $$4S = _export; +var $$4T = _export; var $some$2 = arrayIteration.some; var arrayMethodIsStrict$3 = arrayMethodIsStrict$b; @@ -3786,7 +3796,7 @@ var STRICT_METHOD$1 = arrayMethodIsStrict$3('some'); // `Array.prototype.some` method // https://tc39.es/ecma262/#sec-array.prototype.some -$$4S({ target: 'Array', proto: true, forced: !STRICT_METHOD$1 }, { +$$4T({ target: 'Array', proto: true, forced: !STRICT_METHOD$1 }, { some: function some(callbackfn /* , thisArg */) { return $some$2(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } @@ -3853,13 +3863,13 @@ var webkit = userAgent$4.match(/AppleWebKit\/(\d+)\./); var engineWebkitVersion = !!webkit && +webkit[1]; -var $$4R = _export; -var uncurryThis$1w = functionUncurryThis; +var $$4S = _export; +var uncurryThis$1x = functionUncurryThis; var aCallable$G = aCallable$N; var toObject$o = toObject$D; var lengthOfArrayLike$k = lengthOfArrayLike$C; var deletePropertyOrThrow$2 = deletePropertyOrThrow$4; -var toString$D = toString$I; +var toString$E = toString$J; var fails$16 = fails$1u; var internalSort$1 = arraySort$1; var arrayMethodIsStrict$2 = arrayMethodIsStrict$b; @@ -3869,8 +3879,8 @@ var V8$2 = engineV8Version; var WEBKIT$2 = engineWebkitVersion; var test = []; -var nativeSort$1 = uncurryThis$1w(test.sort); -var push$n = uncurryThis$1w(test.push); +var nativeSort$1 = uncurryThis$1x(test.sort); +var push$n = uncurryThis$1x(test.push); // IE8- var FAILS_ON_UNDEFINED = fails$16(function () { @@ -3925,13 +3935,13 @@ var getSortCompare$1 = function (comparefn) { if (y === undefined) return -1; if (x === undefined) return 1; if (comparefn !== undefined) return +comparefn(x, y) || 0; - return toString$D(x) > toString$D(y) ? 1 : -1; + return toString$E(x) > toString$E(y) ? 1 : -1; }; }; // `Array.prototype.sort` method // https://tc39.es/ecma262/#sec-array.prototype.sort -$$4R({ target: 'Array', proto: true, forced: FORCED$u }, { +$$4S({ target: 'Array', proto: true, forced: FORCED$u }, { sort: function sort(comparefn) { if (comparefn !== undefined) aCallable$G(comparefn); @@ -3961,10 +3971,10 @@ $$4R({ target: 'Array', proto: true, forced: FORCED$u }, { var getBuiltIn$B = getBuiltIn$M; var defineBuiltInAccessor$l = defineBuiltInAccessor$o; -var wellKnownSymbol$A = wellKnownSymbol$T; +var wellKnownSymbol$z = wellKnownSymbol$S; var DESCRIPTORS$E = descriptors; -var SPECIES$3 = wellKnownSymbol$A('species'); +var SPECIES$3 = wellKnownSymbol$z('species'); var setSpecies$7 = function (CONSTRUCTOR_NAME) { var Constructor = getBuiltIn$B(CONSTRUCTOR_NAME); @@ -3983,7 +3993,7 @@ var setSpecies$6 = setSpecies$7; // https://tc39.es/ecma262/#sec-get-array-@@species setSpecies$6('Array'); -var $$4Q = _export; +var $$4R = _export; var toObject$n = toObject$D; var toAbsoluteIndex$5 = toAbsoluteIndex$b; var toIntegerOrInfinity$j = toIntegerOrInfinity$p; @@ -4003,7 +4013,7 @@ var min$a = Math.min; // `Array.prototype.splice` method // https://tc39.es/ecma262/#sec-array.prototype.splice // with adding support of @@species -$$4Q({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { +$$4R({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { splice: function splice(start, deleteCount /* , ...items */) { var O = toObject$n(this); var len = lengthOfArrayLike$j(O); @@ -4062,7 +4072,7 @@ var arrayToReversed$2 = function (O, C) { return A; }; -var $$4P = _export; +var $$4Q = _export; var arrayToReversed$1 = arrayToReversed$2; var toIndexedObject$9 = toIndexedObject$k; var addToUnscopables$d = addToUnscopables$n; @@ -4071,7 +4081,7 @@ var $Array$7 = Array; // `Array.prototype.toReversed` method // https://tc39.es/ecma262/#sec-array.prototype.toreversed -$$4P({ target: 'Array', proto: true }, { +$$4Q({ target: 'Array', proto: true }, { toReversed: function toReversed() { return arrayToReversed$1(toIndexedObject$9(this), $Array$7); } @@ -4095,8 +4105,8 @@ var entryVirtual = function (CONSTRUCTOR) { return global$S[CONSTRUCTOR].prototype; }; -var $$4O = _export; -var uncurryThis$1v = functionUncurryThis; +var $$4P = _export; +var uncurryThis$1w = functionUncurryThis; var aCallable$F = aCallable$N; var toIndexedObject$8 = toIndexedObject$k; var arrayFromConstructorAndList$5 = arrayFromConstructorAndList$6; @@ -4104,11 +4114,11 @@ var getVirtual$1 = entryVirtual; var addToUnscopables$c = addToUnscopables$n; var $Array$6 = Array; -var sort$1 = uncurryThis$1v(getVirtual$1('Array').sort); +var sort$1 = uncurryThis$1w(getVirtual$1('Array').sort); // `Array.prototype.toSorted` method // https://tc39.es/ecma262/#sec-array.prototype.tosorted -$$4O({ target: 'Array', proto: true }, { +$$4P({ target: 'Array', proto: true }, { toSorted: function toSorted(compareFn) { if (compareFn !== undefined) aCallable$F(compareFn); var O = toIndexedObject$8(this); @@ -4119,7 +4129,7 @@ $$4O({ target: 'Array', proto: true }, { addToUnscopables$c('toSorted'); -var $$4N = _export; +var $$4O = _export; var addToUnscopables$b = addToUnscopables$n; var doesNotExceedSafeInteger$2 = doesNotExceedSafeInteger$7; var lengthOfArrayLike$g = lengthOfArrayLike$C; @@ -4133,7 +4143,7 @@ var min$9 = Math.min; // `Array.prototype.toSpliced` method // https://tc39.es/ecma262/#sec-array.prototype.tospliced -$$4N({ target: 'Array', proto: true }, { +$$4O({ target: 'Array', proto: true }, { toSpliced: function toSpliced(start, deleteCount /* , ...items */) { var O = toIndexedObject$7(this); var len = lengthOfArrayLike$g(O); @@ -4177,7 +4187,7 @@ var addToUnscopables$9 = addToUnscopables$n; // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables$9('flatMap'); -var $$4M = _export; +var $$4N = _export; var toObject$m = toObject$D; var lengthOfArrayLike$f = lengthOfArrayLike$C; var setArrayLength = arraySetLength; @@ -4201,7 +4211,7 @@ var FORCED$t = INCORRECT_RESULT || !properErrorOnNonWritableLength(); // `Array.prototype.unshift` method // https://tc39.es/ecma262/#sec-array.prototype.unshift -$$4M({ target: 'Array', proto: true, arity: 1, forced: FORCED$t }, { +$$4N({ target: 'Array', proto: true, arity: 1, forced: FORCED$t }, { // eslint-disable-next-line no-unused-vars -- required for `.length` unshift: function unshift(item) { var O = toObject$m(this); @@ -4233,14 +4243,14 @@ var arrayWith$2 = function (O, C, index, value) { var len = lengthOfArrayLike$e(O); var relativeIndex = toIntegerOrInfinity$h(index); var actualIndex = relativeIndex < 0 ? len + relativeIndex : relativeIndex; - if (actualIndex >= len || actualIndex < 0) throw $RangeError$d('Incorrect index'); + if (actualIndex >= len || actualIndex < 0) throw new $RangeError$d('Incorrect index'); var A = new C(len); var k = 0; for (; k < len; k++) A[k] = k === actualIndex ? value : O[k]; return A; }; -var $$4L = _export; +var $$4M = _export; var arrayWith$1 = arrayWith$2; var toIndexedObject$6 = toIndexedObject$k; @@ -4248,7 +4258,7 @@ var $Array$4 = Array; // `Array.prototype.with` method // https://tc39.es/ecma262/#sec-array.prototype.with -$$4L({ target: 'Array', proto: true }, { +$$4M({ target: 'Array', proto: true }, { 'with': function (index, value) { return arrayWith$1(toIndexedObject$6(this), $Array$4, index, value); } @@ -4270,7 +4280,7 @@ var $TypeError$v = TypeError; var anInstance$f = function (it, Prototype) { if (isPrototypeOf$8(Prototype, it)) return it; - throw $TypeError$v('Incorrect invocation'); + throw new $TypeError$v('Incorrect invocation'); }; var toIntegerOrInfinity$g = toIntegerOrInfinity$p; @@ -4284,7 +4294,7 @@ var toIndex$5 = function (it) { if (it === undefined) return 0; var number = toIntegerOrInfinity$g(it); var length = toLength$b(number); - if (number !== length) throw $RangeError$c('Wrong length or index'); + if (number !== length) throw new $RangeError$c('Wrong length or index'); return length; }; @@ -4297,35 +4307,60 @@ var mathSign = Math.sign || function sign(x) { return n === 0 || n !== n ? n : n < 0 ? -1 : 1; }; -// IEEE754 conversions based on https://github.com/feross/ieee754 -var sign$3 = mathSign; -var trunc$1 = mathTrunc; +var sign$2 = mathSign; -var $Array$3 = Array; var abs$8 = Math.abs; -var pow$5 = Math.pow; + +var EPSILON = 2.220446049250313e-16; // Number.EPSILON +var INVERSE_EPSILON = 1 / EPSILON; + +var roundTiesToEven = function (n) { + return n + INVERSE_EPSILON - INVERSE_EPSILON; +}; + +var mathFloatRound = function (x, FLOAT_EPSILON, FLOAT_MAX_VALUE, FLOAT_MIN_VALUE) { + var n = +x; + var absolute = abs$8(n); + var s = sign$2(n); + if (absolute < FLOAT_MIN_VALUE) return s * roundTiesToEven(absolute / FLOAT_MIN_VALUE / FLOAT_EPSILON) * FLOAT_MIN_VALUE * FLOAT_EPSILON; + var a = (1 + FLOAT_EPSILON / EPSILON) * absolute; + var result = a - (a - absolute); + // eslint-disable-next-line no-self-compare -- NaN check + if (result > FLOAT_MAX_VALUE || result !== result) return s * Infinity; + return s * result; +}; + +var floatRound$1 = mathFloatRound; + +var FLOAT32_EPSILON = 1.1920928955078125e-7; // 2 ** -23; +var FLOAT32_MAX_VALUE = 3.4028234663852886e+38; // 2 ** 128 - 2 ** 104 +var FLOAT32_MIN_VALUE = 1.1754943508222875e-38; // 2 ** -126; + +// `Math.fround` method implementation +// https://tc39.es/ecma262/#sec-math.fround +// eslint-disable-next-line es/no-math-fround -- safe +var mathFround = Math.fround || function fround(x) { + return floatRound$1(x, FLOAT32_EPSILON, FLOAT32_MAX_VALUE, FLOAT32_MIN_VALUE); +}; + +// IEEE754 conversions based on https://github.com/feross/ieee754 +var $Array$3 = Array; +var abs$7 = Math.abs; +var pow$4 = Math.pow; var floor$8 = Math.floor; var log$8 = Math.log; var LN2$2 = Math.LN2; -var roundToEven = function (number) { - var truncated = trunc$1(number); - var delta = abs$8(number - truncated); - if (delta > 0.5 || delta === 0.5 && truncated % 2 !== 0) { - return truncated + sign$3(number); - } return truncated; -}; - var pack = function (number, mantissaLength, bytes) { var buffer = $Array$3(bytes); var exponentLength = bytes * 8 - mantissaLength - 1; var eMax = (1 << exponentLength) - 1; var eBias = eMax >> 1; - var rt = mantissaLength === 23 ? pow$5(2, -24) - pow$5(2, -77) : 0; - var s = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0; + var rt = mantissaLength === 23 ? pow$4(2, -24) - pow$4(2, -77) : 0; + var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0; var index = 0; var exponent, mantissa, c; - number = abs$8(number); + number = abs$7(number); // eslint-disable-next-line no-self-compare -- NaN check if (number !== number || number === Infinity) { // eslint-disable-next-line no-self-compare -- NaN check @@ -4333,7 +4368,7 @@ var pack = function (number, mantissaLength, bytes) { exponent = eMax; } else { exponent = floor$8(log$8(number) / LN2$2); - c = pow$5(2, -exponent); + c = pow$4(2, -exponent); if (number * c < 1) { exponent--; c *= 2; @@ -4341,7 +4376,7 @@ var pack = function (number, mantissaLength, bytes) { if (exponent + eBias >= 1) { number += rt / c; } else { - number += rt * pow$5(2, 1 - eBias); + number += rt * pow$4(2, 1 - eBias); } if (number * c >= 2) { exponent++; @@ -4351,10 +4386,10 @@ var pack = function (number, mantissaLength, bytes) { mantissa = 0; exponent = eMax; } else if (exponent + eBias >= 1) { - mantissa = roundToEven((number * c - 1) * pow$5(2, mantissaLength)); + mantissa = (number * c - 1) * pow$4(2, mantissaLength); exponent += eBias; } else { - mantissa = roundToEven(number * pow$5(2, eBias - 1) * pow$5(2, mantissaLength)); + mantissa = number * pow$4(2, eBias - 1) * pow$4(2, mantissaLength); exponent = 0; } } @@ -4370,7 +4405,7 @@ var pack = function (number, mantissaLength, bytes) { exponent /= 256; exponentLength -= 8; } - buffer[--index] |= s * 128; + buffer[--index] |= sign * 128; return buffer; }; @@ -4381,10 +4416,10 @@ var unpack = function (buffer, mantissaLength) { var eBias = eMax >> 1; var nBits = exponentLength - 7; var index = bytes - 1; - var s = buffer[index--]; - var exponent = s & 127; + var sign = buffer[index--]; + var exponent = sign & 127; var mantissa; - s >>= 7; + sign >>= 7; while (nBits > 0) { exponent = exponent * 256 + buffer[index--]; nBits -= 8; @@ -4399,11 +4434,11 @@ var unpack = function (buffer, mantissaLength) { if (exponent === 0) { exponent = 1 - eBias; } else if (exponent === eMax) { - return mantissa ? NaN : s ? -Infinity : Infinity; + return mantissa ? NaN : sign ? -Infinity : Infinity; } else { - mantissa += pow$5(2, mantissaLength); + mantissa += pow$4(2, mantissaLength); exponent -= eBias; - } return (s ? -1 : 1) * mantissa * pow$5(2, exponent - mantissaLength); + } return (sign ? -1 : 1) * mantissa * pow$4(2, exponent - mantissaLength); }; var ieee754 = { @@ -4412,7 +4447,7 @@ var ieee754 = { }; var global$R = global$16; -var uncurryThis$1u = functionUncurryThis; +var uncurryThis$1v = functionUncurryThis; var DESCRIPTORS$D = descriptors; var NATIVE_ARRAY_BUFFER$2 = arrayBufferBasicDetection; var FunctionName = functionName; @@ -4424,7 +4459,8 @@ var anInstance$e = anInstance$f; var toIntegerOrInfinity$f = toIntegerOrInfinity$p; var toLength$a = toLength$d; var toIndex$4 = toIndex$5; -var IEEE754$1 = ieee754; +var fround$2 = mathFround; +var IEEE754 = ieee754; var getPrototypeOf$e = objectGetPrototypeOf$2; var setPrototypeOf$6 = objectSetPrototypeOf$1; var getOwnPropertyNames$5 = objectGetOwnPropertyNames.f; @@ -4444,18 +4480,18 @@ var getInternalArrayBufferState = InternalStateModule$k.getterFor(ARRAY_BUFFER$1 var getInternalDataViewState = InternalStateModule$k.getterFor(DATA_VIEW); var setInternalState$k = InternalStateModule$k.set; var NativeArrayBuffer$1 = global$R[ARRAY_BUFFER$1]; -var $ArrayBuffer = NativeArrayBuffer$1; -var ArrayBufferPrototype$3 = $ArrayBuffer && $ArrayBuffer[PROTOTYPE]; +var $ArrayBuffer$1 = NativeArrayBuffer$1; +var ArrayBufferPrototype$3 = $ArrayBuffer$1 && $ArrayBuffer$1[PROTOTYPE]; var $DataView = global$R[DATA_VIEW]; var DataViewPrototype$2 = $DataView && $DataView[PROTOTYPE]; var ObjectPrototype$3 = Object.prototype; var Array$3 = global$R.Array; var RangeError$4 = global$R.RangeError; -var fill = uncurryThis$1u(arrayFill); -var reverse = uncurryThis$1u([].reverse); +var fill = uncurryThis$1v(arrayFill); +var reverse = uncurryThis$1v([].reverse); -var packIEEE754$2 = IEEE754$1.pack; -var unpackIEEE754$2 = IEEE754$1.unpack; +var packIEEE754$1 = IEEE754.pack; +var unpackIEEE754$1 = IEEE754.unpack; var packInt8 = function (number) { return [number & 0xFF]; @@ -4474,11 +4510,11 @@ var unpackInt32 = function (buffer) { }; var packFloat32 = function (number) { - return packIEEE754$2(number, 23, 4); + return packIEEE754$1(fround$2(number), 23, 4); }; var packFloat64 = function (number) { - return packIEEE754$2(number, 52, 8); + return packIEEE754$1(number, 52, 8); }; var addGetter$2 = function (Constructor, key, getInternalState) { @@ -4494,7 +4530,7 @@ var get$5 = function (view, count, index, isLittleEndian) { var store = getInternalDataViewState(view); var intIndex = toIndex$4(index); var boolIsLittleEndian = !!isLittleEndian; - if (intIndex + count > store.byteLength) throw RangeError$4(WRONG_INDEX); + if (intIndex + count > store.byteLength) throw new RangeError$4(WRONG_INDEX); var bytes = store.bytes; var start = intIndex + store.byteOffset; var pack = arraySlice$8(bytes, start, start + count); @@ -4506,14 +4542,14 @@ var set$a = function (view, count, index, conversion, value, isLittleEndian) { var intIndex = toIndex$4(index); var pack = conversion(+value); var boolIsLittleEndian = !!isLittleEndian; - if (intIndex + count > store.byteLength) throw RangeError$4(WRONG_INDEX); + if (intIndex + count > store.byteLength) throw new RangeError$4(WRONG_INDEX); var bytes = store.bytes; var start = intIndex + store.byteOffset; for (var i = 0; i < count; i++) bytes[start + i] = pack[boolIsLittleEndian ? i : count - i - 1]; }; if (!NATIVE_ARRAY_BUFFER$2) { - $ArrayBuffer = function ArrayBuffer(length) { + $ArrayBuffer$1 = function ArrayBuffer(length) { anInstance$e(this, ArrayBufferPrototype$3); var byteLength = toIndex$4(length); setInternalState$k(this, { @@ -4527,7 +4563,7 @@ if (!NATIVE_ARRAY_BUFFER$2) { } }; - ArrayBufferPrototype$3 = $ArrayBuffer[PROTOTYPE]; + ArrayBufferPrototype$3 = $ArrayBuffer$1[PROTOTYPE]; $DataView = function DataView(buffer, byteOffset, byteLength) { anInstance$e(this, DataViewPrototype$2); @@ -4535,9 +4571,9 @@ if (!NATIVE_ARRAY_BUFFER$2) { var bufferState = getInternalArrayBufferState(buffer); var bufferLength = bufferState.byteLength; var offset = toIntegerOrInfinity$f(byteOffset); - if (offset < 0 || offset > bufferLength) throw RangeError$4('Wrong offset'); + if (offset < 0 || offset > bufferLength) throw new RangeError$4('Wrong offset'); byteLength = byteLength === undefined ? bufferLength - offset : toLength$a(byteLength); - if (offset + byteLength > bufferLength) throw RangeError$4(WRONG_LENGTH$1); + if (offset + byteLength > bufferLength) throw new RangeError$4(WRONG_LENGTH$1); setInternalState$k(this, { type: DATA_VIEW, buffer: buffer, @@ -4555,7 +4591,7 @@ if (!NATIVE_ARRAY_BUFFER$2) { DataViewPrototype$2 = $DataView[PROTOTYPE]; if (DESCRIPTORS$D) { - addGetter$2($ArrayBuffer, 'byteLength', getInternalArrayBufferState); + addGetter$2($ArrayBuffer$1, 'byteLength', getInternalArrayBufferState); addGetter$2($DataView, 'buffer', getInternalDataViewState); addGetter$2($DataView, 'byteLength', getInternalDataViewState); addGetter$2($DataView, 'byteOffset', getInternalDataViewState); @@ -4583,10 +4619,10 @@ if (!NATIVE_ARRAY_BUFFER$2) { return unpackInt32(get$5(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false)) >>> 0; }, getFloat32: function getFloat32(byteOffset /* , littleEndian */) { - return unpackIEEE754$2(get$5(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false), 23); + return unpackIEEE754$1(get$5(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false), 23); }, getFloat64: function getFloat64(byteOffset /* , littleEndian */) { - return unpackIEEE754$2(get$5(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : false), 52); + return unpackIEEE754$1(get$5(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : false), 52); }, setInt8: function setInt8(byteOffset, value) { set$a(this, 1, byteOffset, packInt8, value); @@ -4627,20 +4663,20 @@ if (!NATIVE_ARRAY_BUFFER$2) { return NativeArrayBuffer$1.length !== 1 || INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME; })) { /* eslint-enable no-new -- required for testing */ - $ArrayBuffer = function ArrayBuffer(length) { + $ArrayBuffer$1 = function ArrayBuffer(length) { anInstance$e(this, ArrayBufferPrototype$3); return new NativeArrayBuffer$1(toIndex$4(length)); }; - $ArrayBuffer[PROTOTYPE] = ArrayBufferPrototype$3; + $ArrayBuffer$1[PROTOTYPE] = ArrayBufferPrototype$3; for (var keys$2 = getOwnPropertyNames$5(NativeArrayBuffer$1), j = 0, key$2; keys$2.length > j;) { - if (!((key$2 = keys$2[j++]) in $ArrayBuffer)) { - createNonEnumerableProperty$c($ArrayBuffer, key$2, NativeArrayBuffer$1[key$2]); + if (!((key$2 = keys$2[j++]) in $ArrayBuffer$1)) { + createNonEnumerableProperty$c($ArrayBuffer$1, key$2, NativeArrayBuffer$1[key$2]); } } - ArrayBufferPrototype$3.constructor = $ArrayBuffer; + ArrayBufferPrototype$3.constructor = $ArrayBuffer$1; } else if (INCORRECT_ARRAY_BUFFER_NAME && CONFIGURABLE_FUNCTION_NAME) { createNonEnumerableProperty$c(NativeArrayBuffer$1, 'name', ARRAY_BUFFER$1); } @@ -4651,8 +4687,8 @@ if (!NATIVE_ARRAY_BUFFER$2) { } // iOS Safari 7.x bug - var testView = new $DataView(new $ArrayBuffer(2)); - var $setInt8 = uncurryThis$1u(DataViewPrototype$2.setInt8); + var testView = new $DataView(new $ArrayBuffer$1(2)); + var $setInt8 = uncurryThis$1v(DataViewPrototype$2.setInt8); testView.setInt8(0, 2147483648); testView.setInt8(1, 2147483649); if (testView.getInt8(0) || !testView.getInt8(1)) defineBuiltIns$a(DataViewPrototype$2, { @@ -4665,15 +4701,15 @@ if (!NATIVE_ARRAY_BUFFER$2) { }, { unsafe: true }); } -setToStringTag$8($ArrayBuffer, ARRAY_BUFFER$1); +setToStringTag$8($ArrayBuffer$1, ARRAY_BUFFER$1); setToStringTag$8($DataView, DATA_VIEW); var arrayBuffer = { - ArrayBuffer: $ArrayBuffer, + ArrayBuffer: $ArrayBuffer$1, DataView: $DataView }; -var $$4K = _export; +var $$4L = _export; var global$Q = global$16; var arrayBufferModule = arrayBuffer; var setSpecies$5 = setSpecies$7; @@ -4684,7 +4720,7 @@ var NativeArrayBuffer = global$Q[ARRAY_BUFFER]; // `ArrayBuffer` constructor // https://tc39.es/ecma262/#sec-arraybuffer-constructor -$$4K({ global: true, constructor: true, forced: NativeArrayBuffer !== ArrayBuffer$5 }, { +$$4L({ global: true, constructor: true, forced: NativeArrayBuffer !== ArrayBuffer$5 }, { ArrayBuffer: ArrayBuffer$5 }); @@ -4693,7 +4729,7 @@ setSpecies$5(ARRAY_BUFFER); var NATIVE_ARRAY_BUFFER$1 = arrayBufferBasicDetection; var DESCRIPTORS$C = descriptors; var global$P = global$16; -var isCallable$p = isCallable$K; +var isCallable$o = isCallable$J; var isObject$y = isObject$K; var hasOwn$q = hasOwnProperty_1; var classof$i = classof$q; @@ -4704,7 +4740,7 @@ var defineBuiltInAccessor$j = defineBuiltInAccessor$o; var isPrototypeOf$7 = objectIsPrototypeOf; var getPrototypeOf$d = objectGetPrototypeOf$2; var setPrototypeOf$5 = objectSetPrototypeOf$1; -var wellKnownSymbol$z = wellKnownSymbol$T; +var wellKnownSymbol$y = wellKnownSymbol$S; var uid$3 = uid$7; var InternalStateModule$j = internalState; @@ -4719,7 +4755,7 @@ var TypedArrayPrototype$2 = Int8ArrayPrototype$1 && getPrototypeOf$d(Int8ArrayPr var ObjectPrototype$2 = Object.prototype; var TypeError$7 = global$P.TypeError; -var TO_STRING_TAG$8 = wellKnownSymbol$z('toStringTag'); +var TO_STRING_TAG$8 = wellKnownSymbol$y('toStringTag'); var TYPED_ARRAY_TAG$1 = uid$3('TYPED_ARRAY_TAG'); var TYPED_ARRAY_CONSTRUCTOR = 'TypedArrayConstructor'; // Fixing native typed arrays in Opera Presto crashes the browser, see #595 @@ -4768,12 +4804,12 @@ var isTypedArray$1 = function (it) { var aTypedArray$x = function (it) { if (isTypedArray$1(it)) return it; - throw TypeError$7('Target is not a typed array'); + throw new TypeError$7('Target is not a typed array'); }; var aTypedArrayConstructor$5 = function (C) { - if (isCallable$p(C) && (!setPrototypeOf$5 || isPrototypeOf$7(TypedArray$1, C))) return C; - throw TypeError$7(tryToString$1(C) + ' is not a typed array constructor'); + if (isCallable$o(C) && (!setPrototypeOf$5 || isPrototypeOf$7(TypedArray$1, C))) return C; + throw new TypeError$7(tryToString$1(C) + ' is not a typed array constructor'); }; var exportTypedArrayMethod$y = function (KEY, property, forced, options) { @@ -4834,10 +4870,10 @@ for (NAME$1 in BigIntArrayConstructorsList) { } // WebKit bug - typed arrays constructors prototype is Object.prototype -if (!NATIVE_ARRAY_BUFFER_VIEWS$3 || !isCallable$p(TypedArray$1) || TypedArray$1 === Function.prototype) { +if (!NATIVE_ARRAY_BUFFER_VIEWS$3 || !isCallable$o(TypedArray$1) || TypedArray$1 === Function.prototype) { // eslint-disable-next-line no-shadow -- safe TypedArray$1 = function TypedArray() { - throw TypeError$7('Incorrect invocation'); + throw new TypeError$7('Incorrect invocation'); }; if (NATIVE_ARRAY_BUFFER_VIEWS$3) for (NAME$1 in TypedArrayConstructorsList) { if (global$P[NAME$1]) setPrototypeOf$5(global$P[NAME$1], TypedArray$1); @@ -4883,14 +4919,14 @@ var arrayBufferViewCore = { TypedArrayPrototype: TypedArrayPrototype$2 }; -var $$4J = _export; +var $$4K = _export; var ArrayBufferViewCore$B = arrayBufferViewCore; var NATIVE_ARRAY_BUFFER_VIEWS$2 = ArrayBufferViewCore$B.NATIVE_ARRAY_BUFFER_VIEWS; // `ArrayBuffer.isView` method // https://tc39.es/ecma262/#sec-arraybuffer.isview -$$4J({ target: 'ArrayBuffer', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS$2 }, { +$$4K({ target: 'ArrayBuffer', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS$2 }, { isView: ArrayBufferViewCore$B.isView }); @@ -4902,15 +4938,15 @@ var $TypeError$u = TypeError; // `Assert: IsConstructor(argument) is true` var aConstructor$5 = function (argument) { if (isConstructor$5(argument)) return argument; - throw $TypeError$u(tryToString(argument) + ' is not a constructor'); + throw new $TypeError$u(tryToString(argument) + ' is not a constructor'); }; var anObject$13 = anObject$1f; var aConstructor$4 = aConstructor$5; var isNullOrUndefined$g = isNullOrUndefined$k; -var wellKnownSymbol$y = wellKnownSymbol$T; +var wellKnownSymbol$x = wellKnownSymbol$S; -var SPECIES$2 = wellKnownSymbol$y('species'); +var SPECIES$2 = wellKnownSymbol$x('species'); // `SpeciesConstructor` abstract operation // https://tc39.es/ecma262/#sec-speciesconstructor @@ -4920,8 +4956,8 @@ var speciesConstructor$6 = function (O, defaultConstructor) { return C === undefined || isNullOrUndefined$g(S = anObject$13(C)[SPECIES$2]) ? defaultConstructor : aConstructor$4(S); }; -var $$4I = _export; -var uncurryThis$1t = functionUncurryThisClause; +var $$4J = _export; +var uncurryThis$1u = functionUncurryThisClause; var fails$14 = fails$1u; var ArrayBufferModule$2 = arrayBuffer; var anObject$12 = anObject$1f; @@ -4932,9 +4968,9 @@ var speciesConstructor$5 = speciesConstructor$6; var ArrayBuffer$4 = ArrayBufferModule$2.ArrayBuffer; var DataView$3 = ArrayBufferModule$2.DataView; var DataViewPrototype$1 = DataView$3.prototype; -var nativeArrayBufferSlice = uncurryThis$1t(ArrayBuffer$4.prototype.slice); -var getUint8$1 = uncurryThis$1t(DataViewPrototype$1.getUint8); -var setUint8$1 = uncurryThis$1t(DataViewPrototype$1.setUint8); +var nativeArrayBufferSlice = uncurryThis$1u(ArrayBuffer$4.prototype.slice); +var getUint8$1 = uncurryThis$1u(DataViewPrototype$1.getUint8); +var setUint8$1 = uncurryThis$1u(DataViewPrototype$1.setUint8); var INCORRECT_SLICE = fails$14(function () { return !new ArrayBuffer$4(2).slice(1, undefined).byteLength; @@ -4942,7 +4978,7 @@ var INCORRECT_SLICE = fails$14(function () { // `ArrayBuffer.prototype.slice` method // https://tc39.es/ecma262/#sec-arraybuffer.prototype.slice -$$4I({ target: 'ArrayBuffer', proto: true, unsafe: true, forced: INCORRECT_SLICE }, { +$$4J({ target: 'ArrayBuffer', proto: true, unsafe: true, forced: INCORRECT_SLICE }, { slice: function slice(start, end) { if (nativeArrayBufferSlice && end === undefined) { return nativeArrayBufferSlice(anObject$12(this), start); // FF fix @@ -4960,18 +4996,18 @@ $$4I({ target: 'ArrayBuffer', proto: true, unsafe: true, forced: INCORRECT_SLICE } }); -var $$4H = _export; +var $$4I = _export; var ArrayBufferModule$1 = arrayBuffer; var NATIVE_ARRAY_BUFFER = arrayBufferBasicDetection; // `DataView` constructor // https://tc39.es/ecma262/#sec-dataview-constructor -$$4H({ global: true, constructor: true, forced: !NATIVE_ARRAY_BUFFER }, { +$$4I({ global: true, constructor: true, forced: !NATIVE_ARRAY_BUFFER }, { DataView: ArrayBufferModule$1.DataView }); -var $$4G = _export; -var uncurryThis$1s = functionUncurryThis; +var $$4H = _export; +var uncurryThis$1t = functionUncurryThis; var fails$13 = fails$1u; // IE8- non-standard case @@ -4980,42 +5016,42 @@ var FORCED$s = fails$13(function () { return new Date(16e11).getYear() !== 120; }); -var getFullYear = uncurryThis$1s(Date.prototype.getFullYear); +var getFullYear = uncurryThis$1t(Date.prototype.getFullYear); // `Date.prototype.getYear` method // https://tc39.es/ecma262/#sec-date.prototype.getyear -$$4G({ target: 'Date', proto: true, forced: FORCED$s }, { +$$4H({ target: 'Date', proto: true, forced: FORCED$s }, { getYear: function getYear() { return getFullYear(this) - 1900; } }); // TODO: Remove from `core-js@4` -var $$4F = _export; -var uncurryThis$1r = functionUncurryThis; +var $$4G = _export; +var uncurryThis$1s = functionUncurryThis; var $Date = Date; -var thisTimeValue$4 = uncurryThis$1r($Date.prototype.getTime); +var thisTimeValue$4 = uncurryThis$1s($Date.prototype.getTime); // `Date.now` method // https://tc39.es/ecma262/#sec-date.now -$$4F({ target: 'Date', stat: true }, { +$$4G({ target: 'Date', stat: true }, { now: function now() { return thisTimeValue$4(new $Date()); } }); -var $$4E = _export; -var uncurryThis$1q = functionUncurryThis; +var $$4F = _export; +var uncurryThis$1r = functionUncurryThis; var toIntegerOrInfinity$e = toIntegerOrInfinity$p; var DatePrototype$3 = Date.prototype; -var thisTimeValue$3 = uncurryThis$1q(DatePrototype$3.getTime); -var setFullYear = uncurryThis$1q(DatePrototype$3.setFullYear); +var thisTimeValue$3 = uncurryThis$1r(DatePrototype$3.getTime); +var setFullYear = uncurryThis$1r(DatePrototype$3.setFullYear); // `Date.prototype.setYear` method // https://tc39.es/ecma262/#sec-date.prototype.setyear -$$4E({ target: 'Date', proto: true }, { +$$4F({ target: 'Date', proto: true }, { setYear: function setYear(year) { // validate thisTimeValue$3(this); @@ -5025,16 +5061,16 @@ $$4E({ target: 'Date', proto: true }, { } }); -var $$4D = _export; +var $$4E = _export; // `Date.prototype.toGMTString` method // https://tc39.es/ecma262/#sec-date.prototype.togmtstring -$$4D({ target: 'Date', proto: true }, { +$$4E({ target: 'Date', proto: true }, { toGMTString: Date.prototype.toUTCString }); var toIntegerOrInfinity$d = toIntegerOrInfinity$p; -var toString$C = toString$I; +var toString$D = toString$J; var requireObjectCoercible$m = requireObjectCoercible$p; var $RangeError$b = RangeError; @@ -5042,32 +5078,32 @@ var $RangeError$b = RangeError; // `String.prototype.repeat` method implementation // https://tc39.es/ecma262/#sec-string.prototype.repeat var stringRepeat = function repeat(count) { - var str = toString$C(requireObjectCoercible$m(this)); + var str = toString$D(requireObjectCoercible$m(this)); var result = ''; var n = toIntegerOrInfinity$d(count); - if (n < 0 || n === Infinity) throw $RangeError$b('Wrong number of repetitions'); + if (n < 0 || n === Infinity) throw new $RangeError$b('Wrong number of repetitions'); for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str; return result; }; // https://github.com/tc39/proposal-string-pad-start-end -var uncurryThis$1p = functionUncurryThis; +var uncurryThis$1q = functionUncurryThis; var toLength$8 = toLength$d; -var toString$B = toString$I; +var toString$C = toString$J; var $repeat$2 = stringRepeat; var requireObjectCoercible$l = requireObjectCoercible$p; -var repeat$3 = uncurryThis$1p($repeat$2); -var stringSlice$i = uncurryThis$1p(''.slice); +var repeat$3 = uncurryThis$1q($repeat$2); +var stringSlice$i = uncurryThis$1q(''.slice); var ceil = Math.ceil; // `String.prototype.{ padStart, padEnd }` methods implementation var createMethod$4 = function (IS_END) { return function ($this, maxLength, fillString) { - var S = toString$B(requireObjectCoercible$l($this)); + var S = toString$C(requireObjectCoercible$l($this)); var intMaxLength = toLength$8(maxLength); var stringLength = S.length; - var fillStr = fillString === undefined ? ' ' : toString$B(fillString); + var fillStr = fillString === undefined ? ' ' : toString$C(fillString); var fillLen, stringFiller; if (intMaxLength <= stringLength || fillStr === '') return S; fillLen = intMaxLength - stringLength; @@ -5086,23 +5122,23 @@ var stringPad = { end: createMethod$4(true) }; -var uncurryThis$1o = functionUncurryThis; +var uncurryThis$1p = functionUncurryThis; var fails$12 = fails$1u; var padStart = stringPad.start; var $RangeError$a = RangeError; -var $isFinite$2 = isFinite; -var abs$7 = Math.abs; +var $isFinite$1 = isFinite; +var abs$6 = Math.abs; var DatePrototype$2 = Date.prototype; var nativeDateToISOString = DatePrototype$2.toISOString; -var thisTimeValue$2 = uncurryThis$1o(DatePrototype$2.getTime); -var getUTCDate = uncurryThis$1o(DatePrototype$2.getUTCDate); -var getUTCFullYear = uncurryThis$1o(DatePrototype$2.getUTCFullYear); -var getUTCHours = uncurryThis$1o(DatePrototype$2.getUTCHours); -var getUTCMilliseconds = uncurryThis$1o(DatePrototype$2.getUTCMilliseconds); -var getUTCMinutes = uncurryThis$1o(DatePrototype$2.getUTCMinutes); -var getUTCMonth = uncurryThis$1o(DatePrototype$2.getUTCMonth); -var getUTCSeconds = uncurryThis$1o(DatePrototype$2.getUTCSeconds); +var thisTimeValue$2 = uncurryThis$1p(DatePrototype$2.getTime); +var getUTCDate = uncurryThis$1p(DatePrototype$2.getUTCDate); +var getUTCFullYear = uncurryThis$1p(DatePrototype$2.getUTCFullYear); +var getUTCHours = uncurryThis$1p(DatePrototype$2.getUTCHours); +var getUTCMilliseconds = uncurryThis$1p(DatePrototype$2.getUTCMilliseconds); +var getUTCMinutes = uncurryThis$1p(DatePrototype$2.getUTCMinutes); +var getUTCMonth = uncurryThis$1p(DatePrototype$2.getUTCMonth); +var getUTCSeconds = uncurryThis$1p(DatePrototype$2.getUTCSeconds); // `Date.prototype.toISOString` method implementation // https://tc39.es/ecma262/#sec-date.prototype.toisostring @@ -5112,12 +5148,12 @@ var dateToIsoString = (fails$12(function () { }) || !fails$12(function () { nativeDateToISOString.call(new Date(NaN)); })) ? function toISOString() { - if (!$isFinite$2(thisTimeValue$2(this))) throw $RangeError$a('Invalid time value'); + if (!$isFinite$1(thisTimeValue$2(this))) throw new $RangeError$a('Invalid time value'); var date = this; var year = getUTCFullYear(date); var milliseconds = getUTCMilliseconds(date); var sign = year < 0 ? '-' : year > 9999 ? '+' : ''; - return sign + padStart(abs$7(year), sign ? 6 : 4, 0) + + return sign + padStart(abs$6(year), sign ? 6 : 4, 0) + '-' + padStart(getUTCMonth(date) + 1, 2, 0) + '-' + padStart(getUTCDate(date), 2, 0) + 'T' + padStart(getUTCHours(date), 2, 0) + @@ -5127,17 +5163,17 @@ var dateToIsoString = (fails$12(function () { 'Z'; } : nativeDateToISOString; -var $$4C = _export; +var $$4D = _export; var toISOString = dateToIsoString; // `Date.prototype.toISOString` method // https://tc39.es/ecma262/#sec-date.prototype.toisostring // PhantomJS / old WebKit has a broken implementations -$$4C({ target: 'Date', proto: true, forced: Date.prototype.toISOString !== toISOString }, { +$$4D({ target: 'Date', proto: true, forced: Date.prototype.toISOString !== toISOString }, { toISOString: toISOString }); -var $$4B = _export; +var $$4C = _export; var fails$11 = fails$1u; var toObject$l = toObject$D; var toPrimitive$2 = toPrimitive$4; @@ -5149,7 +5185,7 @@ var FORCED$r = fails$11(function () { // `Date.prototype.toJSON` method // https://tc39.es/ecma262/#sec-date.prototype.tojson -$$4B({ target: 'Date', proto: true, arity: 1, forced: FORCED$r }, { +$$4C({ target: 'Date', proto: true, arity: 1, forced: FORCED$r }, { // eslint-disable-next-line no-unused-vars -- required for `.length` toJSON: function toJSON(key) { var O = toObject$l(this); @@ -5168,16 +5204,16 @@ var $TypeError$t = TypeError; var dateToPrimitive$1 = function (hint) { anObject$11(this); if (hint === 'string' || hint === 'default') hint = 'string'; - else if (hint !== 'number') throw $TypeError$t('Incorrect hint'); + else if (hint !== 'number') throw new $TypeError$t('Incorrect hint'); return ordinaryToPrimitive(this, hint); }; var hasOwn$p = hasOwnProperty_1; var defineBuiltIn$l = defineBuiltIn$u; var dateToPrimitive = dateToPrimitive$1; -var wellKnownSymbol$x = wellKnownSymbol$T; +var wellKnownSymbol$w = wellKnownSymbol$S; -var TO_PRIMITIVE = wellKnownSymbol$x('toPrimitive'); +var TO_PRIMITIVE = wellKnownSymbol$w('toPrimitive'); var DatePrototype$1 = Date.prototype; // `Date.prototype[@@toPrimitive]` method @@ -5187,14 +5223,14 @@ if (!hasOwn$p(DatePrototype$1, TO_PRIMITIVE)) { } // TODO: Remove from `core-js@4` -var uncurryThis$1n = functionUncurryThis; +var uncurryThis$1o = functionUncurryThis; var defineBuiltIn$k = defineBuiltIn$u; var DatePrototype = Date.prototype; var INVALID_DATE = 'Invalid Date'; var TO_STRING$1 = 'toString'; -var nativeDateToString = uncurryThis$1n(DatePrototype[TO_STRING$1]); -var thisTimeValue$1 = uncurryThis$1n(DatePrototype.getTime); +var nativeDateToString = uncurryThis$1o(DatePrototype[TO_STRING$1]); +var thisTimeValue$1 = uncurryThis$1o(DatePrototype.getTime); // `Date.prototype.toString` method // https://tc39.es/ecma262/#sec-date.prototype.tostring @@ -5206,15 +5242,15 @@ if (String(new Date(NaN)) !== INVALID_DATE) { }); } -var $$4A = _export; -var uncurryThis$1m = functionUncurryThis; -var toString$A = toString$I; +var $$4B = _export; +var uncurryThis$1n = functionUncurryThis; +var toString$B = toString$J; -var charAt$j = uncurryThis$1m(''.charAt); -var charCodeAt$7 = uncurryThis$1m(''.charCodeAt); -var exec$e = uncurryThis$1m(/./.exec); -var numberToString$2 = uncurryThis$1m(1.0.toString); -var toUpperCase = uncurryThis$1m(''.toUpperCase); +var charAt$j = uncurryThis$1n(''.charAt); +var charCodeAt$8 = uncurryThis$1n(''.charCodeAt); +var exec$e = uncurryThis$1n(/./.exec); +var numberToString$2 = uncurryThis$1n(1.0.toString); +var toUpperCase = uncurryThis$1n(''.toUpperCase); var raw = /[\w*+\-./@]/; @@ -5226,9 +5262,9 @@ var hex$1 = function (code, length) { // `escape` method // https://tc39.es/ecma262/#sec-escape-string -$$4A({ global: true }, { +$$4B({ global: true }, { escape: function escape(string) { - var str = toString$A(string); + var str = toString$B(string); var result = ''; var length = str.length; var index = 0; @@ -5238,7 +5274,7 @@ $$4A({ global: true }, { if (exec$e(raw, chr)) { result += chr; } else { - code = charCodeAt$7(chr, 0); + code = charCodeAt$8(chr, 0); if (code < 256) { result += '%' + hex$1(code, 2); } else { @@ -5249,7 +5285,7 @@ $$4A({ global: true }, { } }); -var uncurryThis$1l = functionUncurryThis; +var uncurryThis$1m = functionUncurryThis; var aCallable$E = aCallable$N; var isObject$x = isObject$K; var hasOwn$o = hasOwnProperty_1; @@ -5257,8 +5293,8 @@ var arraySlice$7 = arraySlice$b; var NATIVE_BIND = functionBindNative; var $Function = Function; -var concat$3 = uncurryThis$1l([].concat); -var join$8 = uncurryThis$1l([].join); +var concat$3 = uncurryThis$1m([].concat); +var join$8 = uncurryThis$1m([].join); var factories = {}; var construct = function (C, argsLength, args) { @@ -5286,31 +5322,31 @@ var functionBind = NATIVE_BIND ? $Function.bind : function bind(that /* , ...arg }; // TODO: Remove from `core-js@4` -var $$4z = _export; +var $$4A = _export; var bind$p = functionBind; // `Function.prototype.bind` method // https://tc39.es/ecma262/#sec-function.prototype.bind // eslint-disable-next-line es/no-function-prototype-bind -- detection -$$4z({ target: 'Function', proto: true, forced: Function.bind !== bind$p }, { +$$4A({ target: 'Function', proto: true, forced: Function.bind !== bind$p }, { bind: bind$p }); -var isCallable$o = isCallable$K; +var isCallable$n = isCallable$J; var isObject$w = isObject$K; var definePropertyModule$5 = objectDefineProperty; var getPrototypeOf$c = objectGetPrototypeOf$2; -var wellKnownSymbol$w = wellKnownSymbol$T; +var wellKnownSymbol$v = wellKnownSymbol$S; var makeBuiltIn$1 = makeBuiltInExports; -var HAS_INSTANCE = wellKnownSymbol$w('hasInstance'); +var HAS_INSTANCE = wellKnownSymbol$v('hasInstance'); var FunctionPrototype$2 = Function.prototype; // `Function.prototype[@@hasInstance]` method // https://tc39.es/ecma262/#sec-function.prototype-@@hasinstance if (!(HAS_INSTANCE in FunctionPrototype$2)) { definePropertyModule$5.f(FunctionPrototype$2, HAS_INSTANCE, { value: makeBuiltIn$1(function (O) { - if (!isCallable$o(this) || !isObject$w(O)) return false; + if (!isCallable$n(this) || !isObject$w(O)) return false; var P = this.prototype; if (!isObject$w(P)) return O instanceof this; // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: @@ -5321,13 +5357,13 @@ if (!(HAS_INSTANCE in FunctionPrototype$2)) { var DESCRIPTORS$B = descriptors; var FUNCTION_NAME_EXISTS = functionName.EXISTS; -var uncurryThis$1k = functionUncurryThis; +var uncurryThis$1l = functionUncurryThis; var defineBuiltInAccessor$i = defineBuiltInAccessor$o; var FunctionPrototype$1 = Function.prototype; -var functionToString = uncurryThis$1k(FunctionPrototype$1.toString); +var functionToString = uncurryThis$1l(FunctionPrototype$1.toString); var nameRE = /function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/; -var regExpExec$4 = uncurryThis$1k(nameRE.exec); +var regExpExec$4 = uncurryThis$1l(nameRE.exec); var NAME = 'name'; // Function instances `.name` property @@ -5345,12 +5381,12 @@ if (DESCRIPTORS$B && !FUNCTION_NAME_EXISTS) { }); } -var $$4y = _export; +var $$4z = _export; var global$O = global$16; // `globalThis` object // https://tc39.es/ecma262/#sec-globalthis -$$4y({ global: true, forced: global$O.globalThis !== global$O }, { +$$4z({ global: true, forced: global$O.globalThis !== global$O }, { globalThis: global$O }); @@ -5398,8 +5434,8 @@ var freezing = !fails$_(function () { return Object.isExtensible(Object.preventExtensions({})); }); -var $$4x = _export; -var uncurryThis$1j = functionUncurryThis; +var $$4y = _export; +var uncurryThis$1k = functionUncurryThis; var hiddenKeys = hiddenKeys$6; var isObject$u = isObject$K; var hasOwn$n = hasOwnProperty_1; @@ -5457,7 +5493,7 @@ var enable = function () { meta.enable = function () { /* empty */ }; REQUIRED = true; var getOwnPropertyNames = getOwnPropertyNamesModule.f; - var splice = uncurryThis$1j([].splice); + var splice = uncurryThis$1k([].splice); var test = {}; test[METADATA$1] = 1; @@ -5473,7 +5509,7 @@ var enable = function () { } return result; }; - $$4x({ target: 'Object', stat: true, forced: true }, { + $$4y({ target: 'Object', stat: true, forced: true }, { getOwnPropertyNames: getOwnPropertyNamesExternalModule.f }); } @@ -5490,15 +5526,15 @@ hiddenKeys[METADATA$1] = true; var internalMetadataExports = internalMetadata.exports; -var $$4w = _export; +var $$4x = _export; var global$M = global$16; -var uncurryThis$1i = functionUncurryThis; +var uncurryThis$1j = functionUncurryThis; var isForced$3 = isForced_1; var defineBuiltIn$j = defineBuiltIn$u; var InternalMetadataModule$1 = internalMetadataExports; var iterate$E = iterate$G; var anInstance$d = anInstance$f; -var isCallable$n = isCallable$K; +var isCallable$m = isCallable$J; var isNullOrUndefined$f = isNullOrUndefined$k; var isObject$t = isObject$K; var fails$Z = fails$1u; @@ -5516,7 +5552,7 @@ var collection$4 = function (CONSTRUCTOR_NAME, wrapper, common) { var exported = {}; var fixMethod = function (KEY) { - var uncurriedNativeMethod = uncurryThis$1i(NativePrototype[KEY]); + var uncurriedNativeMethod = uncurryThis$1j(NativePrototype[KEY]); defineBuiltIn$j(NativePrototype, KEY, KEY === 'add' ? function add(value) { uncurriedNativeMethod(this, value === 0 ? 0 : value); @@ -5536,7 +5572,7 @@ var collection$4 = function (CONSTRUCTOR_NAME, wrapper, common) { var REPLACE = isForced$3( CONSTRUCTOR_NAME, - !isCallable$n(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails$Z(function () { + !isCallable$m(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails$Z(function () { new NativeConstructor().entries().next(); })) ); @@ -5587,7 +5623,7 @@ var collection$4 = function (CONSTRUCTOR_NAME, wrapper, common) { } exported[CONSTRUCTOR_NAME] = Constructor; - $$4w({ global: true, constructor: true, forced: Constructor !== NativeConstructor }, exported); + $$4x({ global: true, constructor: true, forced: Constructor !== NativeConstructor }, exported); setToStringTag$6(Constructor, CONSTRUCTOR_NAME); @@ -5822,7 +5858,7 @@ var mathLog1p = Math.log1p || function log1p(x) { return n > -1e-8 && n < 1e-8 ? n - n * n / 2 : log$7(1 + n); }; -var $$4v = _export; +var $$4w = _export; var log1p$1 = mathLog1p; // eslint-disable-next-line es/no-math-acosh -- required for testing @@ -5839,7 +5875,7 @@ var FORCED$q = !$acosh // `Math.acosh` method // https://tc39.es/ecma262/#sec-math.acosh -$$4v({ target: 'Math', stat: true, forced: FORCED$q }, { +$$4w({ target: 'Math', stat: true, forced: FORCED$q }, { acosh: function acosh(x) { var n = +x; return n < 1 ? NaN : n > 94906265.62425156 @@ -5848,7 +5884,7 @@ $$4v({ target: 'Math', stat: true, forced: FORCED$q }, { } }); -var $$4u = _export; +var $$4v = _export; // eslint-disable-next-line es/no-math-asinh -- required for testing var $asinh = Math.asinh; @@ -5865,11 +5901,11 @@ var FORCED$p = !($asinh && 1 / $asinh(0) > 0); // `Math.asinh` method // https://tc39.es/ecma262/#sec-math.asinh // Tor Browser bug: Math.asinh(0) -> -0 -$$4u({ target: 'Math', stat: true, forced: FORCED$p }, { +$$4v({ target: 'Math', stat: true, forced: FORCED$p }, { asinh: asinh }); -var $$4t = _export; +var $$4u = _export; // eslint-disable-next-line es/no-math-atanh -- required for testing var $atanh = Math.atanh; @@ -5880,29 +5916,29 @@ var FORCED$o = !($atanh && 1 / $atanh(-0) < 0); // `Math.atanh` method // https://tc39.es/ecma262/#sec-math.atanh // Tor Browser bug: Math.atanh(-0) -> 0 -$$4t({ target: 'Math', stat: true, forced: FORCED$o }, { +$$4u({ target: 'Math', stat: true, forced: FORCED$o }, { atanh: function atanh(x) { var n = +x; return n === 0 ? n : log$4((1 + n) / (1 - n)) / 2; } }); -var $$4s = _export; -var sign$2 = mathSign; +var $$4t = _export; +var sign$1 = mathSign; -var abs$6 = Math.abs; -var pow$4 = Math.pow; +var abs$5 = Math.abs; +var pow$3 = Math.pow; // `Math.cbrt` method // https://tc39.es/ecma262/#sec-math.cbrt -$$4s({ target: 'Math', stat: true }, { +$$4t({ target: 'Math', stat: true }, { cbrt: function cbrt(x) { var n = +x; - return sign$2(n) * pow$4(abs$6(n), 1 / 3); + return sign$1(n) * pow$3(abs$5(n), 1 / 3); } }); -var $$4r = _export; +var $$4s = _export; var floor$7 = Math.floor; var log$3 = Math.log; @@ -5910,7 +5946,7 @@ var LOG2E = Math.LOG2E; // `Math.clz32` method // https://tc39.es/ecma262/#sec-math.clz32 -$$4r({ target: 'Math', stat: true }, { +$$4s({ target: 'Math', stat: true }, { clz32: function clz32(x) { var n = x >>> 0; return n ? 31 - floor$7(log$3(n + 0.5) * LOG2E) : 32; @@ -5934,70 +5970,41 @@ var mathExpm1 = (!$expm1 return n === 0 ? n : n > -1e-6 && n < 1e-6 ? n + n * n / 2 : exp$2(n) - 1; } : $expm1; -var $$4q = _export; +var $$4r = _export; var expm1$3 = mathExpm1; // eslint-disable-next-line es/no-math-cosh -- required for testing var $cosh = Math.cosh; -var abs$5 = Math.abs; +var abs$4 = Math.abs; var E$1 = Math.E; var FORCED$n = !$cosh || $cosh(710) === Infinity; // `Math.cosh` method // https://tc39.es/ecma262/#sec-math.cosh -$$4q({ target: 'Math', stat: true, forced: FORCED$n }, { +$$4r({ target: 'Math', stat: true, forced: FORCED$n }, { cosh: function cosh(x) { - var t = expm1$3(abs$5(x) - 1) + 1; + var t = expm1$3(abs$4(x) - 1) + 1; return (t + 1 / (t * E$1 * E$1)) * (E$1 / 2); } }); -var $$4p = _export; +var $$4q = _export; var expm1$2 = mathExpm1; // `Math.expm1` method // https://tc39.es/ecma262/#sec-math.expm1 // eslint-disable-next-line es/no-math-expm1 -- required for testing -$$4p({ target: 'Math', stat: true, forced: expm1$2 !== Math.expm1 }, { expm1: expm1$2 }); - -var sign$1 = mathSign; - -var abs$4 = Math.abs; -var pow$3 = Math.pow; -var EPSILON = pow$3(2, -52); -var EPSILON32 = pow$3(2, -23); -var MAX32 = pow$3(2, 127) * (2 - EPSILON32); -var MIN32 = pow$3(2, -126); - -var roundTiesToEven = function (n) { - return n + 1 / EPSILON - 1 / EPSILON; -}; - -// `Math.fround` method implementation -// https://tc39.es/ecma262/#sec-math.fround -// eslint-disable-next-line es/no-math-fround -- safe -var mathFround = Math.fround || function fround(x) { - var n = +x; - var $abs = abs$4(n); - var $sign = sign$1(n); - var a, result; - if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; - a = (1 + EPSILON32 / EPSILON) * $abs; - result = a - (a - $abs); - // eslint-disable-next-line no-self-compare -- NaN check - if (result > MAX32 || result !== result) return $sign * Infinity; - return $sign * result; -}; +$$4q({ target: 'Math', stat: true, forced: expm1$2 !== Math.expm1 }, { expm1: expm1$2 }); -var $$4o = _export; +var $$4p = _export; var fround$1 = mathFround; // `Math.fround` method // https://tc39.es/ecma262/#sec-math.fround -$$4o({ target: 'Math', stat: true }, { fround: fround$1 }); +$$4p({ target: 'Math', stat: true }, { fround: fround$1 }); -var $$4n = _export; +var $$4o = _export; // eslint-disable-next-line es/no-math-hypot -- required for testing var $hypot = Math.hypot; @@ -6010,7 +6017,7 @@ var FORCED$m = !!$hypot && $hypot(Infinity, NaN) !== Infinity; // `Math.hypot` method // https://tc39.es/ecma262/#sec-math.hypot -$$4n({ target: 'Math', stat: true, arity: 2, forced: FORCED$m }, { +$$4o({ target: 'Math', stat: true, arity: 2, forced: FORCED$m }, { // eslint-disable-next-line no-unused-vars -- required for `.length` hypot: function hypot(value1, value2) { var sum = 0; @@ -6033,7 +6040,7 @@ $$4n({ target: 'Math', stat: true, arity: 2, forced: FORCED$m }, { } }); -var $$4m = _export; +var $$4n = _export; var fails$Y = fails$1u; // eslint-disable-next-line es/no-math-imul -- required for testing @@ -6046,7 +6053,7 @@ var FORCED$l = fails$Y(function () { // `Math.imul` method // https://tc39.es/ecma262/#sec-math.imul // some WebKit versions fails with big numbers, some has wrong arity -$$4m({ target: 'Math', stat: true, forced: FORCED$l }, { +$$4n({ target: 'Math', stat: true, forced: FORCED$l }, { imul: function imul(x, y) { var UINT16 = 0xFFFF; var xn = +x; @@ -6065,45 +6072,45 @@ var mathLog10 = Math.log10 || function log10(x) { return log$2(x) * LOG10E; }; -var $$4l = _export; +var $$4m = _export; var log10$1 = mathLog10; // `Math.log10` method // https://tc39.es/ecma262/#sec-math.log10 -$$4l({ target: 'Math', stat: true }, { +$$4m({ target: 'Math', stat: true }, { log10: log10$1 }); -var $$4k = _export; +var $$4l = _export; var log1p = mathLog1p; // `Math.log1p` method // https://tc39.es/ecma262/#sec-math.log1p -$$4k({ target: 'Math', stat: true }, { log1p: log1p }); +$$4l({ target: 'Math', stat: true }, { log1p: log1p }); -var $$4j = _export; +var $$4k = _export; var log$1 = Math.log; var LN2 = Math.LN2; // `Math.log2` method // https://tc39.es/ecma262/#sec-math.log2 -$$4j({ target: 'Math', stat: true }, { +$$4k({ target: 'Math', stat: true }, { log2: function log2(x) { return log$1(x) / LN2; } }); -var $$4i = _export; +var $$4j = _export; var sign = mathSign; // `Math.sign` method // https://tc39.es/ecma262/#sec-math.sign -$$4i({ target: 'Math', stat: true }, { +$$4j({ target: 'Math', stat: true }, { sign: sign }); -var $$4h = _export; +var $$4i = _export; var fails$X = fails$1u; var expm1$1 = mathExpm1; @@ -6119,21 +6126,21 @@ var FORCED$k = fails$X(function () { // `Math.sinh` method // https://tc39.es/ecma262/#sec-math.sinh // V8 near Chromium 38 has a problem with very small numbers -$$4h({ target: 'Math', stat: true, forced: FORCED$k }, { +$$4i({ target: 'Math', stat: true, forced: FORCED$k }, { sinh: function sinh(x) { var n = +x; return abs$2(n) < 1 ? (expm1$1(n) - expm1$1(-n)) / 2 : (exp$1(n - 1) - exp$1(-n - 1)) * (E / 2); } }); -var $$4g = _export; +var $$4h = _export; var expm1 = mathExpm1; var exp = Math.exp; // `Math.tanh` method // https://tc39.es/ecma262/#sec-math.tanh -$$4g({ target: 'Math', stat: true }, { +$$4h({ target: 'Math', stat: true }, { tanh: function tanh(x) { var n = +x; var a = expm1(n); @@ -6148,40 +6155,40 @@ var setToStringTag$5 = setToStringTag$d; // https://tc39.es/ecma262/#sec-math-@@tostringtag setToStringTag$5(Math, 'Math', true); -var $$4f = _export; +var $$4g = _export; var trunc = mathTrunc; // `Math.trunc` method // https://tc39.es/ecma262/#sec-math.trunc -$$4f({ target: 'Math', stat: true }, { +$$4g({ target: 'Math', stat: true }, { trunc: trunc }); -var uncurryThis$1h = functionUncurryThis; +var uncurryThis$1i = functionUncurryThis; // `thisNumberValue` abstract operation // https://tc39.es/ecma262/#sec-thisnumbervalue -var thisNumberValue$5 = uncurryThis$1h(1.0.valueOf); +var thisNumberValue$5 = uncurryThis$1i(1.0.valueOf); // a string of all valid unicode whitespaces var whitespaces$6 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' + '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; -var uncurryThis$1g = functionUncurryThis; +var uncurryThis$1h = functionUncurryThis; var requireObjectCoercible$k = requireObjectCoercible$p; -var toString$z = toString$I; +var toString$A = toString$J; var whitespaces$5 = whitespaces$6; -var replace$8 = uncurryThis$1g(''.replace); +var replace$9 = uncurryThis$1h(''.replace); var ltrim = RegExp('^[' + whitespaces$5 + ']+'); var rtrim = RegExp('(^|[^' + whitespaces$5 + '])[' + whitespaces$5 + ']+$'); // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation var createMethod$3 = function (TYPE) { return function ($this) { - var string = toString$z(requireObjectCoercible$k($this)); - if (TYPE & 1) string = replace$8(string, ltrim, ''); - if (TYPE & 2) string = replace$8(string, rtrim, '$1'); + var string = toString$A(requireObjectCoercible$k($this)); + if (TYPE & 1) string = replace$9(string, ltrim, ''); + if (TYPE & 2) string = replace$9(string, rtrim, '$1'); return string; }; }; @@ -6198,12 +6205,12 @@ var stringTrim = { trim: createMethod$3(3) }; -var $$4e = _export; +var $$4f = _export; var IS_PURE$i = isPure; var DESCRIPTORS$z = descriptors; var global$L = global$16; var path = path$2; -var uncurryThis$1f = functionUncurryThis; +var uncurryThis$1g = functionUncurryThis; var isForced$2 = isForced_1; var hasOwn$m = hasOwnProperty_1; var inheritIfRequired$3 = inheritIfRequired$6; @@ -6222,8 +6229,8 @@ var NativeNumber = global$L[NUMBER]; path[NUMBER]; var NumberPrototype = NativeNumber.prototype; var TypeError$6 = global$L.TypeError; -var stringSlice$h = uncurryThis$1f(''.slice); -var charCodeAt$6 = uncurryThis$1f(''.charCodeAt); +var stringSlice$h = uncurryThis$1g(''.slice); +var charCodeAt$7 = uncurryThis$1g(''.charCodeAt); // `ToNumeric` abstract operation // https://tc39.es/ecma262/#sec-tonumeric @@ -6237,15 +6244,15 @@ var toNumeric = function (value) { var toNumber = function (argument) { var it = toPrimitive$1(argument, 'number'); var first, third, radix, maxCode, digits, length, index, code; - if (isSymbol$3(it)) throw TypeError$6('Cannot convert a Symbol value to a number'); + if (isSymbol$3(it)) throw new TypeError$6('Cannot convert a Symbol value to a number'); if (typeof it == 'string' && it.length > 2) { it = trim$2(it); - first = charCodeAt$6(it, 0); + first = charCodeAt$7(it, 0); if (first === 43 || first === 45) { - third = charCodeAt$6(it, 2); + third = charCodeAt$7(it, 2); if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix } else if (first === 48) { - switch (charCodeAt$6(it, 1)) { + switch (charCodeAt$7(it, 1)) { // fast equal of /^0b[01]+$/i case 66: case 98: @@ -6264,7 +6271,7 @@ var toNumber = function (argument) { digits = stringSlice$h(it, 2); length = digits.length; for (index = 0; index < length; index++) { - code = charCodeAt$6(digits, index); + code = charCodeAt$7(digits, index); // parseInt parses a string to a first unavailable symbol // but ToNumber should return NaN if a string contains unavailable symbols if (code < 48 || code > maxCode) return NaN; @@ -6290,7 +6297,7 @@ var NumberWrapper = function Number(value) { NumberWrapper.prototype = NumberPrototype; if (FORCED$j && !IS_PURE$i) NumberPrototype.constructor = NumberWrapper; -$$4e({ global: true, constructor: true, wrap: true, forced: FORCED$j }, { +$$4f({ global: true, constructor: true, wrap: true, forced: FORCED$j }, { Number: NumberWrapper }); @@ -6311,11 +6318,11 @@ var copyConstructorProperties$1 = function (target, source) { }; if (FORCED$j || IS_PURE$i) copyConstructorProperties$1(path[NUMBER], NativeNumber); -var $$4d = _export; +var $$4e = _export; // `Number.EPSILON` constant // https://tc39.es/ecma262/#sec-number.epsilon -$$4d({ target: 'Number', stat: true, nonConfigurable: true, nonWritable: true }, { +$$4e({ target: 'Number', stat: true, nonConfigurable: true, nonWritable: true }, { EPSILON: Math.pow(2, -52) }); @@ -6330,12 +6337,12 @@ var numberIsFinite$2 = Number.isFinite || function isFinite(it) { return typeof it == 'number' && globalIsFinite(it); }; -var $$4c = _export; +var $$4d = _export; var numberIsFinite$1 = numberIsFinite$2; // `Number.isFinite` method // https://tc39.es/ecma262/#sec-number.isfinite -$$4c({ target: 'Number', stat: true }, { isFinite: numberIsFinite$1 }); +$$4d({ target: 'Number', stat: true }, { isFinite: numberIsFinite$1 }); var isObject$s = isObject$K; @@ -6348,63 +6355,63 @@ var isIntegralNumber$3 = Number.isInteger || function isInteger(it) { return !isObject$s(it) && isFinite(it) && floor$6(it) === it; }; -var $$4b = _export; +var $$4c = _export; var isIntegralNumber$2 = isIntegralNumber$3; // `Number.isInteger` method // https://tc39.es/ecma262/#sec-number.isinteger -$$4b({ target: 'Number', stat: true }, { +$$4c({ target: 'Number', stat: true }, { isInteger: isIntegralNumber$2 }); -var $$4a = _export; +var $$4b = _export; // `Number.isNaN` method // https://tc39.es/ecma262/#sec-number.isnan -$$4a({ target: 'Number', stat: true }, { +$$4b({ target: 'Number', stat: true }, { isNaN: function isNaN(number) { // eslint-disable-next-line no-self-compare -- NaN check return number !== number; } }); -var $$49 = _export; +var $$4a = _export; var isIntegralNumber$1 = isIntegralNumber$3; var abs$1 = Math.abs; // `Number.isSafeInteger` method // https://tc39.es/ecma262/#sec-number.issafeinteger -$$49({ target: 'Number', stat: true }, { +$$4a({ target: 'Number', stat: true }, { isSafeInteger: function isSafeInteger(number) { return isIntegralNumber$1(number) && abs$1(number) <= 0x1FFFFFFFFFFFFF; } }); -var $$48 = _export; +var $$49 = _export; // `Number.MAX_SAFE_INTEGER` constant // https://tc39.es/ecma262/#sec-number.max_safe_integer -$$48({ target: 'Number', stat: true, nonConfigurable: true, nonWritable: true }, { +$$49({ target: 'Number', stat: true, nonConfigurable: true, nonWritable: true }, { MAX_SAFE_INTEGER: 0x1FFFFFFFFFFFFF }); -var $$47 = _export; +var $$48 = _export; // `Number.MIN_SAFE_INTEGER` constant // https://tc39.es/ecma262/#sec-number.min_safe_integer -$$47({ target: 'Number', stat: true, nonConfigurable: true, nonWritable: true }, { +$$48({ target: 'Number', stat: true, nonConfigurable: true, nonWritable: true }, { MIN_SAFE_INTEGER: -0x1FFFFFFFFFFFFF }); var global$J = global$16; var fails$V = fails$1u; -var uncurryThis$1e = functionUncurryThis; -var toString$y = toString$I; +var uncurryThis$1f = functionUncurryThis; +var toString$z = toString$J; var trim$1 = stringTrim.trim; var whitespaces$4 = whitespaces$6; -var charAt$i = uncurryThis$1e(''.charAt); +var charAt$i = uncurryThis$1f(''.charAt); var $parseFloat$1 = global$J.parseFloat; var Symbol$6 = global$J.Symbol; var ITERATOR$6 = Symbol$6 && Symbol$6.iterator; @@ -6415,25 +6422,25 @@ var FORCED$i = 1 / $parseFloat$1(whitespaces$4 + '-0') !== -Infinity // `parseFloat` method // https://tc39.es/ecma262/#sec-parsefloat-string var numberParseFloat = FORCED$i ? function parseFloat(string) { - var trimmedString = trim$1(toString$y(string)); + var trimmedString = trim$1(toString$z(string)); var result = $parseFloat$1(trimmedString); return result === 0 && charAt$i(trimmedString, 0) === '-' ? -0 : result; } : $parseFloat$1; -var $$46 = _export; +var $$47 = _export; var parseFloat$1 = numberParseFloat; // `Number.parseFloat` method // https://tc39.es/ecma262/#sec-number.parseFloat // eslint-disable-next-line es/no-number-parsefloat -- required for testing -$$46({ target: 'Number', stat: true, forced: Number.parseFloat !== parseFloat$1 }, { +$$47({ target: 'Number', stat: true, forced: Number.parseFloat !== parseFloat$1 }, { parseFloat: parseFloat$1 }); var global$I = global$16; var fails$U = fails$1u; -var uncurryThis$1d = functionUncurryThis; -var toString$x = toString$I; +var uncurryThis$1e = functionUncurryThis; +var toString$y = toString$J; var trim = stringTrim.trim; var whitespaces$3 = whitespaces$6; @@ -6441,7 +6448,7 @@ var $parseInt$2 = global$I.parseInt; var Symbol$5 = global$I.Symbol; var ITERATOR$5 = Symbol$5 && Symbol$5.iterator; var hex = /^[+-]?0x/i; -var exec$d = uncurryThis$1d(hex.exec); +var exec$d = uncurryThis$1e(hex.exec); var FORCED$h = $parseInt$2(whitespaces$3 + '08') !== 8 || $parseInt$2(whitespaces$3 + '0x16') !== 22 // MS Edge 18- broken with boxed symbols || (ITERATOR$5 && !fails$U(function () { $parseInt$2(Object(ITERATOR$5)); })); @@ -6449,22 +6456,22 @@ var FORCED$h = $parseInt$2(whitespaces$3 + '08') !== 8 || $parseInt$2(whitespace // `parseInt` method // https://tc39.es/ecma262/#sec-parseint-string-radix var numberParseInt = FORCED$h ? function parseInt(string, radix) { - var S = trim(toString$x(string)); + var S = trim(toString$y(string)); return $parseInt$2(S, (radix >>> 0) || (exec$d(hex, S) ? 16 : 10)); } : $parseInt$2; -var $$45 = _export; +var $$46 = _export; var parseInt$3 = numberParseInt; // `Number.parseInt` method // https://tc39.es/ecma262/#sec-number.parseint // eslint-disable-next-line es/no-number-parseint -- required for testing -$$45({ target: 'Number', stat: true, forced: Number.parseInt !== parseInt$3 }, { +$$46({ target: 'Number', stat: true, forced: Number.parseInt !== parseInt$3 }, { parseInt: parseInt$3 }); -var $$44 = _export; -var uncurryThis$1c = functionUncurryThis; +var $$45 = _export; +var uncurryThis$1d = functionUncurryThis; var toIntegerOrInfinity$c = toIntegerOrInfinity$p; var thisNumberValue$3 = thisNumberValue$5; var $repeat$1 = stringRepeat; @@ -6473,14 +6480,14 @@ var fails$T = fails$1u; var $RangeError$9 = RangeError; var $String$2 = String; -var $isFinite$1 = isFinite; +var $isFinite = isFinite; var abs = Math.abs; var floor$5 = Math.floor; var pow$2 = Math.pow; var round$1 = Math.round; -var nativeToExponential = uncurryThis$1c(1.0.toExponential); -var repeat$2 = uncurryThis$1c($repeat$1); -var stringSlice$g = uncurryThis$1c(''.slice); +var nativeToExponential = uncurryThis$1d(1.0.toExponential); +var repeat$2 = uncurryThis$1d($repeat$1); +var stringSlice$g = uncurryThis$1d(''.slice); // Edge 17- var ROUNDS_PROPERLY = nativeToExponential(-6.9e-11, 4) === '-6.9000e-11' @@ -6512,14 +6519,14 @@ var FORCED$g = !ROUNDS_PROPERLY || !throwsOnInfinityFraction() || !properNonFini // `Number.prototype.toExponential` method // https://tc39.es/ecma262/#sec-number.prototype.toexponential -$$44({ target: 'Number', proto: true, forced: FORCED$g }, { +$$45({ target: 'Number', proto: true, forced: FORCED$g }, { toExponential: function toExponential(fractionDigits) { var x = thisNumberValue$3(this); if (fractionDigits === undefined) return nativeToExponential(x); var f = toIntegerOrInfinity$c(fractionDigits); - if (!$isFinite$1(x)) return String(x); + if (!$isFinite(x)) return String(x); // TODO: ES2018 increased the maximum number of fraction digits to 100, need to improve the implementation - if (f < 0 || f > 20) throw $RangeError$9('Incorrect fraction digits'); + if (f < 0 || f > 20) throw new $RangeError$9('Incorrect fraction digits'); if (ROUNDS_PROPERLY) return nativeToExponential(x, f); var s = ''; var m = ''; @@ -6565,8 +6572,8 @@ $$44({ target: 'Number', proto: true, forced: FORCED$g }, { } }); -var $$43 = _export; -var uncurryThis$1b = functionUncurryThis; +var $$44 = _export; +var uncurryThis$1c = functionUncurryThis; var toIntegerOrInfinity$b = toIntegerOrInfinity$p; var thisNumberValue$2 = thisNumberValue$5; var $repeat = stringRepeat; @@ -6575,9 +6582,9 @@ var fails$S = fails$1u; var $RangeError$8 = RangeError; var $String$1 = String; var floor$4 = Math.floor; -var repeat$1 = uncurryThis$1b($repeat); -var stringSlice$f = uncurryThis$1b(''.slice); -var nativeToFixed = uncurryThis$1b(1.0.toFixed); +var repeat$1 = uncurryThis$1c($repeat); +var stringSlice$f = uncurryThis$1c(''.slice); +var nativeToFixed = uncurryThis$1c(1.0.toFixed); var pow$1 = function (x, n, acc) { return n === 0 ? acc : n % 2 === 1 ? pow$1(x, n - 1, acc * x) : pow$1(x * x, n / 2, acc); @@ -6639,7 +6646,7 @@ var FORCED$f = fails$S(function () { // `Number.prototype.toFixed` method // https://tc39.es/ecma262/#sec-number.prototype.tofixed -$$43({ target: 'Number', proto: true, forced: FORCED$f }, { +$$44({ target: 'Number', proto: true, forced: FORCED$f }, { toFixed: function toFixed(fractionDigits) { var number = thisNumberValue$2(this); var fractDigits = toIntegerOrInfinity$b(fractionDigits); @@ -6649,7 +6656,7 @@ $$43({ target: 'Number', proto: true, forced: FORCED$f }, { var e, z, j, k; // TODO: ES2018 increased the maximum number of fraction digits to 100, need to improve the implementation - if (fractDigits < 0 || fractDigits > 20) throw $RangeError$8('Incorrect fraction digits'); + if (fractDigits < 0 || fractDigits > 20) throw new $RangeError$8('Incorrect fraction digits'); // eslint-disable-next-line no-self-compare -- NaN check if (number !== number) return 'NaN'; if (number <= -1e21 || number >= 1e21) return $String$1(number); @@ -6696,12 +6703,12 @@ $$43({ target: 'Number', proto: true, forced: FORCED$f }, { } }); -var $$42 = _export; -var uncurryThis$1a = functionUncurryThis; +var $$43 = _export; +var uncurryThis$1b = functionUncurryThis; var fails$R = fails$1u; var thisNumberValue$1 = thisNumberValue$5; -var nativeToPrecision = uncurryThis$1a(1.0.toPrecision); +var nativeToPrecision = uncurryThis$1b(1.0.toPrecision); var FORCED$e = fails$R(function () { // IE7- @@ -6713,7 +6720,7 @@ var FORCED$e = fails$R(function () { // `Number.prototype.toPrecision` method // https://tc39.es/ecma262/#sec-number.prototype.toprecision -$$42({ target: 'Number', proto: true, forced: FORCED$e }, { +$$43({ target: 'Number', proto: true, forced: FORCED$e }, { toPrecision: function toPrecision(precision) { return precision === undefined ? nativeToPrecision(thisNumberValue$1(this)) @@ -6722,7 +6729,7 @@ $$42({ target: 'Number', proto: true, forced: FORCED$e }, { }); var DESCRIPTORS$y = descriptors; -var uncurryThis$19 = functionUncurryThis; +var uncurryThis$1a = functionUncurryThis; var call$15 = functionCall; var fails$Q = fails$1u; var objectKeys$3 = objectKeys$6; @@ -6735,7 +6742,7 @@ var IndexedObject$2 = indexedObject; var $assign = Object.assign; // eslint-disable-next-line es/no-object-defineproperty -- required for testing var defineProperty$8 = Object.defineProperty; -var concat$2 = uncurryThis$19([].concat); +var concat$2 = uncurryThis$1a([].concat); // `Object.assign` method // https://tc39.es/ecma262/#sec-object.assign @@ -6778,24 +6785,24 @@ var objectAssign = !$assign || fails$Q(function () { } return T; } : $assign; -var $$41 = _export; +var $$42 = _export; var assign$1 = objectAssign; // `Object.assign` method // https://tc39.es/ecma262/#sec-object.assign // eslint-disable-next-line es/no-object-assign -- required for testing -$$41({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign$1 }, { +$$42({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign$1 }, { assign: assign$1 }); // TODO: Remove from `core-js@4` -var $$40 = _export; +var $$41 = _export; var DESCRIPTORS$x = descriptors; var create$d = objectCreate$1; // `Object.create` method // https://tc39.es/ecma262/#sec-object.create -$$40({ target: 'Object', stat: true, sham: !DESCRIPTORS$x }, { +$$41({ target: 'Object', stat: true, sham: !DESCRIPTORS$x }, { create: create$d }); @@ -6815,7 +6822,7 @@ var objectPrototypeAccessorsForced = !fails$P(function () { delete global$H[key]; }); -var $$3$ = _export; +var $$40 = _export; var DESCRIPTORS$w = descriptors; var FORCED$d = objectPrototypeAccessorsForced; var aCallable$D = aCallable$N; @@ -6825,36 +6832,36 @@ var definePropertyModule$4 = objectDefineProperty; // `Object.prototype.__defineGetter__` method // https://tc39.es/ecma262/#sec-object.prototype.__defineGetter__ if (DESCRIPTORS$w) { - $$3$({ target: 'Object', proto: true, forced: FORCED$d }, { + $$40({ target: 'Object', proto: true, forced: FORCED$d }, { __defineGetter__: function __defineGetter__(P, getter) { definePropertyModule$4.f(toObject$j(this), P, { get: aCallable$D(getter), enumerable: true, configurable: true }); } }); } -var $$3_ = _export; +var $$3$ = _export; var DESCRIPTORS$v = descriptors; var defineProperties = objectDefineProperties.f; // `Object.defineProperties` method // https://tc39.es/ecma262/#sec-object.defineproperties // eslint-disable-next-line es/no-object-defineproperties -- safe -$$3_({ target: 'Object', stat: true, forced: Object.defineProperties !== defineProperties, sham: !DESCRIPTORS$v }, { +$$3$({ target: 'Object', stat: true, forced: Object.defineProperties !== defineProperties, sham: !DESCRIPTORS$v }, { defineProperties: defineProperties }); -var $$3Z = _export; +var $$3_ = _export; var DESCRIPTORS$u = descriptors; var defineProperty$7 = objectDefineProperty.f; // `Object.defineProperty` method // https://tc39.es/ecma262/#sec-object.defineproperty // eslint-disable-next-line es/no-object-defineproperty -- safe -$$3Z({ target: 'Object', stat: true, forced: Object.defineProperty !== defineProperty$7, sham: !DESCRIPTORS$u }, { +$$3_({ target: 'Object', stat: true, forced: Object.defineProperty !== defineProperty$7, sham: !DESCRIPTORS$u }, { defineProperty: defineProperty$7 }); -var $$3Y = _export; +var $$3Z = _export; var DESCRIPTORS$t = descriptors; var FORCED$c = objectPrototypeAccessorsForced; var aCallable$C = aCallable$N; @@ -6864,7 +6871,7 @@ var definePropertyModule$3 = objectDefineProperty; // `Object.prototype.__defineSetter__` method // https://tc39.es/ecma262/#sec-object.prototype.__defineSetter__ if (DESCRIPTORS$t) { - $$3Y({ target: 'Object', proto: true, forced: FORCED$c }, { + $$3Z({ target: 'Object', proto: true, forced: FORCED$c }, { __defineSetter__: function __defineSetter__(P, setter) { definePropertyModule$3.f(toObject$i(this), P, { set: aCallable$C(setter), enumerable: true, configurable: true }); } @@ -6873,14 +6880,14 @@ if (DESCRIPTORS$t) { var DESCRIPTORS$s = descriptors; var fails$O = fails$1u; -var uncurryThis$18 = functionUncurryThis; +var uncurryThis$19 = functionUncurryThis; var objectGetPrototypeOf$1 = objectGetPrototypeOf$2; var objectKeys$2 = objectKeys$6; var toIndexedObject$5 = toIndexedObject$k; var $propertyIsEnumerable = objectPropertyIsEnumerable.f; -var propertyIsEnumerable = uncurryThis$18($propertyIsEnumerable); -var push$m = uncurryThis$18([].push); +var propertyIsEnumerable = uncurryThis$19($propertyIsEnumerable); +var push$m = uncurryThis$19([].push); // in some IE versions, `propertyIsEnumerable` returns incorrect result on integer keys // of `null` prototype objects @@ -6920,18 +6927,18 @@ var objectToArray = { values: createMethod$2(false) }; -var $$3X = _export; +var $$3Y = _export; var $entries = objectToArray.entries; // `Object.entries` method // https://tc39.es/ecma262/#sec-object.entries -$$3X({ target: 'Object', stat: true }, { +$$3Y({ target: 'Object', stat: true }, { entries: function entries(O) { return $entries(O); } }); -var $$3W = _export; +var $$3X = _export; var FREEZING$6 = freezing; var fails$N = fails$1u; var isObject$r = isObject$K; @@ -6943,19 +6950,19 @@ var FAILS_ON_PRIMITIVES$5 = fails$N(function () { $freeze(1); }); // `Object.freeze` method // https://tc39.es/ecma262/#sec-object.freeze -$$3W({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$5, sham: !FREEZING$6 }, { +$$3X({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$5, sham: !FREEZING$6 }, { freeze: function freeze(it) { return $freeze && isObject$r(it) ? $freeze(onFreeze$2(it)) : it; } }); -var $$3V = _export; +var $$3W = _export; var iterate$C = iterate$G; var createProperty$4 = createProperty$b; // `Object.fromEntries` method // https://github.com/tc39/proposal-object-from-entries -$$3V({ target: 'Object', stat: true }, { +$$3W({ target: 'Object', stat: true }, { fromEntries: function fromEntries(iterable) { var obj = {}; iterate$C(iterable, function (k, v) { @@ -6965,7 +6972,7 @@ $$3V({ target: 'Object', stat: true }, { } }); -var $$3U = _export; +var $$3V = _export; var fails$M = fails$1u; var toIndexedObject$4 = toIndexedObject$k; var nativeGetOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f; @@ -6975,13 +6982,13 @@ var FORCED$b = !DESCRIPTORS$r || fails$M(function () { nativeGetOwnPropertyDescr // `Object.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor -$$3U({ target: 'Object', stat: true, forced: FORCED$b, sham: !DESCRIPTORS$r }, { +$$3V({ target: 'Object', stat: true, forced: FORCED$b, sham: !DESCRIPTORS$r }, { getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) { return nativeGetOwnPropertyDescriptor$1(toIndexedObject$4(it), key); } }); -var $$3T = _export; +var $$3U = _export; var DESCRIPTORS$q = descriptors; var ownKeys$1 = ownKeys$3; var toIndexedObject$3 = toIndexedObject$k; @@ -6990,7 +6997,7 @@ var createProperty$3 = createProperty$b; // `Object.getOwnPropertyDescriptors` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors -$$3T({ target: 'Object', stat: true, sham: !DESCRIPTORS$q }, { +$$3U({ target: 'Object', stat: true, sham: !DESCRIPTORS$q }, { getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { var O = toIndexedObject$3(object); var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule$4.f; @@ -7006,7 +7013,7 @@ $$3T({ target: 'Object', stat: true, sham: !DESCRIPTORS$q }, { } }); -var $$3S = _export; +var $$3T = _export; var fails$L = fails$1u; var getOwnPropertyNames$3 = objectGetOwnPropertyNamesExternal.f; @@ -7015,11 +7022,11 @@ var FAILS_ON_PRIMITIVES$4 = fails$L(function () { return !Object.getOwnPropertyN // `Object.getOwnPropertyNames` method // https://tc39.es/ecma262/#sec-object.getownpropertynames -$$3S({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$4 }, { +$$3T({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$4 }, { getOwnPropertyNames: getOwnPropertyNames$3 }); -var $$3R = _export; +var $$3S = _export; var fails$K = fails$1u; var toObject$h = toObject$D; var nativeGetPrototypeOf = objectGetPrototypeOf$2; @@ -7029,18 +7036,18 @@ var FAILS_ON_PRIMITIVES$3 = fails$K(function () { nativeGetPrototypeOf(1); }); // `Object.getPrototypeOf` method // https://tc39.es/ecma262/#sec-object.getprototypeof -$$3R({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$3, sham: !CORRECT_PROTOTYPE_GETTER$1 }, { +$$3S({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$3, sham: !CORRECT_PROTOTYPE_GETTER$1 }, { getPrototypeOf: function getPrototypeOf(it) { return nativeGetPrototypeOf(toObject$h(it)); } }); -var $$3Q = _export; +var $$3R = _export; var hasOwn$l = hasOwnProperty_1; // `Object.hasOwn` method // https://tc39.es/ecma262/#sec-object.hasown -$$3Q({ target: 'Object', stat: true }, { +$$3R({ target: 'Object', stat: true }, { hasOwn: hasOwn$l }); @@ -7052,26 +7059,26 @@ var sameValue$1 = Object.is || function is(x, y) { return x === y ? x !== 0 || 1 / x === 1 / y : x !== x && y !== y; }; -var $$3P = _export; +var $$3Q = _export; var is = sameValue$1; // `Object.is` method // https://tc39.es/ecma262/#sec-object.is -$$3P({ target: 'Object', stat: true }, { +$$3Q({ target: 'Object', stat: true }, { is: is }); -var $$3O = _export; +var $$3P = _export; var $isExtensible$1 = objectIsExtensible; // `Object.isExtensible` method // https://tc39.es/ecma262/#sec-object.isextensible // eslint-disable-next-line es/no-object-isextensible -- safe -$$3O({ target: 'Object', stat: true, forced: Object.isExtensible !== $isExtensible$1 }, { +$$3P({ target: 'Object', stat: true, forced: Object.isExtensible !== $isExtensible$1 }, { isExtensible: $isExtensible$1 }); -var $$3N = _export; +var $$3O = _export; var fails$J = fails$1u; var isObject$q = isObject$K; var classof$g = classofRaw$2; @@ -7084,7 +7091,7 @@ var FORCED$a = ARRAY_BUFFER_NON_EXTENSIBLE$1 || fails$J(function () { $isFrozen( // `Object.isFrozen` method // https://tc39.es/ecma262/#sec-object.isfrozen -$$3N({ target: 'Object', stat: true, forced: FORCED$a }, { +$$3O({ target: 'Object', stat: true, forced: FORCED$a }, { isFrozen: function isFrozen(it) { if (!isObject$q(it)) return true; if (ARRAY_BUFFER_NON_EXTENSIBLE$1 && classof$g(it) === 'ArrayBuffer') return true; @@ -7092,7 +7099,7 @@ $$3N({ target: 'Object', stat: true, forced: FORCED$a }, { } }); -var $$3M = _export; +var $$3N = _export; var fails$I = fails$1u; var isObject$p = isObject$K; var classof$f = classofRaw$2; @@ -7105,7 +7112,7 @@ var FORCED$9 = ARRAY_BUFFER_NON_EXTENSIBLE || fails$I(function () { $isSealed(1) // `Object.isSealed` method // https://tc39.es/ecma262/#sec-object.issealed -$$3M({ target: 'Object', stat: true, forced: FORCED$9 }, { +$$3N({ target: 'Object', stat: true, forced: FORCED$9 }, { isSealed: function isSealed(it) { if (!isObject$p(it)) return true; if (ARRAY_BUFFER_NON_EXTENSIBLE && classof$f(it) === 'ArrayBuffer') return true; @@ -7113,7 +7120,7 @@ $$3M({ target: 'Object', stat: true, forced: FORCED$9 }, { } }); -var $$3L = _export; +var $$3M = _export; var toObject$g = toObject$D; var nativeKeys = objectKeys$6; var fails$H = fails$1u; @@ -7122,13 +7129,13 @@ var FAILS_ON_PRIMITIVES$2 = fails$H(function () { nativeKeys(1); }); // `Object.keys` method // https://tc39.es/ecma262/#sec-object.keys -$$3L({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$2 }, { +$$3M({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$2 }, { keys: function keys(it) { return nativeKeys(toObject$g(it)); } }); -var $$3K = _export; +var $$3L = _export; var DESCRIPTORS$p = descriptors; var FORCED$8 = objectPrototypeAccessorsForced; var toObject$f = toObject$D; @@ -7139,7 +7146,7 @@ var getOwnPropertyDescriptor$a = objectGetOwnPropertyDescriptor.f; // `Object.prototype.__lookupGetter__` method // https://tc39.es/ecma262/#sec-object.prototype.__lookupGetter__ if (DESCRIPTORS$p) { - $$3K({ target: 'Object', proto: true, forced: FORCED$8 }, { + $$3L({ target: 'Object', proto: true, forced: FORCED$8 }, { __lookupGetter__: function __lookupGetter__(P) { var O = toObject$f(this); var key = toPropertyKey$5(P); @@ -7151,7 +7158,7 @@ if (DESCRIPTORS$p) { }); } -var $$3J = _export; +var $$3K = _export; var DESCRIPTORS$o = descriptors; var FORCED$7 = objectPrototypeAccessorsForced; var toObject$e = toObject$D; @@ -7162,7 +7169,7 @@ var getOwnPropertyDescriptor$9 = objectGetOwnPropertyDescriptor.f; // `Object.prototype.__lookupSetter__` method // https://tc39.es/ecma262/#sec-object.prototype.__lookupSetter__ if (DESCRIPTORS$o) { - $$3J({ target: 'Object', proto: true, forced: FORCED$7 }, { + $$3K({ target: 'Object', proto: true, forced: FORCED$7 }, { __lookupSetter__: function __lookupSetter__(P) { var O = toObject$e(this); var key = toPropertyKey$4(P); @@ -7174,7 +7181,7 @@ if (DESCRIPTORS$o) { }); } -var $$3I = _export; +var $$3J = _export; var isObject$o = isObject$K; var onFreeze$1 = internalMetadataExports.onFreeze; var FREEZING$5 = freezing; @@ -7186,7 +7193,7 @@ var FAILS_ON_PRIMITIVES$1 = fails$G(function () { $preventExtensions(1); }); // `Object.preventExtensions` method // https://tc39.es/ecma262/#sec-object.preventextensions -$$3I({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$1, sham: !FREEZING$5 }, { +$$3J({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$1, sham: !FREEZING$5 }, { preventExtensions: function preventExtensions(it) { return $preventExtensions && isObject$o(it) ? $preventExtensions(onFreeze$1(it)) : it; } @@ -7221,7 +7228,7 @@ if (DESCRIPTORS$n && getPrototypeOf$9 && setPrototypeOf$4 && !(PROTO in ObjectPr }); } catch (error) { /* empty */ } -var $$3H = _export; +var $$3I = _export; var isObject$m = isObject$K; var onFreeze = internalMetadataExports.onFreeze; var FREEZING$4 = freezing; @@ -7233,18 +7240,18 @@ var FAILS_ON_PRIMITIVES = fails$F(function () { $seal(1); }); // `Object.seal` method // https://tc39.es/ecma262/#sec-object.seal -$$3H({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING$4 }, { +$$3I({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING$4 }, { seal: function seal(it) { return $seal && isObject$m(it) ? $seal(onFreeze(it)) : it; } }); -var $$3G = _export; +var $$3H = _export; var setPrototypeOf$3 = objectSetPrototypeOf$1; // `Object.setPrototypeOf` method // https://tc39.es/ecma262/#sec-object.setprototypeof -$$3G({ target: 'Object', stat: true }, { +$$3H({ target: 'Object', stat: true }, { setPrototypeOf: setPrototypeOf$3 }); @@ -7259,47 +7266,47 @@ var objectToString = TO_STRING_TAG_SUPPORT$1 ? {}.toString : function toString() var TO_STRING_TAG_SUPPORT = toStringTagSupport; var defineBuiltIn$i = defineBuiltIn$u; -var toString$w = objectToString; +var toString$x = objectToString; // `Object.prototype.toString` method // https://tc39.es/ecma262/#sec-object.prototype.tostring if (!TO_STRING_TAG_SUPPORT) { - defineBuiltIn$i(Object.prototype, 'toString', toString$w, { unsafe: true }); + defineBuiltIn$i(Object.prototype, 'toString', toString$x, { unsafe: true }); } -var $$3F = _export; +var $$3G = _export; var $values = objectToArray.values; // `Object.values` method // https://tc39.es/ecma262/#sec-object.values -$$3F({ target: 'Object', stat: true }, { +$$3G({ target: 'Object', stat: true }, { values: function values(O) { return $values(O); } }); -var $$3E = _export; +var $$3F = _export; var $parseFloat = numberParseFloat; // `parseFloat` method // https://tc39.es/ecma262/#sec-parsefloat-string -$$3E({ global: true, forced: parseFloat !== $parseFloat }, { +$$3F({ global: true, forced: parseFloat !== $parseFloat }, { parseFloat: $parseFloat }); -var $$3D = _export; +var $$3E = _export; var $parseInt$1 = numberParseInt; // `parseInt` method // https://tc39.es/ecma262/#sec-parseint-string-radix -$$3D({ global: true, forced: parseInt !== $parseInt$1 }, { +$$3E({ global: true, forced: parseInt !== $parseInt$1 }, { parseInt: $parseInt$1 }); var $TypeError$s = TypeError; var validateArgumentsLength$b = function (passed, required) { - if (passed < required) throw $TypeError$s('Not enough arguments'); + if (passed < required) throw new $TypeError$s('Not enough arguments'); return passed; }; @@ -7311,7 +7318,7 @@ var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$3); var global$G = global$16; var apply$9 = functionApply$1; var bind$n = functionBindContext; -var isCallable$m = isCallable$K; +var isCallable$l = isCallable$J; var hasOwn$k = hasOwnProperty_1; var fails$E = fails$1u; var html = html$2; @@ -7331,7 +7338,7 @@ var String$1 = global$G.String; var counter = 0; var queue$2 = {}; var ONREADYSTATECHANGE = 'onreadystatechange'; -var $location, defer, channel, port; +var $location, defer, channel$1, port; fails$E(function () { // Deno throws a ReferenceError on `location` access without `--location` flag @@ -7365,7 +7372,7 @@ var globalPostMessageDefer = function (id) { if (!set$9 || !clear) { set$9 = function setImmediate(handler) { validateArgumentsLength$a(arguments.length, 1); - var fn = isCallable$m(handler) ? handler : Function$2(handler); + var fn = isCallable$l(handler) ? handler : Function$2(handler); var args = arraySlice$6(arguments, 1); queue$2[++counter] = function () { apply$9(fn, undefined, args); @@ -7389,15 +7396,15 @@ if (!set$9 || !clear) { // Browsers with MessageChannel, includes WebWorkers // except iOS - https://github.com/zloirock/core-js/issues/624 } else if (MessageChannel && !IS_IOS$1) { - channel = new MessageChannel(); - port = channel.port2; - channel.port1.onmessage = eventListener; + channel$1 = new MessageChannel(); + port = channel$1.port2; + channel$1.port1.onmessage = eventListener; defer = bind$n(port.postMessage, port); // Browsers with postMessage, skip WebWorkers // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' } else if ( global$G.addEventListener && - isCallable$m(global$G.postMessage) && + isCallable$l(global$G.postMessage) && !global$G.importScripts && $location && $location.protocol !== 'file:' && !fails$E(globalPostMessageDefer) @@ -7570,18 +7577,18 @@ var engineIsBrowser = !IS_DENO$2 && !IS_NODE$4 var global$D = global$16; var NativePromiseConstructor$4 = promiseNativeConstructor; -var isCallable$l = isCallable$K; +var isCallable$k = isCallable$J; var isForced$1 = isForced_1; var inspectSource$1 = inspectSource$4; -var wellKnownSymbol$v = wellKnownSymbol$T; +var wellKnownSymbol$u = wellKnownSymbol$S; var IS_BROWSER$1 = engineIsBrowser; var IS_DENO$1 = engineIsDeno; var V8_VERSION = engineV8Version; NativePromiseConstructor$4 && NativePromiseConstructor$4.prototype; -var SPECIES$1 = wellKnownSymbol$v('species'); +var SPECIES$1 = wellKnownSymbol$u('species'); var SUBCLASSING = false; -var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable$l(global$D.PromiseRejectionEvent); +var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable$k(global$D.PromiseRejectionEvent); var FORCED_PROMISE_CONSTRUCTOR$5 = isForced$1('Promise', function () { var PROMISE_CONSTRUCTOR_SOURCE = inspectSource$1(NativePromiseConstructor$4); @@ -7622,7 +7629,7 @@ var $TypeError$r = TypeError; var PromiseCapability = function (C) { var resolve, reject; this.promise = new C(function ($$resolve, $$reject) { - if (resolve !== undefined || reject !== undefined) throw $TypeError$r('Bad Promise constructor'); + if (resolve !== undefined || reject !== undefined) throw new $TypeError$r('Bad Promise constructor'); resolve = $$resolve; reject = $$reject; }); @@ -7636,7 +7643,7 @@ newPromiseCapability$2.f = function (C) { return new PromiseCapability(C); }; -var $$3C = _export; +var $$3D = _export; var IS_NODE$3 = engineIsNode; var global$C = global$16; var call$14 = functionCall; @@ -7645,7 +7652,7 @@ var setPrototypeOf$2 = objectSetPrototypeOf$1; var setToStringTag$4 = setToStringTag$d; var setSpecies$3 = setSpecies$7; var aCallable$A = aCallable$N; -var isCallable$k = isCallable$K; +var isCallable$j = isCallable$J; var isObject$l = isObject$K; var anInstance$b = anInstance$f; var speciesConstructor$4 = speciesConstructor$6; @@ -7688,7 +7695,7 @@ var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen; // helpers var isThenable = function (it) { var then; - return isObject$l(it) && isCallable$k(then = it.then) ? then : false; + return isObject$l(it) && isCallable$j(then = it.then) ? then : false; }; var callReaction = function (reaction, state) { @@ -7715,7 +7722,7 @@ var callReaction = function (reaction, state) { } } if (result === reaction.promise) { - reject(TypeError$5('Promise-chain cycle')); + reject(new TypeError$5('Promise-chain cycle')); } else if (then = isThenable(result)) { call$14(then, result, resolve, reject); } else resolve(result); @@ -7805,7 +7812,7 @@ var internalResolve = function (state, value, unwrap) { state.done = true; if (unwrap) state = unwrap; try { - if (state.facade === value) throw TypeError$5("Promise can't be resolved itself"); + if (state.facade === value) throw new TypeError$5("Promise can't be resolved itself"); var then = isThenable(value); if (then) { microtask$1(function () { @@ -7866,8 +7873,8 @@ if (FORCED_PROMISE_CONSTRUCTOR$4) { var state = getInternalPromiseState(this); var reaction = newPromiseCapability$1(speciesConstructor$4(this, PromiseConstructor)); state.parent = true; - reaction.ok = isCallable$k(onFulfilled) ? onFulfilled : true; - reaction.fail = isCallable$k(onRejected) && onRejected; + reaction.ok = isCallable$j(onFulfilled) ? onFulfilled : true; + reaction.fail = isCallable$j(onRejected) && onRejected; reaction.domain = IS_NODE$3 ? process$1.domain : undefined; if (state.state === PENDING$2) state.reactions.add(reaction); else microtask$1(function () { @@ -7890,7 +7897,7 @@ if (FORCED_PROMISE_CONSTRUCTOR$4) { : newGenericPromiseCapability(C); }; - if (isCallable$k(NativePromiseConstructor$3) && NativePromisePrototype$2 !== Object.prototype) { + if (isCallable$j(NativePromiseConstructor$3) && NativePromisePrototype$2 !== Object.prototype) { nativeThen = NativePromisePrototype$2.then; if (!NATIVE_PROMISE_SUBCLASSING) { @@ -7916,7 +7923,7 @@ if (FORCED_PROMISE_CONSTRUCTOR$4) { } } -$$3C({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, { +$$3D({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, { Promise: PromiseConstructor }); @@ -7931,7 +7938,7 @@ var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCor NativePromiseConstructor$2.all(iterable).then(undefined, function () { /* empty */ }); }); -var $$3B = _export; +var $$3C = _export; var call$13 = functionCall; var aCallable$z = aCallable$N; var newPromiseCapabilityModule$6 = newPromiseCapability$2; @@ -7941,7 +7948,7 @@ var PROMISE_STATICS_INCORRECT_ITERATION$3 = promiseStaticsIncorrectIteration; // `Promise.all` method // https://tc39.es/ecma262/#sec-promise.all -$$3B({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$3 }, { +$$3C({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$3 }, { all: function all(iterable) { var C = this; var capability = newPromiseCapabilityModule$6.f(C); @@ -7970,32 +7977,32 @@ $$3B({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATIO } }); -var $$3A = _export; +var $$3B = _export; var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR; var NativePromiseConstructor$1 = promiseNativeConstructor; var getBuiltIn$A = getBuiltIn$M; -var isCallable$j = isCallable$K; +var isCallable$i = isCallable$J; var defineBuiltIn$g = defineBuiltIn$u; var NativePromisePrototype$1 = NativePromiseConstructor$1 && NativePromiseConstructor$1.prototype; // `Promise.prototype.catch` method // https://tc39.es/ecma262/#sec-promise.prototype.catch -$$3A({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, { +$$3B({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, { 'catch': function (onRejected) { return this.then(undefined, onRejected); } }); // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then` -if (isCallable$j(NativePromiseConstructor$1)) { +if (isCallable$i(NativePromiseConstructor$1)) { var method$1 = getBuiltIn$A('Promise').prototype['catch']; if (NativePromisePrototype$1['catch'] !== method$1) { defineBuiltIn$g(NativePromisePrototype$1, 'catch', method$1, { unsafe: true }); } } -var $$3z = _export; +var $$3A = _export; var call$12 = functionCall; var aCallable$y = aCallable$N; var newPromiseCapabilityModule$5 = newPromiseCapability$2; @@ -8005,7 +8012,7 @@ var PROMISE_STATICS_INCORRECT_ITERATION$2 = promiseStaticsIncorrectIteration; // `Promise.race` method // https://tc39.es/ecma262/#sec-promise.race -$$3z({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$2 }, { +$$3A({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$2 }, { race: function race(iterable) { var C = this; var capability = newPromiseCapabilityModule$5.f(C); @@ -8021,14 +8028,14 @@ $$3z({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATIO } }); -var $$3y = _export; +var $$3z = _export; var call$11 = functionCall; var newPromiseCapabilityModule$4 = newPromiseCapability$2; var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR; // `Promise.reject` method // https://tc39.es/ecma262/#sec-promise.reject -$$3y({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, { +$$3z({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, { reject: function reject(r) { var capability = newPromiseCapabilityModule$4.f(this); call$11(capability.reject, undefined, r); @@ -8049,7 +8056,7 @@ var promiseResolve$2 = function (C, x) { return promiseCapability.promise; }; -var $$3x = _export; +var $$3y = _export; var getBuiltIn$z = getBuiltIn$M; var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR; var promiseResolve$1 = promiseResolve$2; @@ -8058,13 +8065,13 @@ getBuiltIn$z('Promise'); // `Promise.resolve` method // https://tc39.es/ecma262/#sec-promise.resolve -$$3x({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, { +$$3y({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, { resolve: function resolve(x) { return promiseResolve$1(this, x); } }); -var $$3w = _export; +var $$3x = _export; var call$10 = functionCall; var aCallable$x = aCallable$N; var newPromiseCapabilityModule$3 = newPromiseCapability$2; @@ -8074,7 +8081,7 @@ var PROMISE_STATICS_INCORRECT_ITERATION$1 = promiseStaticsIncorrectIteration; // `Promise.allSettled` method // https://tc39.es/ecma262/#sec-promise.allsettled -$$3w({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, { +$$3x({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, { allSettled: function allSettled(iterable) { var C = this; var capability = newPromiseCapabilityModule$3.f(C); @@ -8108,7 +8115,7 @@ $$3w({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATIO } }); -var $$3v = _export; +var $$3w = _export; var call$$ = functionCall; var aCallable$w = aCallable$N; var getBuiltIn$y = getBuiltIn$M; @@ -8121,7 +8128,7 @@ var PROMISE_ANY_ERROR = 'No one promise resolved'; // `Promise.any` method // https://tc39.es/ecma262/#sec-promise.any -$$3v({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, { +$$3w({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, { any: function any(iterable) { var C = this; var AggregateError = getBuiltIn$y('AggregateError'); @@ -8156,11 +8163,11 @@ $$3v({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATIO } }); -var $$3u = _export; +var $$3v = _export; var NativePromiseConstructor = promiseNativeConstructor; var fails$D = fails$1u; var getBuiltIn$x = getBuiltIn$M; -var isCallable$i = isCallable$K; +var isCallable$h = isCallable$J; var speciesConstructor$3 = speciesConstructor$6; var promiseResolve = promiseResolve$2; var defineBuiltIn$f = defineBuiltIn$u; @@ -8175,10 +8182,10 @@ var NON_GENERIC = !!NativePromiseConstructor && fails$D(function () { // `Promise.prototype.finally` method // https://tc39.es/ecma262/#sec-promise.prototype.finally -$$3u({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, { +$$3v({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, { 'finally': function (onFinally) { var C = speciesConstructor$3(this, getBuiltIn$x('Promise')); - var isFunction = isCallable$i(onFinally); + var isFunction = isCallable$h(onFinally); return this.then( isFunction ? function (x) { return promiseResolve(C, onFinally()).then(function () { return x; }); @@ -8191,14 +8198,14 @@ $$3u({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, { }); // makes sure that native promise-based APIs `Promise#finally` properly works with patched `Promise#then` -if (isCallable$i(NativePromiseConstructor)) { +if (isCallable$h(NativePromiseConstructor)) { var method = getBuiltIn$x('Promise').prototype['finally']; if (NativePromisePrototype['finally'] !== method) { defineBuiltIn$f(NativePromisePrototype, 'finally', method, { unsafe: true }); } } -var $$3t = _export; +var $$3u = _export; var functionApply = functionApply$1; var aCallable$v = aCallable$N; var anObject$$ = anObject$1f; @@ -8212,13 +8219,13 @@ var OPTIONAL_ARGUMENTS_LIST = !fails$C(function () { // `Reflect.apply` method // https://tc39.es/ecma262/#sec-reflect.apply -$$3t({ target: 'Reflect', stat: true, forced: OPTIONAL_ARGUMENTS_LIST }, { +$$3u({ target: 'Reflect', stat: true, forced: OPTIONAL_ARGUMENTS_LIST }, { apply: function apply(target, thisArgument, argumentsList) { return functionApply(aCallable$v(target), thisArgument, anObject$$(argumentsList)); } }); -var $$3s = _export; +var $$3t = _export; var getBuiltIn$w = getBuiltIn$M; var apply$8 = functionApply$1; var bind$k = functionBind; @@ -8247,7 +8254,7 @@ var ARGS_BUG = !fails$B(function () { var FORCED$6 = NEW_TARGET_BUG || ARGS_BUG; -$$3s({ target: 'Reflect', stat: true, forced: FORCED$6, sham: FORCED$6 }, { +$$3t({ target: 'Reflect', stat: true, forced: FORCED$6, sham: FORCED$6 }, { construct: function construct(Target, args /* , newTarget */) { aConstructor$3(Target); anObject$_(args); @@ -8275,7 +8282,7 @@ $$3s({ target: 'Reflect', stat: true, forced: FORCED$6, sham: FORCED$6 }, { } }); -var $$3r = _export; +var $$3s = _export; var DESCRIPTORS$m = descriptors; var anObject$Z = anObject$1f; var toPropertyKey$3 = toPropertyKey$a; @@ -8290,7 +8297,7 @@ var ERROR_INSTEAD_OF_FALSE = fails$A(function () { // `Reflect.defineProperty` method // https://tc39.es/ecma262/#sec-reflect.defineproperty -$$3r({ target: 'Reflect', stat: true, forced: ERROR_INSTEAD_OF_FALSE, sham: !DESCRIPTORS$m }, { +$$3s({ target: 'Reflect', stat: true, forced: ERROR_INSTEAD_OF_FALSE, sham: !DESCRIPTORS$m }, { defineProperty: function defineProperty(target, propertyKey, attributes) { anObject$Z(target); var key = toPropertyKey$3(propertyKey); @@ -8304,13 +8311,13 @@ $$3r({ target: 'Reflect', stat: true, forced: ERROR_INSTEAD_OF_FALSE, sham: !DES } }); -var $$3q = _export; +var $$3r = _export; var anObject$Y = anObject$1f; var getOwnPropertyDescriptor$7 = objectGetOwnPropertyDescriptor.f; // `Reflect.deleteProperty` method // https://tc39.es/ecma262/#sec-reflect.deleteproperty -$$3q({ target: 'Reflect', stat: true }, { +$$3r({ target: 'Reflect', stat: true }, { deleteProperty: function deleteProperty(target, propertyKey) { var descriptor = getOwnPropertyDescriptor$7(anObject$Y(target), propertyKey); return descriptor && !descriptor.configurable ? false : delete target[propertyKey]; @@ -8323,7 +8330,7 @@ var isDataDescriptor$2 = function (descriptor) { return descriptor !== undefined && (hasOwn$j(descriptor, 'value') || hasOwn$j(descriptor, 'writable')); }; -var $$3p = _export; +var $$3q = _export; var call$_ = functionCall; var isObject$i = isObject$K; var anObject$X = anObject$1f; @@ -8344,76 +8351,76 @@ function get$4(target, propertyKey /* , receiver */) { if (isObject$i(prototype = getPrototypeOf$8(target))) return get$4(prototype, propertyKey, receiver); } -$$3p({ target: 'Reflect', stat: true }, { +$$3q({ target: 'Reflect', stat: true }, { get: get$4 }); -var $$3o = _export; +var $$3p = _export; var DESCRIPTORS$l = descriptors; var anObject$W = anObject$1f; var getOwnPropertyDescriptorModule$2 = objectGetOwnPropertyDescriptor; // `Reflect.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-reflect.getownpropertydescriptor -$$3o({ target: 'Reflect', stat: true, sham: !DESCRIPTORS$l }, { +$$3p({ target: 'Reflect', stat: true, sham: !DESCRIPTORS$l }, { getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { return getOwnPropertyDescriptorModule$2.f(anObject$W(target), propertyKey); } }); -var $$3n = _export; +var $$3o = _export; var anObject$V = anObject$1f; var objectGetPrototypeOf = objectGetPrototypeOf$2; var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter; // `Reflect.getPrototypeOf` method // https://tc39.es/ecma262/#sec-reflect.getprototypeof -$$3n({ target: 'Reflect', stat: true, sham: !CORRECT_PROTOTYPE_GETTER }, { +$$3o({ target: 'Reflect', stat: true, sham: !CORRECT_PROTOTYPE_GETTER }, { getPrototypeOf: function getPrototypeOf(target) { return objectGetPrototypeOf(anObject$V(target)); } }); -var $$3m = _export; +var $$3n = _export; // `Reflect.has` method // https://tc39.es/ecma262/#sec-reflect.has -$$3m({ target: 'Reflect', stat: true }, { +$$3n({ target: 'Reflect', stat: true }, { has: function has(target, propertyKey) { return propertyKey in target; } }); -var $$3l = _export; +var $$3m = _export; var anObject$U = anObject$1f; var $isExtensible = objectIsExtensible; // `Reflect.isExtensible` method // https://tc39.es/ecma262/#sec-reflect.isextensible -$$3l({ target: 'Reflect', stat: true }, { +$$3m({ target: 'Reflect', stat: true }, { isExtensible: function isExtensible(target) { anObject$U(target); return $isExtensible(target); } }); -var $$3k = _export; +var $$3l = _export; var ownKeys = ownKeys$3; // `Reflect.ownKeys` method // https://tc39.es/ecma262/#sec-reflect.ownkeys -$$3k({ target: 'Reflect', stat: true }, { +$$3l({ target: 'Reflect', stat: true }, { ownKeys: ownKeys }); -var $$3j = _export; +var $$3k = _export; var getBuiltIn$v = getBuiltIn$M; var anObject$T = anObject$1f; var FREEZING$3 = freezing; // `Reflect.preventExtensions` method // https://tc39.es/ecma262/#sec-reflect.preventextensions -$$3j({ target: 'Reflect', stat: true, sham: !FREEZING$3 }, { +$$3k({ target: 'Reflect', stat: true, sham: !FREEZING$3 }, { preventExtensions: function preventExtensions(target) { anObject$T(target); try { @@ -8426,7 +8433,7 @@ $$3j({ target: 'Reflect', stat: true, sham: !FREEZING$3 }, { } }); -var $$3i = _export; +var $$3j = _export; var call$Z = functionCall; var anObject$S = anObject$1f; var isObject$h = isObject$K; @@ -8472,18 +8479,18 @@ var MS_EDGE_BUG = fails$z(function () { return Reflect.set(Constructor.prototype, 'a', 1, object) !== false; }); -$$3i({ target: 'Reflect', stat: true, forced: MS_EDGE_BUG }, { +$$3j({ target: 'Reflect', stat: true, forced: MS_EDGE_BUG }, { set: set$8 }); -var $$3h = _export; +var $$3i = _export; var anObject$R = anObject$1f; var aPossiblePrototype = aPossiblePrototype$2; var objectSetPrototypeOf = objectSetPrototypeOf$1; // `Reflect.setPrototypeOf` method // https://tc39.es/ecma262/#sec-reflect.setprototypeof -if (objectSetPrototypeOf) $$3h({ target: 'Reflect', stat: true }, { +if (objectSetPrototypeOf) $$3i({ target: 'Reflect', stat: true }, { setPrototypeOf: function setPrototypeOf(target, proto) { anObject$R(target); aPossiblePrototype(proto); @@ -8496,11 +8503,11 @@ if (objectSetPrototypeOf) $$3h({ target: 'Reflect', stat: true }, { } }); -var $$3g = _export; +var $$3h = _export; var global$B = global$16; var setToStringTag$3 = setToStringTag$d; -$$3g({ global: true }, { Reflect: {} }); +$$3h({ global: true }, { Reflect: {} }); // Reflect[@@toStringTag] property // https://tc39.es/ecma262/#sec-reflect-@@tostringtag @@ -8508,9 +8515,9 @@ setToStringTag$3(global$B.Reflect, 'Reflect', true); var isObject$g = isObject$K; var classof$d = classofRaw$2; -var wellKnownSymbol$u = wellKnownSymbol$T; +var wellKnownSymbol$t = wellKnownSymbol$S; -var MATCH$2 = wellKnownSymbol$u('match'); +var MATCH$2 = wellKnownSymbol$t('match'); // `IsRegExp` abstract operation // https://tc39.es/ecma262/#sec-isregexp @@ -8589,7 +8596,7 @@ var $RegExp$1 = global$z.RegExp; var regexpUnsupportedDotAll = fails$x(function () { var re = $RegExp$1('.', 's'); - return !(re.dotAll && re.exec('\n') && re.flags === 's'); + return !(re.dotAll && re.test('\n') && re.flags === 's'); }); var fails$w = fails$1u; @@ -8606,14 +8613,14 @@ var regexpUnsupportedNcg = fails$w(function () { var DESCRIPTORS$k = descriptors; var global$x = global$16; -var uncurryThis$17 = functionUncurryThis; +var uncurryThis$18 = functionUncurryThis; var isForced = isForced_1; var inheritIfRequired$2 = inheritIfRequired$6; var createNonEnumerableProperty$a = createNonEnumerableProperty$k; var getOwnPropertyNames$2 = objectGetOwnPropertyNames.f; var isPrototypeOf$4 = objectIsPrototypeOf; var isRegExp$4 = isRegexp; -var toString$v = toString$I; +var toString$w = toString$J; var getRegExpFlags$4 = regexpGetFlags; var stickyHelpers$2 = regexpStickyHelpers; var proxyAccessor = proxyAccessor$2; @@ -8622,19 +8629,19 @@ var fails$v = fails$1u; var hasOwn$h = hasOwnProperty_1; var enforceInternalState$2 = internalState.enforce; var setSpecies$2 = setSpecies$7; -var wellKnownSymbol$t = wellKnownSymbol$T; +var wellKnownSymbol$s = wellKnownSymbol$S; var UNSUPPORTED_DOT_ALL$2 = regexpUnsupportedDotAll; var UNSUPPORTED_NCG$1 = regexpUnsupportedNcg; -var MATCH$1 = wellKnownSymbol$t('match'); +var MATCH$1 = wellKnownSymbol$s('match'); var NativeRegExp = global$x.RegExp; var RegExpPrototype$6 = NativeRegExp.prototype; var SyntaxError$3 = global$x.SyntaxError; -var exec$c = uncurryThis$17(RegExpPrototype$6.exec); -var charAt$h = uncurryThis$17(''.charAt); -var replace$7 = uncurryThis$17(''.replace); -var stringIndexOf$5 = uncurryThis$17(''.indexOf); -var stringSlice$e = uncurryThis$17(''.slice); +var exec$c = uncurryThis$18(RegExpPrototype$6.exec); +var charAt$h = uncurryThis$18(''.charAt); +var replace$8 = uncurryThis$18(''.replace); +var stringIndexOf$5 = uncurryThis$18(''.indexOf); +var stringSlice$e = uncurryThis$18(''.slice); // TODO: Use only proper RegExpIdentifierName var IS_NCG = /^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/; var re1 = /a/g; @@ -8741,20 +8748,20 @@ if (isForced('RegExp', BASE_FORCED)) { if (flagsAreUndefined) flags = getRegExpFlags$4(rawPattern); } - pattern = pattern === undefined ? '' : toString$v(pattern); - flags = flags === undefined ? '' : toString$v(flags); + pattern = pattern === undefined ? '' : toString$w(pattern); + flags = flags === undefined ? '' : toString$w(flags); rawPattern = pattern; if (UNSUPPORTED_DOT_ALL$2 && 'dotAll' in re1) { dotAll = !!flags && stringIndexOf$5(flags, 's') > -1; - if (dotAll) flags = replace$7(flags, /s/g, ''); + if (dotAll) flags = replace$8(flags, /s/g, ''); } rawFlags = flags; if (MISSED_STICKY$1 && 'sticky' in re1) { sticky = !!flags && stringIndexOf$5(flags, 'y') > -1; - if (sticky && UNSUPPORTED_Y$2) flags = replace$7(flags, /y/g, ''); + if (sticky && UNSUPPORTED_Y$2) flags = replace$8(flags, /y/g, ''); } if (UNSUPPORTED_NCG$1) { @@ -8816,7 +8823,7 @@ if (DESCRIPTORS$j && UNSUPPORTED_DOT_ALL$1) { if (classof$c(this) === 'RegExp') { return !!getInternalState$c(this).dotAll; } - throw $TypeError$q('Incompatible receiver, RegExp required'); + throw new $TypeError$q('Incompatible receiver, RegExp required'); } }); } @@ -8824,8 +8831,8 @@ if (DESCRIPTORS$j && UNSUPPORTED_DOT_ALL$1) { /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */ /* eslint-disable regexp/no-useless-quantifier -- testing */ var call$X = functionCall; -var uncurryThis$16 = functionUncurryThis; -var toString$u = toString$I; +var uncurryThis$17 = functionUncurryThis; +var toString$v = toString$J; var regexpFlags = regexpFlags$1; var stickyHelpers$1 = regexpStickyHelpers; var shared$4 = sharedExports; @@ -8837,10 +8844,10 @@ var UNSUPPORTED_NCG = regexpUnsupportedNcg; var nativeReplace = shared$4('native-string-replace', String.prototype.replace); var nativeExec = RegExp.prototype.exec; var patchedExec = nativeExec; -var charAt$g = uncurryThis$16(''.charAt); -var indexOf$1 = uncurryThis$16(''.indexOf); -var replace$6 = uncurryThis$16(''.replace); -var stringSlice$d = uncurryThis$16(''.slice); +var charAt$g = uncurryThis$17(''.charAt); +var indexOf$1 = uncurryThis$17(''.indexOf); +var replace$7 = uncurryThis$17(''.replace); +var stringSlice$d = uncurryThis$17(''.slice); var UPDATES_LAST_INDEX_WRONG = (function () { var re1 = /a/; @@ -8861,7 +8868,7 @@ if (PATCH) { patchedExec = function exec(string) { var re = this; var state = getInternalState$b(re); - var str = toString$u(string); + var str = toString$v(string); var raw = state.raw; var result, reCopy, lastIndex, match, i, object, group; @@ -8880,7 +8887,7 @@ if (PATCH) { var strCopy = str; if (sticky) { - flags = replace$6(flags, 'y', ''); + flags = replace$7(flags, 'y', ''); if (indexOf$1(flags, 'g') === -1) { flags += 'g'; } @@ -8938,12 +8945,12 @@ if (PATCH) { var regexpExec$3 = patchedExec; -var $$3f = _export; +var $$3g = _export; var exec$b = regexpExec$3; // `RegExp.prototype.exec` method // https://tc39.es/ecma262/#sec-regexp.prototype.exec -$$3f({ target: 'RegExp', proto: true, forced: /./.exec !== exec$b }, { +$$3g({ target: 'RegExp', proto: true, forced: /./.exec !== exec$b }, { exec: exec$b }); @@ -9024,18 +9031,18 @@ if (DESCRIPTORS$h && MISSED_STICKY) { if (classof$b(this) === 'RegExp') { return !!getInternalState$a(this).sticky; } - throw $TypeError$p('Incompatible receiver, RegExp required'); + throw new $TypeError$p('Incompatible receiver, RegExp required'); } }); } // TODO: Remove from `core-js@4` since it's moved to entry points -var $$3e = _export; +var $$3f = _export; var call$W = functionCall; -var isCallable$h = isCallable$K; +var isCallable$g = isCallable$J; var anObject$P = anObject$1f; -var toString$t = toString$I; +var toString$u = toString$J; var DELEGATES_TO_EXEC = function () { var execCalled = false; @@ -9051,12 +9058,12 @@ var nativeTest = /./.test; // `RegExp.prototype.test` method // https://tc39.es/ecma262/#sec-regexp.prototype.test -$$3e({ target: 'RegExp', proto: true, forced: !DELEGATES_TO_EXEC }, { +$$3f({ target: 'RegExp', proto: true, forced: !DELEGATES_TO_EXEC }, { test: function (S) { var R = anObject$P(this); - var string = toString$t(S); + var string = toString$u(S); var exec = R.exec; - if (!isCallable$h(exec)) return call$W(nativeTest, R, string); + if (!isCallable$g(exec)) return call$W(nativeTest, R, string); var result = call$W(exec, R, string); if (result === null) return false; anObject$P(result); @@ -9067,7 +9074,7 @@ $$3e({ target: 'RegExp', proto: true, forced: !DELEGATES_TO_EXEC }, { var PROPER_FUNCTION_NAME$1 = functionName.PROPER; var defineBuiltIn$d = defineBuiltIn$u; var anObject$O = anObject$1f; -var $toString$2 = toString$I; +var $toString$2 = toString$J; var fails$t = fails$1u; var getRegExpFlags$3 = regexpGetFlags; @@ -9099,14 +9106,14 @@ collection$2('Set', function (init) { return function Set() { return init(this, arguments.length ? arguments[0] : undefined); }; }, collectionStrong); -var $$3d = _export; -var uncurryThis$15 = functionUncurryThis; +var $$3e = _export; +var uncurryThis$16 = functionUncurryThis; var requireObjectCoercible$i = requireObjectCoercible$p; var toIntegerOrInfinity$a = toIntegerOrInfinity$p; -var toString$s = toString$I; +var toString$t = toString$J; var fails$s = fails$1u; -var charAt$f = uncurryThis$15(''.charAt); +var charAt$f = uncurryThis$16(''.charAt); var FORCED$4 = fails$s(function () { // eslint-disable-next-line es/no-array-string-prototype-at -- safe @@ -9115,9 +9122,9 @@ var FORCED$4 = fails$s(function () { // `String.prototype.at` method // https://tc39.es/ecma262/#sec-string.prototype.at -$$3d({ target: 'String', proto: true, forced: FORCED$4 }, { +$$3e({ target: 'String', proto: true, forced: FORCED$4 }, { at: function at(index) { - var S = toString$s(requireObjectCoercible$i(this)); + var S = toString$t(requireObjectCoercible$i(this)); var len = S.length; var relativeIndex = toIntegerOrInfinity$a(index); var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex; @@ -9125,25 +9132,25 @@ $$3d({ target: 'String', proto: true, forced: FORCED$4 }, { } }); -var uncurryThis$14 = functionUncurryThis; +var uncurryThis$15 = functionUncurryThis; var toIntegerOrInfinity$9 = toIntegerOrInfinity$p; -var toString$r = toString$I; +var toString$s = toString$J; var requireObjectCoercible$h = requireObjectCoercible$p; -var charAt$e = uncurryThis$14(''.charAt); -var charCodeAt$5 = uncurryThis$14(''.charCodeAt); -var stringSlice$c = uncurryThis$14(''.slice); +var charAt$e = uncurryThis$15(''.charAt); +var charCodeAt$6 = uncurryThis$15(''.charCodeAt); +var stringSlice$c = uncurryThis$15(''.slice); var createMethod$1 = function (CONVERT_TO_STRING) { return function ($this, pos) { - var S = toString$r(requireObjectCoercible$h($this)); + var S = toString$s(requireObjectCoercible$h($this)); var position = toIntegerOrInfinity$9(pos); var size = S.length; var first, second; if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined; - first = charCodeAt$5(S, position); + first = charCodeAt$6(S, position); return first < 0xD800 || first > 0xDBFF || position + 1 === size - || (second = charCodeAt$5(S, position + 1)) < 0xDC00 || second > 0xDFFF + || (second = charCodeAt$6(S, position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING ? charAt$e(S, position) : first @@ -9162,12 +9169,12 @@ var stringMultibyte = { charAt: createMethod$1(true) }; -var $$3c = _export; +var $$3d = _export; var codeAt$2 = stringMultibyte.codeAt; // `String.prototype.codePointAt` method // https://tc39.es/ecma262/#sec-string.prototype.codepointat -$$3c({ target: 'String', proto: true }, { +$$3d({ target: 'String', proto: true }, { codePointAt: function codePointAt(pos) { return codeAt$2(this, pos); } @@ -9179,13 +9186,13 @@ var $TypeError$o = TypeError; var notARegexp = function (it) { if (isRegExp$3(it)) { - throw $TypeError$o("The method doesn't accept regular expressions"); + throw new $TypeError$o("The method doesn't accept regular expressions"); } return it; }; -var wellKnownSymbol$s = wellKnownSymbol$T; +var wellKnownSymbol$r = wellKnownSymbol$S; -var MATCH = wellKnownSymbol$s('match'); +var MATCH = wellKnownSymbol$r('match'); var correctIsRegexpLogic = function (METHOD_NAME) { var regexp = /./; @@ -9199,18 +9206,18 @@ var correctIsRegexpLogic = function (METHOD_NAME) { } return false; }; -var $$3b = _export; -var uncurryThis$13 = functionUncurryThisClause; +var $$3c = _export; +var uncurryThis$14 = functionUncurryThisClause; var getOwnPropertyDescriptor$6 = objectGetOwnPropertyDescriptor.f; var toLength$7 = toLength$d; -var toString$q = toString$I; +var toString$r = toString$J; var notARegExp$2 = notARegexp; var requireObjectCoercible$g = requireObjectCoercible$p; var correctIsRegExpLogic$2 = correctIsRegexpLogic; // eslint-disable-next-line es/no-string-prototype-endswith -- safe -var nativeEndsWith = uncurryThis$13(''.endsWith); -var slice$6 = uncurryThis$13(''.slice); +var nativeEndsWith = uncurryThis$14(''.endsWith); +var slice$6 = uncurryThis$14(''.slice); var min$8 = Math.min; var CORRECT_IS_REGEXP_LOGIC$1 = correctIsRegExpLogic$2('endsWith'); @@ -9222,36 +9229,36 @@ var MDN_POLYFILL_BUG$1 = !CORRECT_IS_REGEXP_LOGIC$1 && !!function () { // `String.prototype.endsWith` method // https://tc39.es/ecma262/#sec-string.prototype.endswith -$$3b({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG$1 && !CORRECT_IS_REGEXP_LOGIC$1 }, { +$$3c({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG$1 && !CORRECT_IS_REGEXP_LOGIC$1 }, { endsWith: function endsWith(searchString /* , endPosition = @length */) { - var that = toString$q(requireObjectCoercible$g(this)); + var that = toString$r(requireObjectCoercible$g(this)); notARegExp$2(searchString); var endPosition = arguments.length > 1 ? arguments[1] : undefined; var len = that.length; var end = endPosition === undefined ? len : min$8(toLength$7(endPosition), len); - var search = toString$q(searchString); + var search = toString$r(searchString); return nativeEndsWith ? nativeEndsWith(that, search, end) : slice$6(that, end - search.length, end) === search; } }); -var $$3a = _export; -var uncurryThis$12 = functionUncurryThis; +var $$3b = _export; +var uncurryThis$13 = functionUncurryThis; var toAbsoluteIndex$2 = toAbsoluteIndex$b; var $RangeError$7 = RangeError; var fromCharCode$5 = String.fromCharCode; // eslint-disable-next-line es/no-string-fromcodepoint -- required for testing var $fromCodePoint = String.fromCodePoint; -var join$7 = uncurryThis$12([].join); +var join$7 = uncurryThis$13([].join); // length should be 1, old FF problem var INCORRECT_LENGTH = !!$fromCodePoint && $fromCodePoint.length !== 1; // `String.fromCodePoint` method // https://tc39.es/ecma262/#sec-string.fromcodepoint -$$3a({ target: 'String', stat: true, arity: 1, forced: INCORRECT_LENGTH }, { +$$3b({ target: 'String', stat: true, arity: 1, forced: INCORRECT_LENGTH }, { // eslint-disable-next-line no-unused-vars -- required for `.length` fromCodePoint: function fromCodePoint(x) { var elements = []; @@ -9260,7 +9267,7 @@ $$3a({ target: 'String', stat: true, arity: 1, forced: INCORRECT_LENGTH }, { var code; while (length > i) { code = +arguments[i++]; - if (toAbsoluteIndex$2(code, 0x10FFFF) !== code) throw $RangeError$7(code + ' is not a valid code point'); + if (toAbsoluteIndex$2(code, 0x10FFFF) !== code) throw new $RangeError$7(code + ' is not a valid code point'); elements[i] = code < 0x10000 ? fromCharCode$5(code) : fromCharCode$5(((code -= 0x10000) >> 10) + 0xD800, code % 0x400 + 0xDC00); @@ -9268,52 +9275,52 @@ $$3a({ target: 'String', stat: true, arity: 1, forced: INCORRECT_LENGTH }, { } }); -var $$39 = _export; -var uncurryThis$11 = functionUncurryThis; +var $$3a = _export; +var uncurryThis$12 = functionUncurryThis; var notARegExp$1 = notARegexp; var requireObjectCoercible$f = requireObjectCoercible$p; -var toString$p = toString$I; +var toString$q = toString$J; var correctIsRegExpLogic$1 = correctIsRegexpLogic; -var stringIndexOf$4 = uncurryThis$11(''.indexOf); +var stringIndexOf$4 = uncurryThis$12(''.indexOf); // `String.prototype.includes` method // https://tc39.es/ecma262/#sec-string.prototype.includes -$$39({ target: 'String', proto: true, forced: !correctIsRegExpLogic$1('includes') }, { +$$3a({ target: 'String', proto: true, forced: !correctIsRegExpLogic$1('includes') }, { includes: function includes(searchString /* , position = 0 */) { return !!~stringIndexOf$4( - toString$p(requireObjectCoercible$f(this)), - toString$p(notARegExp$1(searchString)), + toString$q(requireObjectCoercible$f(this)), + toString$q(notARegExp$1(searchString)), arguments.length > 1 ? arguments[1] : undefined ); } }); -var $$38 = _export; -var uncurryThis$10 = functionUncurryThis; +var $$39 = _export; +var uncurryThis$11 = functionUncurryThis; var requireObjectCoercible$e = requireObjectCoercible$p; -var toString$o = toString$I; +var toString$p = toString$J; -var charCodeAt$4 = uncurryThis$10(''.charCodeAt); +var charCodeAt$5 = uncurryThis$11(''.charCodeAt); // `String.prototype.isWellFormed` method // https://github.com/tc39/proposal-is-usv-string -$$38({ target: 'String', proto: true }, { +$$39({ target: 'String', proto: true }, { isWellFormed: function isWellFormed() { - var S = toString$o(requireObjectCoercible$e(this)); + var S = toString$p(requireObjectCoercible$e(this)); var length = S.length; for (var i = 0; i < length; i++) { - var charCode = charCodeAt$4(S, i); + var charCode = charCodeAt$5(S, i); // single UTF-16 code unit if ((charCode & 0xF800) !== 0xD800) continue; // unpaired surrogate - if (charCode >= 0xDC00 || ++i >= length || (charCodeAt$4(S, i) & 0xFC00) !== 0xDC00) return false; + if (charCode >= 0xDC00 || ++i >= length || (charCodeAt$5(S, i) & 0xFC00) !== 0xDC00) return false; } return true; } }); var charAt$d = stringMultibyte.charAt; -var toString$n = toString$I; +var toString$o = toString$J; var InternalStateModule$g = internalState; var defineIterator = iteratorDefine; var createIterResultObject$d = createIterResultObject$g; @@ -9327,7 +9334,7 @@ var getInternalState$9 = InternalStateModule$g.getterFor(STRING_ITERATOR$1); defineIterator(String, 'String', function (iterated) { setInternalState$h(this, { type: STRING_ITERATOR$1, - string: toString$n(iterated), + string: toString$o(iterated), index: 0 }); // `%StringIteratorPrototype%.next` method @@ -9345,18 +9352,18 @@ defineIterator(String, 'String', function (iterated) { // TODO: Remove from `core-js@4` since it's moved to entry points -var uncurryThis$$ = functionUncurryThisClause; +var uncurryThis$10 = functionUncurryThisClause; var defineBuiltIn$c = defineBuiltIn$u; var regexpExec$2 = regexpExec$3; var fails$r = fails$1u; -var wellKnownSymbol$r = wellKnownSymbol$T; +var wellKnownSymbol$q = wellKnownSymbol$S; var createNonEnumerableProperty$9 = createNonEnumerableProperty$k; -var SPECIES = wellKnownSymbol$r('species'); +var SPECIES = wellKnownSymbol$q('species'); var RegExpPrototype$1 = RegExp.prototype; var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) { - var SYMBOL = wellKnownSymbol$r(KEY); + var SYMBOL = wellKnownSymbol$q(KEY); var DELEGATES_TO_SYMBOL = !fails$r(function () { // String methods call symbol-named RegEp methods @@ -9397,9 +9404,9 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) { !DELEGATES_TO_EXEC || FORCED ) { - var uncurriedNativeRegExpMethod = uncurryThis$$(/./[SYMBOL]); + var uncurriedNativeRegExpMethod = uncurryThis$10(/./[SYMBOL]); var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) { - var uncurriedNativeMethod = uncurryThis$$(nativeMethod); + var uncurriedNativeMethod = uncurryThis$10(nativeMethod); var $exec = regexp.exec; if ($exec === regexpExec$2 || $exec === RegExpPrototype$1.exec) { if (DELEGATES_TO_SYMBOL && !forceStringMethod) { @@ -9430,7 +9437,7 @@ var advanceStringIndex$4 = function (S, index, unicode) { var call$V = functionCall; var anObject$N = anObject$1f; -var isCallable$g = isCallable$K; +var isCallable$f = isCallable$J; var classof$a = classofRaw$2; var regexpExec$1 = regexpExec$3; @@ -9440,13 +9447,13 @@ var $TypeError$n = TypeError; // https://tc39.es/ecma262/#sec-regexpexec var regexpExecAbstract = function (R, S) { var exec = R.exec; - if (isCallable$g(exec)) { + if (isCallable$f(exec)) { var result = call$V(exec, R, S); if (result !== null) anObject$N(result); return result; } if (classof$a(R) === 'RegExp') return call$V(regexpExec$1, R, S); - throw $TypeError$n('RegExp#exec called on incompatible receiver'); + throw new $TypeError$n('RegExp#exec called on incompatible receiver'); }; var call$U = functionCall; @@ -9454,7 +9461,7 @@ var fixRegExpWellKnownSymbolLogic$3 = fixRegexpWellKnownSymbolLogic; var anObject$M = anObject$1f; var isNullOrUndefined$d = isNullOrUndefined$k; var toLength$6 = toLength$d; -var toString$m = toString$I; +var toString$n = toString$J; var requireObjectCoercible$d = requireObjectCoercible$p; var getMethod$h = getMethod$l; var advanceStringIndex$3 = advanceStringIndex$4; @@ -9468,13 +9475,13 @@ fixRegExpWellKnownSymbolLogic$3('match', function (MATCH, nativeMatch, maybeCall function match(regexp) { var O = requireObjectCoercible$d(this); var matcher = isNullOrUndefined$d(regexp) ? undefined : getMethod$h(regexp, MATCH); - return matcher ? call$U(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString$m(O)); + return matcher ? call$U(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString$n(O)); }, // `RegExp.prototype[@@match]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@match function (string) { var rx = anObject$M(this); - var S = toString$m(string); + var S = toString$n(string); var res = maybeCallNative(nativeMatch, rx, S); if (res.done) return res.value; @@ -9487,7 +9494,7 @@ fixRegExpWellKnownSymbolLogic$3('match', function (MATCH, nativeMatch, maybeCall var n = 0; var result; while ((result = regExpExec$3(rx, S)) !== null) { - var matchStr = toString$m(result[0]); + var matchStr = toString$n(result[0]); A[n] = matchStr; if (matchStr === '') rx.lastIndex = advanceStringIndex$3(S, toLength$6(rx.lastIndex), fullUnicode); n++; @@ -9498,14 +9505,14 @@ fixRegExpWellKnownSymbolLogic$3('match', function (MATCH, nativeMatch, maybeCall }); /* eslint-disable es/no-string-prototype-matchall -- safe */ -var $$37 = _export; +var $$38 = _export; var call$T = functionCall; -var uncurryThis$_ = functionUncurryThisClause; +var uncurryThis$$ = functionUncurryThisClause; var createIteratorConstructor$5 = iteratorCreateConstructor; var createIterResultObject$c = createIterResultObject$g; var requireObjectCoercible$c = requireObjectCoercible$p; var toLength$5 = toLength$d; -var toString$l = toString$I; +var toString$m = toString$J; var anObject$L = anObject$1f; var isNullOrUndefined$c = isNullOrUndefined$k; var classof$9 = classofRaw$2; @@ -9514,22 +9521,22 @@ var getRegExpFlags$2 = regexpGetFlags; var getMethod$g = getMethod$l; var defineBuiltIn$b = defineBuiltIn$u; var fails$q = fails$1u; -var wellKnownSymbol$q = wellKnownSymbol$T; +var wellKnownSymbol$p = wellKnownSymbol$S; var speciesConstructor$2 = speciesConstructor$6; var advanceStringIndex$2 = advanceStringIndex$4; var regExpExec$2 = regexpExecAbstract; var InternalStateModule$f = internalState; var IS_PURE$h = isPure; -var MATCH_ALL = wellKnownSymbol$q('matchAll'); +var MATCH_ALL = wellKnownSymbol$p('matchAll'); var REGEXP_STRING = 'RegExp String'; var REGEXP_STRING_ITERATOR = REGEXP_STRING + ' Iterator'; var setInternalState$g = InternalStateModule$f.set; var getInternalState$8 = InternalStateModule$f.getterFor(REGEXP_STRING_ITERATOR); var RegExpPrototype = RegExp.prototype; var $TypeError$m = TypeError; -var stringIndexOf$3 = uncurryThis$_(''.indexOf); -var nativeMatchAll = uncurryThis$_(''.matchAll); +var stringIndexOf$3 = uncurryThis$$(''.indexOf); +var nativeMatchAll = uncurryThis$$(''.matchAll); var WORKS_WITH_NON_GLOBAL_REGEX = !!nativeMatchAll && !fails$q(function () { nativeMatchAll('a', /./); @@ -9555,7 +9562,7 @@ var $RegExpStringIterator = createIteratorConstructor$5(function RegExpStringIte return createIterResultObject$c(undefined, true); } if (state.global) { - if (toString$l(match[0]) === '') R.lastIndex = advanceStringIndex$2(S, toLength$5(R.lastIndex), state.unicode); + if (toString$m(match[0]) === '') R.lastIndex = advanceStringIndex$2(S, toLength$5(R.lastIndex), state.unicode); return createIterResultObject$c(match, false); } state.done = true; @@ -9564,9 +9571,9 @@ var $RegExpStringIterator = createIteratorConstructor$5(function RegExpStringIte var $matchAll = function (string) { var R = anObject$L(this); - var S = toString$l(string); + var S = toString$m(string); var C = speciesConstructor$2(R, RegExp); - var flags = toString$l(getRegExpFlags$2(R)); + var flags = toString$m(getRegExpFlags$2(R)); var matcher, $global, fullUnicode; matcher = new C(C === RegExp ? R.source : R, flags); $global = !!~stringIndexOf$3(flags, 'g'); @@ -9577,21 +9584,21 @@ var $matchAll = function (string) { // `String.prototype.matchAll` method // https://tc39.es/ecma262/#sec-string.prototype.matchall -$$37({ target: 'String', proto: true, forced: WORKS_WITH_NON_GLOBAL_REGEX }, { +$$38({ target: 'String', proto: true, forced: WORKS_WITH_NON_GLOBAL_REGEX }, { matchAll: function matchAll(regexp) { var O = requireObjectCoercible$c(this); var flags, S, matcher, rx; if (!isNullOrUndefined$c(regexp)) { if (isRegExp$2(regexp)) { - flags = toString$l(requireObjectCoercible$c(getRegExpFlags$2(regexp))); - if (!~stringIndexOf$3(flags, 'g')) throw $TypeError$m('`.matchAll` does not allow non-global regexes'); + flags = toString$m(requireObjectCoercible$c(getRegExpFlags$2(regexp))); + if (!~stringIndexOf$3(flags, 'g')) throw new $TypeError$m('`.matchAll` does not allow non-global regexes'); } if (WORKS_WITH_NON_GLOBAL_REGEX) return nativeMatchAll(O, regexp); matcher = getMethod$g(regexp, MATCH_ALL); if (matcher === undefined && IS_PURE$h && classof$9(regexp) === 'RegExp') matcher = $matchAll; if (matcher) return call$T(matcher, regexp, O); } else if (WORKS_WITH_NON_GLOBAL_REGEX) return nativeMatchAll(O, regexp); - S = toString$l(O); + S = toString$m(O); rx = new RegExp(regexp, 'g'); return rx[MATCH_ALL](S); } @@ -9604,43 +9611,43 @@ var userAgent = engineUserAgent; var stringPadWebkitBug = /Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(userAgent); -var $$36 = _export; +var $$37 = _export; var $padEnd = stringPad.end; var WEBKIT_BUG$1 = stringPadWebkitBug; // `String.prototype.padEnd` method // https://tc39.es/ecma262/#sec-string.prototype.padend -$$36({ target: 'String', proto: true, forced: WEBKIT_BUG$1 }, { +$$37({ target: 'String', proto: true, forced: WEBKIT_BUG$1 }, { padEnd: function padEnd(maxLength /* , fillString = ' ' */) { return $padEnd(this, maxLength, arguments.length > 1 ? arguments[1] : undefined); } }); -var $$35 = _export; +var $$36 = _export; var $padStart = stringPad.start; var WEBKIT_BUG = stringPadWebkitBug; // `String.prototype.padStart` method // https://tc39.es/ecma262/#sec-string.prototype.padstart -$$35({ target: 'String', proto: true, forced: WEBKIT_BUG }, { +$$36({ target: 'String', proto: true, forced: WEBKIT_BUG }, { padStart: function padStart(maxLength /* , fillString = ' ' */) { return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined); } }); -var $$34 = _export; -var uncurryThis$Z = functionUncurryThis; +var $$35 = _export; +var uncurryThis$_ = functionUncurryThis; var toIndexedObject$2 = toIndexedObject$k; var toObject$c = toObject$D; -var toString$k = toString$I; +var toString$l = toString$J; var lengthOfArrayLike$d = lengthOfArrayLike$C; -var push$k = uncurryThis$Z([].push); -var join$6 = uncurryThis$Z([].join); +var push$k = uncurryThis$_([].push); +var join$6 = uncurryThis$_([].join); // `String.raw` method // https://tc39.es/ecma262/#sec-string.raw -$$34({ target: 'String', stat: true }, { +$$35({ target: 'String', stat: true }, { raw: function raw(template) { var rawTemplate = toIndexedObject$2(toObject$c(template).raw); var literalSegments = lengthOfArrayLike$d(rawTemplate); @@ -9649,29 +9656,29 @@ $$34({ target: 'String', stat: true }, { var elements = []; var i = 0; while (true) { - push$k(elements, toString$k(rawTemplate[i++])); + push$k(elements, toString$l(rawTemplate[i++])); if (i === literalSegments) return join$6(elements, ''); - if (i < argumentsLength) push$k(elements, toString$k(arguments[i])); + if (i < argumentsLength) push$k(elements, toString$l(arguments[i])); } } }); -var $$33 = _export; +var $$34 = _export; var repeat = stringRepeat; // `String.prototype.repeat` method // https://tc39.es/ecma262/#sec-string.prototype.repeat -$$33({ target: 'String', proto: true }, { +$$34({ target: 'String', proto: true }, { repeat: repeat }); -var uncurryThis$Y = functionUncurryThis; +var uncurryThis$Z = functionUncurryThis; var toObject$b = toObject$D; var floor$3 = Math.floor; -var charAt$b = uncurryThis$Y(''.charAt); -var replace$5 = uncurryThis$Y(''.replace); -var stringSlice$b = uncurryThis$Y(''.slice); +var charAt$b = uncurryThis$Z(''.charAt); +var replace$6 = uncurryThis$Z(''.replace); +var stringSlice$b = uncurryThis$Z(''.slice); // eslint-disable-next-line redos/no-vulnerable -- safe var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g; var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g; @@ -9686,7 +9693,7 @@ var getSubstitution$2 = function (matched, str, position, captures, namedCapture namedCaptures = toObject$b(namedCaptures); symbols = SUBSTITUTION_SYMBOLS; } - return replace$5(replacement, symbols, function (match, ch) { + return replace$6(replacement, symbols, function (match, ch) { var capture; switch (charAt$b(ch, 0)) { case '$': return '$'; @@ -9713,29 +9720,29 @@ var getSubstitution$2 = function (matched, str, position, captures, namedCapture var apply$7 = functionApply$1; var call$S = functionCall; -var uncurryThis$X = functionUncurryThis; +var uncurryThis$Y = functionUncurryThis; var fixRegExpWellKnownSymbolLogic$2 = fixRegexpWellKnownSymbolLogic; var fails$p = fails$1u; var anObject$K = anObject$1f; -var isCallable$f = isCallable$K; +var isCallable$e = isCallable$J; var isNullOrUndefined$b = isNullOrUndefined$k; var toIntegerOrInfinity$8 = toIntegerOrInfinity$p; var toLength$4 = toLength$d; -var toString$j = toString$I; +var toString$k = toString$J; var requireObjectCoercible$b = requireObjectCoercible$p; var advanceStringIndex$1 = advanceStringIndex$4; var getMethod$f = getMethod$l; var getSubstitution$1 = getSubstitution$2; var regExpExec$1 = regexpExecAbstract; -var wellKnownSymbol$p = wellKnownSymbol$T; +var wellKnownSymbol$o = wellKnownSymbol$S; -var REPLACE$1 = wellKnownSymbol$p('replace'); +var REPLACE$1 = wellKnownSymbol$o('replace'); var max$5 = Math.max; var min$7 = Math.min; -var concat$1 = uncurryThis$X([].concat); -var push$j = uncurryThis$X([].push); -var stringIndexOf$2 = uncurryThis$X(''.indexOf); -var stringSlice$a = uncurryThis$X(''.slice); +var concat$1 = uncurryThis$Y([].concat); +var push$j = uncurryThis$Y([].push); +var stringIndexOf$2 = uncurryThis$Y(''.indexOf); +var stringSlice$a = uncurryThis$Y(''.slice); var maybeToString = function (it) { return it === undefined ? it : String(it); @@ -9779,13 +9786,13 @@ fixRegExpWellKnownSymbolLogic$2('replace', function (_, nativeReplace, maybeCall var replacer = isNullOrUndefined$b(searchValue) ? undefined : getMethod$f(searchValue, REPLACE$1); return replacer ? call$S(replacer, searchValue, O, replaceValue) - : call$S(nativeReplace, toString$j(O), searchValue, replaceValue); + : call$S(nativeReplace, toString$k(O), searchValue, replaceValue); }, // `RegExp.prototype[@@replace]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace function (string, replaceValue) { var rx = anObject$K(this); - var S = toString$j(string); + var S = toString$k(string); if ( typeof replaceValue == 'string' && @@ -9796,8 +9803,8 @@ fixRegExpWellKnownSymbolLogic$2('replace', function (_, nativeReplace, maybeCall if (res.done) return res.value; } - var functionalReplace = isCallable$f(replaceValue); - if (!functionalReplace) replaceValue = toString$j(replaceValue); + var functionalReplace = isCallable$e(replaceValue); + if (!functionalReplace) replaceValue = toString$k(replaceValue); var global = rx.global; var fullUnicode; @@ -9815,7 +9822,7 @@ fixRegExpWellKnownSymbolLogic$2('replace', function (_, nativeReplace, maybeCall push$j(results, result); if (!global) break; - var matchStr = toString$j(result[0]); + var matchStr = toString$k(result[0]); if (matchStr === '') rx.lastIndex = advanceStringIndex$1(S, toLength$4(rx.lastIndex), fullUnicode); } @@ -9824,7 +9831,7 @@ fixRegExpWellKnownSymbolLogic$2('replace', function (_, nativeReplace, maybeCall for (var i = 0; i < results.length; i++) { result = results[i]; - var matched = toString$j(result[0]); + var matched = toString$k(result[0]); var position = max$5(min$7(toIntegerOrInfinity$8(result.index), S.length), 0); var captures = []; var replacement; @@ -9838,7 +9845,7 @@ fixRegExpWellKnownSymbolLogic$2('replace', function (_, nativeReplace, maybeCall if (functionalReplace) { var replacerArgs = concat$1([matched], captures, position, S); if (namedCaptures !== undefined) push$j(replacerArgs, namedCaptures); - replacement = toString$j(apply$7(replaceValue, undefined, replacerArgs)); + replacement = toString$k(apply$7(replaceValue, undefined, replacerArgs)); } else { replacement = getSubstitution$1(matched, S, position, captures, namedCaptures, replaceValue); } @@ -9853,24 +9860,24 @@ fixRegExpWellKnownSymbolLogic$2('replace', function (_, nativeReplace, maybeCall ]; }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE); -var $$32 = _export; +var $$33 = _export; var call$R = functionCall; -var uncurryThis$W = functionUncurryThis; +var uncurryThis$X = functionUncurryThis; var requireObjectCoercible$a = requireObjectCoercible$p; -var isCallable$e = isCallable$K; +var isCallable$d = isCallable$J; var isNullOrUndefined$a = isNullOrUndefined$k; var isRegExp$1 = isRegexp; -var toString$i = toString$I; +var toString$j = toString$J; var getMethod$e = getMethod$l; var getRegExpFlags$1 = regexpGetFlags; var getSubstitution = getSubstitution$2; -var wellKnownSymbol$o = wellKnownSymbol$T; +var wellKnownSymbol$n = wellKnownSymbol$S; -var REPLACE = wellKnownSymbol$o('replace'); +var REPLACE = wellKnownSymbol$n('replace'); var $TypeError$l = TypeError; -var indexOf = uncurryThis$W(''.indexOf); -uncurryThis$W(''.replace); -var stringSlice$9 = uncurryThis$W(''.slice); +var indexOf = uncurryThis$X(''.indexOf); +uncurryThis$X(''.replace); +var stringSlice$9 = uncurryThis$X(''.slice); var max$4 = Math.max; var stringIndexOf$1 = function (string, searchValue, fromIndex) { @@ -9881,7 +9888,7 @@ var stringIndexOf$1 = function (string, searchValue, fromIndex) { // `String.prototype.replaceAll` method // https://tc39.es/ecma262/#sec-string.prototype.replaceall -$$32({ target: 'String', proto: true }, { +$$33({ target: 'String', proto: true }, { replaceAll: function replaceAll(searchValue, replaceValue) { var O = requireObjectCoercible$a(this); var IS_REG_EXP, flags, replacer, string, searchString, functionalReplace, searchLength, advanceBy, replacement; @@ -9891,24 +9898,24 @@ $$32({ target: 'String', proto: true }, { if (!isNullOrUndefined$a(searchValue)) { IS_REG_EXP = isRegExp$1(searchValue); if (IS_REG_EXP) { - flags = toString$i(requireObjectCoercible$a(getRegExpFlags$1(searchValue))); - if (!~indexOf(flags, 'g')) throw $TypeError$l('`.replaceAll` does not allow non-global regexes'); + flags = toString$j(requireObjectCoercible$a(getRegExpFlags$1(searchValue))); + if (!~indexOf(flags, 'g')) throw new $TypeError$l('`.replaceAll` does not allow non-global regexes'); } replacer = getMethod$e(searchValue, REPLACE); if (replacer) { return call$R(replacer, searchValue, O, replaceValue); } } - string = toString$i(O); - searchString = toString$i(searchValue); - functionalReplace = isCallable$e(replaceValue); - if (!functionalReplace) replaceValue = toString$i(replaceValue); + string = toString$j(O); + searchString = toString$j(searchValue); + functionalReplace = isCallable$d(replaceValue); + if (!functionalReplace) replaceValue = toString$j(replaceValue); searchLength = searchString.length; advanceBy = max$4(1, searchLength); position = stringIndexOf$1(string, searchString, 0); while (position !== -1) { replacement = functionalReplace - ? toString$i(replaceValue(searchString, position, string)) + ? toString$j(replaceValue(searchString, position, string)) : getSubstitution(searchString, string, position, [], undefined, replaceValue); result += stringSlice$9(string, endOfLastMatch, position) + replacement; endOfLastMatch = position + searchLength; @@ -9927,7 +9934,7 @@ var anObject$J = anObject$1f; var isNullOrUndefined$9 = isNullOrUndefined$k; var requireObjectCoercible$9 = requireObjectCoercible$p; var sameValue = sameValue$1; -var toString$h = toString$I; +var toString$i = toString$J; var getMethod$d = getMethod$l; var regExpExec = regexpExecAbstract; @@ -9939,13 +9946,13 @@ fixRegExpWellKnownSymbolLogic$1('search', function (SEARCH, nativeSearch, maybeC function search(regexp) { var O = requireObjectCoercible$9(this); var searcher = isNullOrUndefined$9(regexp) ? undefined : getMethod$d(regexp, SEARCH); - return searcher ? call$Q(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString$h(O)); + return searcher ? call$Q(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString$i(O)); }, // `RegExp.prototype[@@search]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@search function (string) { var rx = anObject$J(this); - var S = toString$h(string); + var S = toString$i(string); var res = maybeCallNative(nativeSearch, rx, S); if (res.done) return res.value; @@ -9961,7 +9968,7 @@ fixRegExpWellKnownSymbolLogic$1('search', function (SEARCH, nativeSearch, maybeC var apply$6 = functionApply$1; var call$P = functionCall; -var uncurryThis$V = functionUncurryThis; +var uncurryThis$W = functionUncurryThis; var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic; var anObject$I = anObject$1f; var isNullOrUndefined$8 = isNullOrUndefined$k; @@ -9970,7 +9977,7 @@ var requireObjectCoercible$8 = requireObjectCoercible$p; var speciesConstructor$1 = speciesConstructor$6; var advanceStringIndex = advanceStringIndex$4; var toLength$3 = toLength$d; -var toString$g = toString$I; +var toString$h = toString$J; var getMethod$c = getMethod$l; var arraySlice$5 = arraySliceSimple; var callRegExpExec = regexpExecAbstract; @@ -9982,9 +9989,9 @@ var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y; var MAX_UINT32 = 0xFFFFFFFF; var min$6 = Math.min; var $push = [].push; -var exec$a = uncurryThis$V(/./.exec); -var push$i = uncurryThis$V($push); -var stringSlice$8 = uncurryThis$V(''.slice); +var exec$a = uncurryThis$W(/./.exec); +var push$i = uncurryThis$W($push); +var stringSlice$8 = uncurryThis$W(''.slice); // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec // Weex JS has frozen built-in prototypes, so use try / catch wrapper @@ -10012,7 +10019,7 @@ fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNa ) { // based on es5-shim implementation, need to rework it internalSplit = function (separator, limit) { - var string = toString$g(requireObjectCoercible$8(this)); + var string = toString$h(requireObjectCoercible$8(this)); var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; if (lim === 0) return []; if (separator === undefined) return [string]; @@ -10060,7 +10067,7 @@ fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNa var splitter = isNullOrUndefined$8(separator) ? undefined : getMethod$c(separator, SPLIT); return splitter ? call$P(splitter, separator, O, limit) - : call$P(internalSplit, toString$g(O), separator, limit); + : call$P(internalSplit, toString$h(O), separator, limit); }, // `RegExp.prototype[@@split]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@split @@ -10069,7 +10076,7 @@ fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNa // the 'y' flag. function (string, limit) { var rx = anObject$I(this); - var S = toString$g(string); + var S = toString$h(string); var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit); if (res.done) return res.value; @@ -10116,18 +10123,18 @@ fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNa ]; }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y); -var $$31 = _export; -var uncurryThis$U = functionUncurryThisClause; +var $$32 = _export; +var uncurryThis$V = functionUncurryThisClause; var getOwnPropertyDescriptor$5 = objectGetOwnPropertyDescriptor.f; var toLength$2 = toLength$d; -var toString$f = toString$I; +var toString$g = toString$J; var notARegExp = notARegexp; var requireObjectCoercible$7 = requireObjectCoercible$p; var correctIsRegExpLogic = correctIsRegexpLogic; // eslint-disable-next-line es/no-string-prototype-startswith -- safe -var nativeStartsWith = uncurryThis$U(''.startsWith); -var stringSlice$7 = uncurryThis$U(''.slice); +var nativeStartsWith = uncurryThis$V(''.startsWith); +var stringSlice$7 = uncurryThis$V(''.slice); var min$5 = Math.min; var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith'); @@ -10139,25 +10146,25 @@ var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () { // `String.prototype.startsWith` method // https://tc39.es/ecma262/#sec-string.prototype.startswith -$$31({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, { +$$32({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, { startsWith: function startsWith(searchString /* , position = 0 */) { - var that = toString$f(requireObjectCoercible$7(this)); + var that = toString$g(requireObjectCoercible$7(this)); notARegExp(searchString); var index = toLength$2(min$5(arguments.length > 1 ? arguments[1] : undefined, that.length)); - var search = toString$f(searchString); + var search = toString$g(searchString); return nativeStartsWith ? nativeStartsWith(that, search, index) : stringSlice$7(that, index, index + search.length) === search; } }); -var $$30 = _export; -var uncurryThis$T = functionUncurryThis; +var $$31 = _export; +var uncurryThis$U = functionUncurryThis; var requireObjectCoercible$6 = requireObjectCoercible$p; var toIntegerOrInfinity$7 = toIntegerOrInfinity$p; -var toString$e = toString$I; +var toString$f = toString$J; -var stringSlice$6 = uncurryThis$T(''.slice); +var stringSlice$6 = uncurryThis$U(''.slice); var max$3 = Math.max; var min$4 = Math.min; @@ -10166,9 +10173,9 @@ var FORCED$3 = !''.substr || 'ab'.substr(-1) !== 'b'; // `String.prototype.substr` method // https://tc39.es/ecma262/#sec-string.prototype.substr -$$30({ target: 'String', proto: true, forced: FORCED$3 }, { +$$31({ target: 'String', proto: true, forced: FORCED$3 }, { substr: function substr(start, length) { - var that = toString$e(requireObjectCoercible$6(this)); + var that = toString$f(requireObjectCoercible$6(this)); var size = that.length; var intStart = toIntegerOrInfinity$7(start); var intLength, intEnd; @@ -10181,17 +10188,17 @@ $$30({ target: 'String', proto: true, forced: FORCED$3 }, { } }); -var $$2$ = _export; +var $$30 = _export; var call$O = functionCall; -var uncurryThis$S = functionUncurryThis; +var uncurryThis$T = functionUncurryThis; var requireObjectCoercible$5 = requireObjectCoercible$p; -var toString$d = toString$I; +var toString$e = toString$J; var fails$n = fails$1u; var $Array$2 = Array; -var charAt$a = uncurryThis$S(''.charAt); -var charCodeAt$3 = uncurryThis$S(''.charCodeAt); -var join$5 = uncurryThis$S([].join); +var charAt$a = uncurryThis$T(''.charAt); +var charCodeAt$4 = uncurryThis$T(''.charCodeAt); +var join$5 = uncurryThis$T([].join); // eslint-disable-next-line es/no-string-prototype-iswellformed-towellformed -- safe var $toWellFormed = ''.toWellFormed; var REPLACEMENT_CHARACTER = '\uFFFD'; @@ -10203,18 +10210,18 @@ var TO_STRING_CONVERSION_BUG = $toWellFormed && fails$n(function () { // `String.prototype.toWellFormed` method // https://github.com/tc39/proposal-is-usv-string -$$2$({ target: 'String', proto: true, forced: TO_STRING_CONVERSION_BUG }, { +$$30({ target: 'String', proto: true, forced: TO_STRING_CONVERSION_BUG }, { toWellFormed: function toWellFormed() { - var S = toString$d(requireObjectCoercible$5(this)); + var S = toString$e(requireObjectCoercible$5(this)); if (TO_STRING_CONVERSION_BUG) return call$O($toWellFormed, S); var length = S.length; var result = $Array$2(length); for (var i = 0; i < length; i++) { - var charCode = charCodeAt$3(S, i); + var charCode = charCodeAt$4(S, i); // single UTF-16 code unit if ((charCode & 0xF800) !== 0xD800) result[i] = charAt$a(S, i); // unpaired surrogate - else if (charCode >= 0xDC00 || i + 1 >= length || (charCodeAt$3(S, i + 1) & 0xFC00) !== 0xDC00) result[i] = REPLACEMENT_CHARACTER; + else if (charCode >= 0xDC00 || i + 1 >= length || (charCodeAt$4(S, i + 1) & 0xFC00) !== 0xDC00) result[i] = REPLACEMENT_CHARACTER; // surrogate pair else { result[i] = charAt$a(S, i); @@ -10240,13 +10247,13 @@ var stringTrimForced = function (METHOD_NAME) { }); }; -var $$2_ = _export; +var $$2$ = _export; var $trim = stringTrim.trim; var forcedStringTrimMethod$2 = stringTrimForced; // `String.prototype.trim` method // https://tc39.es/ecma262/#sec-string.prototype.trim -$$2_({ target: 'String', proto: true, forced: forcedStringTrimMethod$2('trim') }, { +$$2$({ target: 'String', proto: true, forced: forcedStringTrimMethod$2('trim') }, { trim: function trim() { return $trim(this); } @@ -10263,25 +10270,25 @@ var stringTrimEnd = forcedStringTrimMethod$1('trimEnd') ? function trimEnd() { // eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe } : ''.trimEnd; -var $$2Z = _export; +var $$2_ = _export; var trimEnd$1 = stringTrimEnd; // `String.prototype.trimRight` method // https://tc39.es/ecma262/#sec-string.prototype.trimend // eslint-disable-next-line es/no-string-prototype-trimleft-trimright -- safe -$$2Z({ target: 'String', proto: true, name: 'trimEnd', forced: ''.trimRight !== trimEnd$1 }, { +$$2_({ target: 'String', proto: true, name: 'trimEnd', forced: ''.trimRight !== trimEnd$1 }, { trimRight: trimEnd$1 }); // TODO: Remove this line from `core-js@4` -var $$2Y = _export; +var $$2Z = _export; var trimEnd = stringTrimEnd; // `String.prototype.trimEnd` method // https://tc39.es/ecma262/#sec-string.prototype.trimend // eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe -$$2Y({ target: 'String', proto: true, name: 'trimEnd', forced: ''.trimEnd !== trimEnd }, { +$$2Z({ target: 'String', proto: true, name: 'trimEnd', forced: ''.trimEnd !== trimEnd }, { trimEnd: trimEnd }); @@ -10296,41 +10303,41 @@ var stringTrimStart = forcedStringTrimMethod('trimStart') ? function trimStart() // eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe } : ''.trimStart; -var $$2X = _export; +var $$2Y = _export; var trimStart$1 = stringTrimStart; // `String.prototype.trimLeft` method // https://tc39.es/ecma262/#sec-string.prototype.trimleft // eslint-disable-next-line es/no-string-prototype-trimleft-trimright -- safe -$$2X({ target: 'String', proto: true, name: 'trimStart', forced: ''.trimLeft !== trimStart$1 }, { +$$2Y({ target: 'String', proto: true, name: 'trimStart', forced: ''.trimLeft !== trimStart$1 }, { trimLeft: trimStart$1 }); // TODO: Remove this line from `core-js@4` -var $$2W = _export; +var $$2X = _export; var trimStart = stringTrimStart; // `String.prototype.trimStart` method // https://tc39.es/ecma262/#sec-string.prototype.trimstart // eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe -$$2W({ target: 'String', proto: true, name: 'trimStart', forced: ''.trimStart !== trimStart }, { +$$2X({ target: 'String', proto: true, name: 'trimStart', forced: ''.trimStart !== trimStart }, { trimStart: trimStart }); -var uncurryThis$R = functionUncurryThis; +var uncurryThis$S = functionUncurryThis; var requireObjectCoercible$4 = requireObjectCoercible$p; -var toString$c = toString$I; +var toString$d = toString$J; var quot = /"/g; -var replace$4 = uncurryThis$R(''.replace); +var replace$5 = uncurryThis$S(''.replace); // `CreateHTML` abstract operation // https://tc39.es/ecma262/#sec-createhtml var createHtml = function (string, tag, attribute, value) { - var S = toString$c(requireObjectCoercible$4(string)); + var S = toString$d(requireObjectCoercible$4(string)); var p1 = '<' + tag; - if (attribute !== '') p1 += ' ' + attribute + '="' + replace$4(toString$c(value), quot, '"') + '"'; + if (attribute !== '') p1 += ' ' + attribute + '="' + replace$5(toString$d(value), quot, '"') + '"'; return p1 + '>' + S + ''; }; @@ -10345,157 +10352,157 @@ var stringHtmlForced = function (METHOD_NAME) { }); }; -var $$2V = _export; +var $$2W = _export; var createHTML$c = createHtml; var forcedStringHTMLMethod$c = stringHtmlForced; // `String.prototype.anchor` method // https://tc39.es/ecma262/#sec-string.prototype.anchor -$$2V({ target: 'String', proto: true, forced: forcedStringHTMLMethod$c('anchor') }, { +$$2W({ target: 'String', proto: true, forced: forcedStringHTMLMethod$c('anchor') }, { anchor: function anchor(name) { return createHTML$c(this, 'a', 'name', name); } }); -var $$2U = _export; +var $$2V = _export; var createHTML$b = createHtml; var forcedStringHTMLMethod$b = stringHtmlForced; // `String.prototype.big` method // https://tc39.es/ecma262/#sec-string.prototype.big -$$2U({ target: 'String', proto: true, forced: forcedStringHTMLMethod$b('big') }, { +$$2V({ target: 'String', proto: true, forced: forcedStringHTMLMethod$b('big') }, { big: function big() { return createHTML$b(this, 'big', '', ''); } }); -var $$2T = _export; +var $$2U = _export; var createHTML$a = createHtml; var forcedStringHTMLMethod$a = stringHtmlForced; // `String.prototype.blink` method // https://tc39.es/ecma262/#sec-string.prototype.blink -$$2T({ target: 'String', proto: true, forced: forcedStringHTMLMethod$a('blink') }, { +$$2U({ target: 'String', proto: true, forced: forcedStringHTMLMethod$a('blink') }, { blink: function blink() { return createHTML$a(this, 'blink', '', ''); } }); -var $$2S = _export; +var $$2T = _export; var createHTML$9 = createHtml; var forcedStringHTMLMethod$9 = stringHtmlForced; // `String.prototype.bold` method // https://tc39.es/ecma262/#sec-string.prototype.bold -$$2S({ target: 'String', proto: true, forced: forcedStringHTMLMethod$9('bold') }, { +$$2T({ target: 'String', proto: true, forced: forcedStringHTMLMethod$9('bold') }, { bold: function bold() { return createHTML$9(this, 'b', '', ''); } }); -var $$2R = _export; +var $$2S = _export; var createHTML$8 = createHtml; var forcedStringHTMLMethod$8 = stringHtmlForced; // `String.prototype.fixed` method // https://tc39.es/ecma262/#sec-string.prototype.fixed -$$2R({ target: 'String', proto: true, forced: forcedStringHTMLMethod$8('fixed') }, { +$$2S({ target: 'String', proto: true, forced: forcedStringHTMLMethod$8('fixed') }, { fixed: function fixed() { return createHTML$8(this, 'tt', '', ''); } }); -var $$2Q = _export; +var $$2R = _export; var createHTML$7 = createHtml; var forcedStringHTMLMethod$7 = stringHtmlForced; // `String.prototype.fontcolor` method // https://tc39.es/ecma262/#sec-string.prototype.fontcolor -$$2Q({ target: 'String', proto: true, forced: forcedStringHTMLMethod$7('fontcolor') }, { +$$2R({ target: 'String', proto: true, forced: forcedStringHTMLMethod$7('fontcolor') }, { fontcolor: function fontcolor(color) { return createHTML$7(this, 'font', 'color', color); } }); -var $$2P = _export; +var $$2Q = _export; var createHTML$6 = createHtml; var forcedStringHTMLMethod$6 = stringHtmlForced; // `String.prototype.fontsize` method // https://tc39.es/ecma262/#sec-string.prototype.fontsize -$$2P({ target: 'String', proto: true, forced: forcedStringHTMLMethod$6('fontsize') }, { +$$2Q({ target: 'String', proto: true, forced: forcedStringHTMLMethod$6('fontsize') }, { fontsize: function fontsize(size) { return createHTML$6(this, 'font', 'size', size); } }); -var $$2O = _export; +var $$2P = _export; var createHTML$5 = createHtml; var forcedStringHTMLMethod$5 = stringHtmlForced; // `String.prototype.italics` method // https://tc39.es/ecma262/#sec-string.prototype.italics -$$2O({ target: 'String', proto: true, forced: forcedStringHTMLMethod$5('italics') }, { +$$2P({ target: 'String', proto: true, forced: forcedStringHTMLMethod$5('italics') }, { italics: function italics() { return createHTML$5(this, 'i', '', ''); } }); -var $$2N = _export; +var $$2O = _export; var createHTML$4 = createHtml; var forcedStringHTMLMethod$4 = stringHtmlForced; // `String.prototype.link` method // https://tc39.es/ecma262/#sec-string.prototype.link -$$2N({ target: 'String', proto: true, forced: forcedStringHTMLMethod$4('link') }, { +$$2O({ target: 'String', proto: true, forced: forcedStringHTMLMethod$4('link') }, { link: function link(url) { return createHTML$4(this, 'a', 'href', url); } }); -var $$2M = _export; +var $$2N = _export; var createHTML$3 = createHtml; var forcedStringHTMLMethod$3 = stringHtmlForced; // `String.prototype.small` method // https://tc39.es/ecma262/#sec-string.prototype.small -$$2M({ target: 'String', proto: true, forced: forcedStringHTMLMethod$3('small') }, { +$$2N({ target: 'String', proto: true, forced: forcedStringHTMLMethod$3('small') }, { small: function small() { return createHTML$3(this, 'small', '', ''); } }); -var $$2L = _export; +var $$2M = _export; var createHTML$2 = createHtml; var forcedStringHTMLMethod$2 = stringHtmlForced; // `String.prototype.strike` method // https://tc39.es/ecma262/#sec-string.prototype.strike -$$2L({ target: 'String', proto: true, forced: forcedStringHTMLMethod$2('strike') }, { +$$2M({ target: 'String', proto: true, forced: forcedStringHTMLMethod$2('strike') }, { strike: function strike() { return createHTML$2(this, 'strike', '', ''); } }); -var $$2K = _export; +var $$2L = _export; var createHTML$1 = createHtml; var forcedStringHTMLMethod$1 = stringHtmlForced; // `String.prototype.sub` method // https://tc39.es/ecma262/#sec-string.prototype.sub -$$2K({ target: 'String', proto: true, forced: forcedStringHTMLMethod$1('sub') }, { +$$2L({ target: 'String', proto: true, forced: forcedStringHTMLMethod$1('sub') }, { sub: function sub() { return createHTML$1(this, 'sub', '', ''); } }); -var $$2J = _export; +var $$2K = _export; var createHTML = createHtml; var forcedStringHTMLMethod = stringHtmlForced; // `String.prototype.sup` method // https://tc39.es/ecma262/#sec-string.prototype.sup -$$2J({ target: 'String', proto: true, forced: forcedStringHTMLMethod('sup') }, { +$$2K({ target: 'String', proto: true, forced: forcedStringHTMLMethod('sup') }, { sup: function sup() { return createHTML(this, 'sup', '', ''); } @@ -10532,7 +10539,7 @@ var $RangeError$6 = RangeError; var toPositiveInteger$5 = function (it) { var result = toIntegerOrInfinity$6(it); - if (result < 0) throw $RangeError$6("The argument can't be less than 0"); + if (result < 0) throw new $RangeError$6("The argument can't be less than 0"); return result; }; @@ -10542,7 +10549,7 @@ var $RangeError$5 = RangeError; var toOffset$2 = function (it, BYTES) { var offset = toPositiveInteger$4(it); - if (offset % BYTES) throw $RangeError$5('Wrong offset'); + if (offset % BYTES) throw new $RangeError$5('Wrong offset'); return offset; }; @@ -10568,7 +10575,7 @@ var $TypeError$k = TypeError; // https://tc39.es/ecma262/#sec-tobigint var toBigInt$4 = function (argument) { var prim = toPrimitive(argument, 'number'); - if (typeof prim == 'number') throw $TypeError$k("Can't convert number to bigint"); + if (typeof prim == 'number') throw new $TypeError$k("Can't convert number to bigint"); // eslint-disable-next-line es/no-bigint -- safe return BigInt(prim); }; @@ -10615,7 +10622,7 @@ var typedArrayFrom$2 = function from(source /* , mapfn, thisArg */) { return result; }; -var $$2I = _export; +var $$2J = _export; var global$u = global$16; var call$M = functionCall; var DESCRIPTORS$g = descriptors; @@ -10731,7 +10738,7 @@ if (DESCRIPTORS$g) { addGetter$1(TypedArrayPrototype$1, 'length'); } - $$2I({ target: 'Object', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, { + $$2J({ target: 'Object', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, { getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor, defineProperty: wrappedDefineProperty }); @@ -10783,12 +10790,12 @@ if (DESCRIPTORS$g) { byteOffset = toOffset$1(offset, BYTES); var $len = data.byteLength; if ($length === undefined) { - if ($len % BYTES) throw RangeError$3(WRONG_LENGTH); + if ($len % BYTES) throw new RangeError$3(WRONG_LENGTH); byteLength = $len - byteOffset; - if (byteLength < 0) throw RangeError$3(WRONG_LENGTH); + if (byteLength < 0) throw new RangeError$3(WRONG_LENGTH); } else { byteLength = toLength$1($length) * BYTES; - if (byteLength + byteOffset > $len) throw RangeError$3(WRONG_LENGTH); + if (byteLength + byteOffset > $len) throw new RangeError$3(WRONG_LENGTH); } length = byteLength / BYTES; } else if (isTypedArray(data)) { @@ -10846,7 +10853,7 @@ if (DESCRIPTORS$g) { exported[CONSTRUCTOR_NAME] = TypedArrayConstructor; - $$2I({ global: true, constructor: true, forced: FORCED, sham: !NATIVE_ARRAY_BUFFER_VIEWS }, exported); + $$2J({ global: true, constructor: true, forced: FORCED, sham: !NATIVE_ARRAY_BUFFER_VIEWS }, exported); if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) { createNonEnumerableProperty$8(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES); @@ -10969,11 +10976,11 @@ exportTypedArrayMethod$x('at', function at(index) { return (k < 0 || k >= len) ? undefined : O[k]; }); -var uncurryThis$Q = functionUncurryThis; +var uncurryThis$R = functionUncurryThis; var ArrayBufferViewCore$y = arrayBufferViewCore; var $ArrayCopyWithin = arrayCopyWithin; -var u$ArrayCopyWithin = uncurryThis$Q($ArrayCopyWithin); +var u$ArrayCopyWithin = uncurryThis$R($ArrayCopyWithin); var aTypedArray$v = ArrayBufferViewCore$y.aTypedArray; var exportTypedArrayMethod$w = ArrayBufferViewCore$y.exportTypedArrayMethod; @@ -11000,12 +11007,12 @@ var $fill = arrayFill$1; var toBigInt$2 = toBigInt$4; var classof$6 = classof$q; var call$L = functionCall; -var uncurryThis$P = functionUncurryThis; +var uncurryThis$Q = functionUncurryThis; var fails$j = fails$1u; var aTypedArray$t = ArrayBufferViewCore$w.aTypedArray; var exportTypedArrayMethod$u = ArrayBufferViewCore$w.exportTypedArrayMethod; -var slice$5 = uncurryThis$P(''.slice); +var slice$5 = uncurryThis$Q(''.slice); // V8 ~ Chrome < 59, Safari < 14.1, FF < 55, Edge <=18 var CONVERSION_BUG = fails$j(function () { @@ -11151,16 +11158,16 @@ exportTypedArrayMethod$m('indexOf', function indexOf(searchElement /* , fromInde var global$t = global$16; var fails$i = fails$1u; -var uncurryThis$O = functionUncurryThis; +var uncurryThis$P = functionUncurryThis; var ArrayBufferViewCore$m = arrayBufferViewCore; var ArrayIterators = es_array_iterator; -var wellKnownSymbol$n = wellKnownSymbol$T; +var wellKnownSymbol$m = wellKnownSymbol$S; -var ITERATOR$4 = wellKnownSymbol$n('iterator'); +var ITERATOR$4 = wellKnownSymbol$m('iterator'); var Uint8Array$1 = global$t.Uint8Array; -var arrayValues = uncurryThis$O(ArrayIterators.values); -var arrayKeys = uncurryThis$O(ArrayIterators.keys); -var arrayEntries = uncurryThis$O(ArrayIterators.entries); +var arrayValues = uncurryThis$P(ArrayIterators.values); +var arrayKeys = uncurryThis$P(ArrayIterators.keys); +var arrayEntries = uncurryThis$P(ArrayIterators.entries); var aTypedArray$k = ArrayBufferViewCore$m.aTypedArray; var exportTypedArrayMethod$l = ArrayBufferViewCore$m.exportTypedArrayMethod; var TypedArrayPrototype = Uint8Array$1 && Uint8Array$1.prototype; @@ -11196,11 +11203,11 @@ exportTypedArrayMethod$l('values', typedArrayValues, GENERIC || !ITERATOR_IS_VAL exportTypedArrayMethod$l(ITERATOR$4, typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, { name: 'values' }); var ArrayBufferViewCore$l = arrayBufferViewCore; -var uncurryThis$N = functionUncurryThis; +var uncurryThis$O = functionUncurryThis; var aTypedArray$j = ArrayBufferViewCore$l.aTypedArray; var exportTypedArrayMethod$k = ArrayBufferViewCore$l.exportTypedArrayMethod; -var $join = uncurryThis$N([].join); +var $join = uncurryThis$O([].join); // `%TypedArray%.prototype.join` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.join @@ -11340,7 +11347,7 @@ exportTypedArrayMethod$e('set', function set(arrayLike /* , offset */) { var length = this.length; var len = lengthOfArrayLike$a(src); var index = 0; - if (len + offset > length) throw RangeError$2('Wrong length'); + if (len + offset > length) throw new RangeError$2('Wrong length'); while (index < len) this[offset + index] = src[index++]; }, !WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS || TO_OBJECT_BUG); @@ -11382,7 +11389,7 @@ exportTypedArrayMethod$c('some', function some(callbackfn /* , thisArg */) { }); var global$r = global$16; -var uncurryThis$M = functionUncurryThisClause; +var uncurryThis$N = functionUncurryThisClause; var fails$f = fails$1u; var aCallable$u = aCallable$N; var internalSort = arraySort$1; @@ -11395,7 +11402,7 @@ var WEBKIT = engineWebkitVersion; var aTypedArray$a = ArrayBufferViewCore$b.aTypedArray; var exportTypedArrayMethod$b = ArrayBufferViewCore$b.exportTypedArrayMethod; var Uint16Array = global$r.Uint16Array; -var nativeSort = Uint16Array && uncurryThis$M(Uint16Array.prototype.sort); +var nativeSort = Uint16Array && uncurryThis$N(Uint16Array.prototype.sort); // WebKit var ACCEPT_INCORRECT_ARGUMENTS = !!nativeSort && !(fails$f(function () { @@ -11519,14 +11526,14 @@ exportTypedArrayMethod$8('toReversed', function toReversed() { }); var ArrayBufferViewCore$7 = arrayBufferViewCore; -var uncurryThis$L = functionUncurryThis; +var uncurryThis$M = functionUncurryThis; var aCallable$t = aCallable$N; var arrayFromConstructorAndList$3 = arrayFromConstructorAndList$6; var aTypedArray$6 = ArrayBufferViewCore$7.aTypedArray; var getTypedArrayConstructor$3 = ArrayBufferViewCore$7.getTypedArrayConstructor; var exportTypedArrayMethod$7 = ArrayBufferViewCore$7.exportTypedArrayMethod; -var sort = uncurryThis$L(ArrayBufferViewCore$7.TypedArrayPrototype.sort); +var sort = uncurryThis$M(ArrayBufferViewCore$7.TypedArrayPrototype.sort); // `%TypedArray%.prototype.toSorted` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.tosorted @@ -11540,12 +11547,12 @@ exportTypedArrayMethod$7('toSorted', function toSorted(compareFn) { var exportTypedArrayMethod$6 = arrayBufferViewCore.exportTypedArrayMethod; var fails$d = fails$1u; var global$p = global$16; -var uncurryThis$K = functionUncurryThis; +var uncurryThis$L = functionUncurryThis; var Uint8Array = global$p.Uint8Array; var Uint8ArrayPrototype = Uint8Array && Uint8Array.prototype || {}; var arrayToString = [].toString; -var join$4 = uncurryThis$K([].join); +var join$4 = uncurryThis$L([].join); if (fails$d(function () { arrayToString.call({}); })) { arrayToString = function toString() { @@ -11589,23 +11596,23 @@ exportTypedArrayMethod$5('with', { 'with': function (index, value) { return arrayWith(O, getTypedArrayConstructor$2(O), relativeIndex, actualValue); } }['with'], !PROPER_ORDER$1); -var $$2H = _export; -var uncurryThis$J = functionUncurryThis; -var toString$b = toString$I; +var $$2I = _export; +var uncurryThis$K = functionUncurryThis; +var toString$c = toString$J; var fromCharCode$4 = String.fromCharCode; -var charAt$9 = uncurryThis$J(''.charAt); -var exec$9 = uncurryThis$J(/./.exec); -var stringSlice$5 = uncurryThis$J(''.slice); +var charAt$9 = uncurryThis$K(''.charAt); +var exec$9 = uncurryThis$K(/./.exec); +var stringSlice$5 = uncurryThis$K(''.slice); var hex2 = /^[\da-f]{2}$/i; var hex4 = /^[\da-f]{4}$/i; // `unescape` method // https://tc39.es/ecma262/#sec-unescape-string -$$2H({ global: true }, { +$$2I({ global: true }, { unescape: function unescape(string) { - var str = toString$b(string); + var str = toString$c(string); var result = ''; var length = str.length; var index = 0; @@ -11634,7 +11641,7 @@ $$2H({ global: true }, { } }); -var uncurryThis$I = functionUncurryThis; +var uncurryThis$J = functionUncurryThis; var defineBuiltIns$8 = defineBuiltIns$b; var getWeakData = internalMetadataExports.getWeakData; var anInstance$9 = anInstance$f; @@ -11650,7 +11657,7 @@ var setInternalState$e = InternalStateModule$d.set; var internalStateGetterFor = InternalStateModule$d.getterFor; var find$1 = ArrayIterationModule.find; var findIndex = ArrayIterationModule.findIndex; -var splice$1 = uncurryThis$I([].splice); +var splice$1 = uncurryThis$J([].splice); var id = 0; // fallback for uncaught frozen keys @@ -11767,7 +11774,7 @@ var collectionWeak$2 = { var FREEZING$2 = freezing; var global$o = global$16; -var uncurryThis$H = functionUncurryThis; +var uncurryThis$I = functionUncurryThis; var defineBuiltIns$7 = defineBuiltIns$b; var InternalMetadataModule = internalMetadataExports; var collection$1 = collection$4; @@ -11806,7 +11813,7 @@ var wrapper = function (init) { // https://tc39.es/ecma262/#sec-weakmap-constructor var $WeakMap = collection$1('WeakMap', wrapper, collectionWeak$1); var WeakMapPrototype$1 = $WeakMap.prototype; -var nativeSet = uncurryThis$H(WeakMapPrototype$1.set); +var nativeSet = uncurryThis$I(WeakMapPrototype$1.set); // Chakra Edge bug: adding frozen arrays to WeakMap unfreeze them var hasMSEdgeFreezingBug = function () { @@ -11823,9 +11830,9 @@ var hasMSEdgeFreezingBug = function () { if (NATIVE_WEAK_MAP) if (IS_IE11) { InternalWeakMap = collectionWeak$1.getConstructor(wrapper, 'WeakMap', true); InternalMetadataModule.enable(); - var nativeDelete = uncurryThis$H(WeakMapPrototype$1['delete']); - var nativeHas = uncurryThis$H(WeakMapPrototype$1.has); - var nativeGet = uncurryThis$H(WeakMapPrototype$1.get); + var nativeDelete = uncurryThis$I(WeakMapPrototype$1['delete']); + var nativeHas = uncurryThis$I(WeakMapPrototype$1.has); + var nativeGet = uncurryThis$I(WeakMapPrototype$1.get); defineBuiltIns$7(WeakMapPrototype$1, { 'delete': function (key) { if (isObject$d(key) && !isExtensible(key)) { @@ -11883,7 +11890,7 @@ collection('WeakSet', function (init) { return function WeakSet() { return init(this, arguments.length ? arguments[0] : undefined); }; }, collectionWeak); -var $$2G = _export; +var $$2H = _export; var isPrototypeOf$2 = objectIsPrototypeOf; var getPrototypeOf$6 = objectGetPrototypeOf$2; var setPrototypeOf = objectSetPrototypeOf$1; @@ -11893,16 +11900,16 @@ var createNonEnumerableProperty$7 = createNonEnumerableProperty$k; var createPropertyDescriptor$3 = createPropertyDescriptor$d; var installErrorStack = errorStackInstall; var normalizeStringArgument$2 = normalizeStringArgument$6; -var wellKnownSymbol$m = wellKnownSymbol$T; +var wellKnownSymbol$l = wellKnownSymbol$S; -var TO_STRING_TAG$7 = wellKnownSymbol$m('toStringTag'); +var TO_STRING_TAG$7 = wellKnownSymbol$l('toStringTag'); var $Error = Error; var $SuppressedError = function SuppressedError(error, suppressed, message) { var isInstance = isPrototypeOf$2(SuppressedErrorPrototype, this); var that; if (setPrototypeOf) { - that = setPrototypeOf($Error(), isInstance ? getPrototypeOf$6(this) : SuppressedErrorPrototype); + that = setPrototypeOf(new $Error(), isInstance ? getPrototypeOf$6(this) : SuppressedErrorPrototype); } else { that = isInstance ? this : create$9(SuppressedErrorPrototype); createNonEnumerableProperty$7(that, TO_STRING_TAG$7, 'Error'); @@ -11925,26 +11932,26 @@ var SuppressedErrorPrototype = $SuppressedError.prototype = create$9($Error.prot // `SuppressedError` constructor // https://github.com/tc39/proposal-explicit-resource-management -$$2G({ global: true, constructor: true, arity: 3 }, { +$$2H({ global: true, constructor: true, arity: 3 }, { SuppressedError: $SuppressedError }); var global$n = global$16; var shared$3 = sharedStore; -var isCallable$d = isCallable$K; +var isCallable$c = isCallable$J; var getPrototypeOf$5 = objectGetPrototypeOf$2; var defineBuiltIn$a = defineBuiltIn$u; -var wellKnownSymbol$l = wellKnownSymbol$T; +var wellKnownSymbol$k = wellKnownSymbol$S; var USE_FUNCTION_CONSTRUCTOR = 'USE_FUNCTION_CONSTRUCTOR'; -var ASYNC_ITERATOR$3 = wellKnownSymbol$l('asyncIterator'); +var ASYNC_ITERATOR$3 = wellKnownSymbol$k('asyncIterator'); var AsyncIterator = global$n.AsyncIterator; var PassedAsyncIteratorPrototype = shared$3.AsyncIteratorPrototype; var AsyncIteratorPrototype$5, prototype; if (PassedAsyncIteratorPrototype) { AsyncIteratorPrototype$5 = PassedAsyncIteratorPrototype; -} else if (isCallable$d(AsyncIterator)) { +} else if (isCallable$c(AsyncIterator)) { AsyncIteratorPrototype$5 = AsyncIterator.prototype; } else if (shared$3[USE_FUNCTION_CONSTRUCTOR] || global$n[USE_FUNCTION_CONSTRUCTOR]) { try { @@ -11956,7 +11963,7 @@ if (PassedAsyncIteratorPrototype) { if (!AsyncIteratorPrototype$5) AsyncIteratorPrototype$5 = {}; -if (!isCallable$d(AsyncIteratorPrototype$5[ASYNC_ITERATOR$3])) { +if (!isCallable$c(AsyncIteratorPrototype$5[ASYNC_ITERATOR$3])) { defineBuiltIn$a(AsyncIteratorPrototype$5, ASYNC_ITERATOR$3, function () { return this; }); @@ -12029,9 +12036,9 @@ var anObject$F = anObject$1f; var getIterator$3 = getIterator$7; var getIteratorDirect$n = getIteratorDirect$o; var getMethod$a = getMethod$l; -var wellKnownSymbol$k = wellKnownSymbol$T; +var wellKnownSymbol$j = wellKnownSymbol$S; -var ASYNC_ITERATOR$2 = wellKnownSymbol$k('asyncIterator'); +var ASYNC_ITERATOR$2 = wellKnownSymbol$j('asyncIterator'); var getAsyncIterator$1 = function (it, usingIterator) { var method = arguments.length < 2 ? getMethod$a(it, ASYNC_ITERATOR$2) : usingIterator; @@ -12148,7 +12155,7 @@ var asyncIteratorIteration = { }; var bind$i = functionBindContext; -var uncurryThis$G = functionUncurryThis; +var uncurryThis$H = functionUncurryThis; var toObject$9 = toObject$D; var isConstructor$4 = isConstructor$a; var getAsyncIterator = getAsyncIterator$1; @@ -12158,13 +12165,13 @@ var getIteratorMethod$3 = getIteratorMethod$8; var getMethod$8 = getMethod$l; var getVirtual = entryVirtual; var getBuiltIn$r = getBuiltIn$M; -var wellKnownSymbol$j = wellKnownSymbol$T; +var wellKnownSymbol$i = wellKnownSymbol$S; var AsyncFromSyncIterator$2 = asyncFromSyncIterator; var toArray = asyncIteratorIteration.toArray; -var ASYNC_ITERATOR$1 = wellKnownSymbol$j('asyncIterator'); -var arrayIterator = uncurryThis$G(getVirtual('Array').values); -var arrayIteratorNext = uncurryThis$G(arrayIterator([]).next); +var ASYNC_ITERATOR$1 = wellKnownSymbol$i('asyncIterator'); +var arrayIterator = uncurryThis$H(getVirtual('Array').values); +var arrayIteratorNext = uncurryThis$H(arrayIterator([]).next); var safeArrayIterator = function () { return new SafeArrayIterator(this); @@ -12198,23 +12205,23 @@ var arrayFromAsync$1 = function fromAsync(asyncItems /* , mapfn = undefined, thi }); }; -var $$2F = _export; +var $$2G = _export; var fromAsync = arrayFromAsync$1; // `Array.fromAsync` method // https://github.com/tc39/proposal-array-from-async -$$2F({ target: 'Array', stat: true }, { +$$2G({ target: 'Array', stat: true }, { fromAsync: fromAsync }); // TODO: remove from `core-js@4` -var $$2E = _export; +var $$2F = _export; var $filterReject$3 = arrayIteration.filterReject; var addToUnscopables$8 = addToUnscopables$n; // `Array.prototype.filterOut` method // https://github.com/tc39/proposal-array-filtering -$$2E({ target: 'Array', proto: true, forced: true }, { +$$2F({ target: 'Array', proto: true, forced: true }, { filterOut: function filterOut(callbackfn /* , thisArg */) { return $filterReject$3(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } @@ -12222,13 +12229,13 @@ $$2E({ target: 'Array', proto: true, forced: true }, { addToUnscopables$8('filterOut'); -var $$2D = _export; +var $$2E = _export; var $filterReject$2 = arrayIteration.filterReject; var addToUnscopables$7 = addToUnscopables$n; // `Array.prototype.filterReject` method // https://github.com/tc39/proposal-array-filtering -$$2D({ target: 'Array', proto: true, forced: true }, { +$$2E({ target: 'Array', proto: true, forced: true }, { filterReject: function filterReject(callbackfn /* , thisArg */) { return $filterReject$2(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } @@ -12237,7 +12244,7 @@ $$2D({ target: 'Array', proto: true, forced: true }, { addToUnscopables$7('filterReject'); var bind$h = functionBindContext; -var uncurryThis$F = functionUncurryThis; +var uncurryThis$G = functionUncurryThis; var IndexedObject$1 = indexedObject; var toObject$8 = toObject$D; var toPropertyKey$1 = toPropertyKey$a; @@ -12246,7 +12253,7 @@ var objectCreate = objectCreate$1; var arrayFromConstructorAndList$2 = arrayFromConstructorAndList$6; var $Array$1 = Array; -var push$h = uncurryThis$F([].push); +var push$h = uncurryThis$G([].push); var arrayGroup = function ($this, callbackfn, that, specificConstructor) { var O = toObject$8($this); @@ -12273,13 +12280,13 @@ var arrayGroup = function ($this, callbackfn, that, specificConstructor) { } return target; }; -var $$2C = _export; +var $$2D = _export; var $group$2 = arrayGroup; var addToUnscopables$6 = addToUnscopables$n; // `Array.prototype.group` method // https://github.com/tc39/proposal-array-grouping -$$2C({ target: 'Array', proto: true }, { +$$2D({ target: 'Array', proto: true }, { group: function group(callbackfn /* , thisArg */) { var thisArg = arguments.length > 1 ? arguments[1] : undefined; return $group$2(this, callbackfn, thisArg); @@ -12289,7 +12296,7 @@ $$2C({ target: 'Array', proto: true }, { addToUnscopables$6('group'); // TODO: Remove from `core-js@4` -var $$2B = _export; +var $$2C = _export; var $group$1 = arrayGroup; var arrayMethodIsStrict$1 = arrayMethodIsStrict$b; var addToUnscopables$5 = addToUnscopables$n; @@ -12297,7 +12304,7 @@ var addToUnscopables$5 = addToUnscopables$n; // `Array.prototype.groupBy` method // https://github.com/tc39/proposal-array-grouping // https://bugs.webkit.org/show_bug.cgi?id=236541 -$$2B({ target: 'Array', proto: true, forced: !arrayMethodIsStrict$1('groupBy') }, { +$$2C({ target: 'Array', proto: true, forced: !arrayMethodIsStrict$1('groupBy') }, { groupBy: function groupBy(callbackfn /* , thisArg */) { var thisArg = arguments.length > 1 ? arguments[1] : undefined; return $group$1(this, callbackfn, thisArg); @@ -12306,7 +12313,7 @@ $$2B({ target: 'Array', proto: true, forced: !arrayMethodIsStrict$1('groupBy') } addToUnscopables$5('groupBy'); -var uncurryThis$E = functionUncurryThis; +var uncurryThis$F = functionUncurryThis; // eslint-disable-next-line es/no-map -- safe var MapPrototype$1 = Map.prototype; @@ -12314,15 +12321,15 @@ var MapPrototype$1 = Map.prototype; var mapHelpers = { // eslint-disable-next-line es/no-map -- safe Map: Map, - set: uncurryThis$E(MapPrototype$1.set), - get: uncurryThis$E(MapPrototype$1.get), - has: uncurryThis$E(MapPrototype$1.has), - remove: uncurryThis$E(MapPrototype$1['delete']), + set: uncurryThis$F(MapPrototype$1.set), + get: uncurryThis$F(MapPrototype$1.get), + has: uncurryThis$F(MapPrototype$1.has), + remove: uncurryThis$F(MapPrototype$1['delete']), proto: MapPrototype$1 }; var bind$g = functionBindContext; -var uncurryThis$D = functionUncurryThis; +var uncurryThis$E = functionUncurryThis; var IndexedObject = indexedObject; var toObject$7 = toObject$D; var lengthOfArrayLike$8 = lengthOfArrayLike$C; @@ -12332,7 +12339,7 @@ var Map$b = MapHelpers$9.Map; var mapGet$1 = MapHelpers$9.get; var mapHas$2 = MapHelpers$9.has; var mapSet$2 = MapHelpers$9.set; -var push$g = uncurryThis$D([].push); +var push$g = uncurryThis$E([].push); // `Array.prototype.groupToMap` method // https://github.com/tc39/proposal-array-grouping @@ -12353,7 +12360,7 @@ var arrayGroupToMap = function groupToMap(callbackfn /* , thisArg */) { }; // TODO: Remove from `core-js@4` -var $$2A = _export; +var $$2B = _export; var arrayMethodIsStrict = arrayMethodIsStrict$b; var addToUnscopables$4 = addToUnscopables$n; var $groupToMap$1 = arrayGroupToMap; @@ -12361,26 +12368,26 @@ var $groupToMap$1 = arrayGroupToMap; // `Array.prototype.groupByToMap` method // https://github.com/tc39/proposal-array-grouping // https://bugs.webkit.org/show_bug.cgi?id=236541 -$$2A({ target: 'Array', proto: true, name: 'groupToMap', forced: !arrayMethodIsStrict('groupByToMap') }, { +$$2B({ target: 'Array', proto: true, name: 'groupToMap', forced: !arrayMethodIsStrict('groupByToMap') }, { groupByToMap: $groupToMap$1 }); addToUnscopables$4('groupByToMap'); -var $$2z = _export; +var $$2A = _export; var addToUnscopables$3 = addToUnscopables$n; var $groupToMap = arrayGroupToMap; var IS_PURE$g = isPure; // `Array.prototype.groupToMap` method // https://github.com/tc39/proposal-array-grouping -$$2z({ target: 'Array', proto: true, forced: IS_PURE$g }, { +$$2A({ target: 'Array', proto: true, forced: IS_PURE$g }, { groupToMap: $groupToMap }); addToUnscopables$3('groupToMap'); -var $$2y = _export; +var $$2z = _export; var isArray$1 = isArray$b; // eslint-disable-next-line es/no-object-isfrozen -- safe @@ -12401,7 +12408,7 @@ var isFrozenStringArray = function (array, allowUndefined) { // `Array.isTemplateObject` method // https://github.com/tc39/proposal-array-is-template-object -$$2y({ target: 'Array', stat: true, sham: true, forced: true }, { +$$2z({ target: 'Array', stat: true, sham: true, forced: true }, { isTemplateObject: function isTemplateObject(value) { if (!isFrozenStringArray(value, true)) return false; var raw = value.raw; @@ -12470,14 +12477,14 @@ var iterateSimple$8 = function (record, fn, ITERATOR_INSTEAD_OF_RECORD) { } }; -var uncurryThis$C = functionUncurryThis; +var uncurryThis$D = functionUncurryThis; var iterateSimple$7 = iterateSimple$8; var MapHelpers$8 = mapHelpers; var Map$a = MapHelpers$8.Map; var MapPrototype = MapHelpers$8.proto; -var forEach$4 = uncurryThis$C(MapPrototype.forEach); -var entries = uncurryThis$C(MapPrototype.entries); +var forEach$4 = uncurryThis$D(MapPrototype.forEach); +var entries = uncurryThis$D(MapPrototype.entries); var next$1 = entries(new Map$a()).next; var mapIterate = function (map, fn, interruptible) { @@ -12486,7 +12493,7 @@ var mapIterate = function (map, fn, interruptible) { }) : forEach$4(map, fn); }; -var uncurryThis$B = functionUncurryThis; +var uncurryThis$C = functionUncurryThis; var aCallable$r = aCallable$N; var isNullOrUndefined$6 = isNullOrUndefined$k; var lengthOfArrayLike$5 = lengthOfArrayLike$C; @@ -12497,7 +12504,7 @@ var iterate$w = mapIterate; var Map$9 = MapHelpers$7.Map; var mapHas$1 = MapHelpers$7.has; var mapSet$1 = MapHelpers$7.set; -var push$f = uncurryThis$B([].push); +var push$f = uncurryThis$C([].push); // `Array.prototype.uniqueBy` method // https://github.com/tc39/proposal-array-unique @@ -12521,13 +12528,13 @@ var arrayUniqueBy$2 = function uniqueBy(resolver) { return result; }; -var $$2x = _export; +var $$2y = _export; var addToUnscopables = addToUnscopables$n; var uniqueBy = arrayUniqueBy$2; // `Array.prototype.uniqueBy` method // https://github.com/tc39/proposal-array-unique -$$2x({ target: 'Array', proto: true, forced: true }, { +$$2y({ target: 'Array', proto: true, forced: true }, { uniqueBy: uniqueBy }); @@ -12542,14 +12549,14 @@ var $TypeError$j = TypeError; // - Perform ? RequireInternalSlot(O, [[ArrayBufferData]]). // - If IsSharedArrayBuffer(O) is true, throw a TypeError exception. var arrayBufferByteLength$2 = uncurryThisAccessor$2(ArrayBuffer.prototype, 'byteLength', 'get') || function (O) { - if (classof$5(O) !== 'ArrayBuffer') throw $TypeError$j('ArrayBuffer expected'); + if (classof$5(O) !== 'ArrayBuffer') throw new $TypeError$j('ArrayBuffer expected'); return O.byteLength; }; -var uncurryThis$A = functionUncurryThis; +var uncurryThis$B = functionUncurryThis; var arrayBufferByteLength$1 = arrayBufferByteLength$2; -var slice$4 = uncurryThis$A(ArrayBuffer.prototype.slice); +var slice$4 = uncurryThis$B(ArrayBuffer.prototype.slice); var arrayBufferIsDetached = function (O) { if (arrayBufferByteLength$1(O) !== 0) return false; @@ -12576,97 +12583,151 @@ if (DESCRIPTORS$d && !('detached' in ArrayBufferPrototype$1)) { }); } +var IS_NODE$2 = engineIsNode; + +var tryNodeRequire$2 = function (name) { + try { + // eslint-disable-next-line no-new-func -- safe + if (IS_NODE$2) return Function('return require("' + name + '")')(); + } catch (error) { /* empty */ } +}; + var global$m = global$16; var fails$b = fails$1u; var V8 = engineV8Version; var IS_BROWSER = engineIsBrowser; var IS_DENO = engineIsDeno; -var IS_NODE$2 = engineIsNode; +var IS_NODE$1 = engineIsNode; -var structuredClone$1 = global$m.structuredClone; +var structuredClone$2 = global$m.structuredClone; -var structuredCloneProperTransfer = !!structuredClone$1 && !fails$b(function () { +var structuredCloneProperTransfer = !!structuredClone$2 && !fails$b(function () { // prevent V8 ArrayBufferDetaching protector cell invalidation and performance degradation // https://github.com/zloirock/core-js/issues/679 - if ((IS_DENO && V8 > 92) || (IS_NODE$2 && V8 > 94) || (IS_BROWSER && V8 > 97)) return false; + if ((IS_DENO && V8 > 92) || (IS_NODE$1 && V8 > 94) || (IS_BROWSER && V8 > 97)) return false; var buffer = new ArrayBuffer(8); - var clone = structuredClone$1(buffer, { transfer: [buffer] }); + var clone = structuredClone$2(buffer, { transfer: [buffer] }); return buffer.byteLength !== 0 || clone.byteLength !== 8; }); var global$l = global$16; -var uncurryThis$z = functionUncurryThis; +var tryNodeRequire$1 = tryNodeRequire$2; +var PROPER_STRUCTURED_CLONE_TRANSFER$2 = structuredCloneProperTransfer; + +var structuredClone$1 = global$l.structuredClone; +var $ArrayBuffer = global$l.ArrayBuffer; +var $MessageChannel = global$l.MessageChannel; +var detach = false; +var WorkerThreads, channel, buffer, $detach; + +if (PROPER_STRUCTURED_CLONE_TRANSFER$2) { + detach = function (transferable) { + structuredClone$1(transferable, { transfer: [transferable] }); + }; +} else if ($ArrayBuffer) try { + if (!$MessageChannel) { + WorkerThreads = tryNodeRequire$1('worker_threads'); + if (WorkerThreads) $MessageChannel = WorkerThreads.MessageChannel; + } + + if ($MessageChannel) { + channel = new $MessageChannel(); + buffer = new $ArrayBuffer(2); + + $detach = function (transferable) { + channel.port1.postMessage(null, [transferable]); + }; + + if (buffer.byteLength === 2) { + $detach(buffer); + if (buffer.byteLength === 0) detach = $detach; + } + } +} catch (error) { /* empty */ } + +var detachTransferable$1 = detach; + +var global$k = global$16; +var uncurryThis$A = functionUncurryThis; var uncurryThisAccessor$1 = functionUncurryThisAccessor; var toIndex$2 = toIndex$5; var isDetached = arrayBufferIsDetached; var arrayBufferByteLength = arrayBufferByteLength$2; -var PROPER_TRANSFER$1 = structuredCloneProperTransfer; +var detachTransferable = detachTransferable$1; +var PROPER_STRUCTURED_CLONE_TRANSFER$1 = structuredCloneProperTransfer; -var TypeError$4 = global$l.TypeError; -var structuredClone = global$l.structuredClone; -var ArrayBuffer$1 = global$l.ArrayBuffer; -var DataView$1 = global$l.DataView; +var structuredClone = global$k.structuredClone; +var ArrayBuffer$1 = global$k.ArrayBuffer; +var DataView$1 = global$k.DataView; +var TypeError$4 = global$k.TypeError; var min$3 = Math.min; var ArrayBufferPrototype = ArrayBuffer$1.prototype; var DataViewPrototype = DataView$1.prototype; -var slice$3 = uncurryThis$z(ArrayBufferPrototype.slice); +var slice$3 = uncurryThis$A(ArrayBufferPrototype.slice); var isResizable = uncurryThisAccessor$1(ArrayBufferPrototype, 'resizable', 'get'); var maxByteLength = uncurryThisAccessor$1(ArrayBufferPrototype, 'maxByteLength', 'get'); -var getInt8 = uncurryThis$z(DataViewPrototype.getInt8); -var setInt8 = uncurryThis$z(DataViewPrototype.setInt8); +var getInt8 = uncurryThis$A(DataViewPrototype.getInt8); +var setInt8 = uncurryThis$A(DataViewPrototype.setInt8); -var arrayBufferTransfer = PROPER_TRANSFER$1 && function (arrayBuffer, newLength, preserveResizability) { +var arrayBufferTransfer$1 = (PROPER_STRUCTURED_CLONE_TRANSFER$1 || detachTransferable) && function (arrayBuffer, newLength, preserveResizability) { var byteLength = arrayBufferByteLength(arrayBuffer); var newByteLength = newLength === undefined ? byteLength : toIndex$2(newLength); var fixedLength = !isResizable || !isResizable(arrayBuffer); - if (isDetached(arrayBuffer)) throw TypeError$4('ArrayBuffer is detached'); - var newBuffer = structuredClone(arrayBuffer, { transfer: [arrayBuffer] }); - if (byteLength === newByteLength && (preserveResizability || fixedLength)) return newBuffer; - if (byteLength >= newByteLength && (!preserveResizability || fixedLength)) return slice$3(newBuffer, 0, newByteLength); - var options = (preserveResizability && !fixedLength) && maxByteLength ? { maxByteLength: maxByteLength(newBuffer) } : undefined; - var newNewBuffer = new ArrayBuffer$1(newByteLength, options); - var a = new DataView$1(newBuffer); - var b = new DataView$1(newNewBuffer); - var copyLength = min$3(newByteLength, byteLength); - for (var i = 0; i < copyLength; i++) setInt8(b, i, getInt8(a, i)); - return newNewBuffer; + var newBuffer; + if (isDetached(arrayBuffer)) throw new TypeError$4('ArrayBuffer is detached'); + if (PROPER_STRUCTURED_CLONE_TRANSFER$1) { + arrayBuffer = structuredClone(arrayBuffer, { transfer: [arrayBuffer] }); + if (byteLength === newByteLength && (preserveResizability || fixedLength)) return arrayBuffer; + } + if (byteLength >= newByteLength && (!preserveResizability || fixedLength)) { + newBuffer = slice$3(arrayBuffer, 0, newByteLength); + } else { + var options = preserveResizability && !fixedLength && maxByteLength ? { maxByteLength: maxByteLength(arrayBuffer) } : undefined; + newBuffer = new ArrayBuffer$1(newByteLength, options); + var a = new DataView$1(arrayBuffer); + var b = new DataView$1(newBuffer); + var copyLength = min$3(newByteLength, byteLength); + for (var i = 0; i < copyLength; i++) setInt8(b, i, getInt8(a, i)); + } + if (!PROPER_STRUCTURED_CLONE_TRANSFER$1) detachTransferable(arrayBuffer); + return newBuffer; }; -var $$2w = _export; -var $transfer$1 = arrayBufferTransfer; +var $$2x = _export; +var $transfer$1 = arrayBufferTransfer$1; // `ArrayBuffer.prototype.transfer` method // https://tc39.es/proposal-arraybuffer-transfer/#sec-arraybuffer.prototype.transfer -if ($transfer$1) $$2w({ target: 'ArrayBuffer', proto: true }, { +if ($transfer$1) $$2x({ target: 'ArrayBuffer', proto: true }, { transfer: function transfer() { return $transfer$1(this, arguments.length ? arguments[0] : undefined, true); } }); -var $$2v = _export; -var $transfer = arrayBufferTransfer; +var $$2w = _export; +var $transfer = arrayBufferTransfer$1; // `ArrayBuffer.prototype.transferToFixedLength` method // https://tc39.es/proposal-arraybuffer-transfer/#sec-arraybuffer.prototype.transfertofixedlength -if ($transfer) $$2v({ target: 'ArrayBuffer', proto: true }, { +if ($transfer) $$2w({ target: 'ArrayBuffer', proto: true }, { transferToFixedLength: function transferToFixedLength() { return $transfer(this, arguments.length ? arguments[0] : undefined, false); } }); var call$E = functionCall; -var uncurryThis$y = functionUncurryThis; +var uncurryThis$z = functionUncurryThis; var bind$f = functionBindContext; var anObject$D = anObject$1f; var aCallable$q = aCallable$N; var isNullOrUndefined$5 = isNullOrUndefined$k; var getMethod$7 = getMethod$l; -var wellKnownSymbol$i = wellKnownSymbol$T; +var wellKnownSymbol$h = wellKnownSymbol$S; -var ASYNC_DISPOSE$2 = wellKnownSymbol$i('asyncDispose'); -var DISPOSE$2 = wellKnownSymbol$i('dispose'); +var ASYNC_DISPOSE$2 = wellKnownSymbol$h('asyncDispose'); +var DISPOSE$2 = wellKnownSymbol$h('dispose'); -var push$e = uncurryThis$y([].push); +var push$e = uncurryThis$z([].push); // `GetDisposeMethod` abstract operation // https://tc39.es/proposal-explicit-resource-management/#sec-getdisposemethod @@ -12710,7 +12771,7 @@ var addDisposableResource$2 = function (disposable, V, hint, method) { }; // https://github.com/tc39/proposal-async-explicit-resource-management -var $$2u = _export; +var $$2v = _export; var DESCRIPTORS$c = descriptors; var getBuiltIn$q = getBuiltIn$M; var aCallable$p = aCallable$N; @@ -12718,7 +12779,7 @@ var anInstance$8 = anInstance$f; var defineBuiltIn$9 = defineBuiltIn$u; var defineBuiltIns$5 = defineBuiltIns$b; var defineBuiltInAccessor$8 = defineBuiltInAccessor$o; -var wellKnownSymbol$h = wellKnownSymbol$T; +var wellKnownSymbol$g = wellKnownSymbol$S; var InternalStateModule$b = internalState; var addDisposableResource$1 = addDisposableResource$2; @@ -12726,8 +12787,8 @@ var Promise$4 = getBuiltIn$q('Promise'); var SuppressedError$1 = getBuiltIn$q('SuppressedError'); var $ReferenceError$1 = ReferenceError; -var ASYNC_DISPOSE$1 = wellKnownSymbol$h('asyncDispose'); -var TO_STRING_TAG$6 = wellKnownSymbol$h('toStringTag'); +var ASYNC_DISPOSE$1 = wellKnownSymbol$g('asyncDispose'); +var TO_STRING_TAG$6 = wellKnownSymbol$g('toStringTag'); var ASYNC_DISPOSABLE_STACK = 'AsyncDisposableStack'; var setInternalState$c = InternalStateModule$b.set; @@ -12739,7 +12800,7 @@ var PENDING$1 = 'pending'; var getPendingAsyncDisposableStackInternalState = function (stack) { var internalState = getAsyncDisposableStackInternalState(stack); - if (internalState.state === DISPOSED$1) throw $ReferenceError$1(ASYNC_DISPOSABLE_STACK + ' already disposed'); + if (internalState.state === DISPOSED$1) throw new $ReferenceError$1(ASYNC_DISPOSABLE_STACK + ' already disposed'); return internalState; }; @@ -12835,26 +12896,26 @@ if (DESCRIPTORS$c) defineBuiltInAccessor$8(AsyncDisposableStackPrototype, 'dispo defineBuiltIn$9(AsyncDisposableStackPrototype, ASYNC_DISPOSE$1, AsyncDisposableStackPrototype.disposeAsync, { name: 'disposeAsync' }); defineBuiltIn$9(AsyncDisposableStackPrototype, TO_STRING_TAG$6, ASYNC_DISPOSABLE_STACK, { nonWritable: true }); -$$2u({ global: true, constructor: true }, { +$$2v({ global: true, constructor: true }, { AsyncDisposableStack: $AsyncDisposableStack }); -var $$2t = _export; +var $$2u = _export; var anInstance$7 = anInstance$f; var getPrototypeOf$4 = objectGetPrototypeOf$2; var createNonEnumerableProperty$6 = createNonEnumerableProperty$k; var hasOwn$e = hasOwnProperty_1; -var wellKnownSymbol$g = wellKnownSymbol$T; +var wellKnownSymbol$f = wellKnownSymbol$S; var AsyncIteratorPrototype$3 = asyncIteratorPrototype; var IS_PURE$f = isPure; -var TO_STRING_TAG$5 = wellKnownSymbol$g('toStringTag'); +var TO_STRING_TAG$5 = wellKnownSymbol$f('toStringTag'); var $TypeError$i = TypeError; var AsyncIteratorConstructor = function AsyncIterator() { anInstance$7(this, AsyncIteratorPrototype$3); - if (getPrototypeOf$4(this) === AsyncIteratorPrototype$3) throw $TypeError$i('Abstract class AsyncIterator not directly constructable'); + if (getPrototypeOf$4(this) === AsyncIteratorPrototype$3) throw new $TypeError$i('Abstract class AsyncIterator not directly constructable'); }; AsyncIteratorConstructor.prototype = AsyncIteratorPrototype$3; @@ -12869,7 +12930,7 @@ if (!hasOwn$e(AsyncIteratorPrototype$3, 'constructor') || AsyncIteratorPrototype // `AsyncIterator` constructor // https://github.com/tc39/proposal-async-iterator-helpers -$$2t({ global: true, constructor: true, forced: IS_PURE$f }, { +$$2u({ global: true, constructor: true, forced: IS_PURE$f }, { AsyncIterator: AsyncIteratorConstructor }); @@ -12879,7 +12940,7 @@ var anObject$C = anObject$1f; var create$7 = objectCreate$1; var createNonEnumerableProperty$5 = createNonEnumerableProperty$k; var defineBuiltIns$4 = defineBuiltIns$b; -var wellKnownSymbol$f = wellKnownSymbol$T; +var wellKnownSymbol$e = wellKnownSymbol$S; var InternalStateModule$a = internalState; var getBuiltIn$p = getBuiltIn$M; var getMethod$6 = getMethod$l; @@ -12889,7 +12950,7 @@ var iteratorClose$5 = iteratorClose$8; var Promise$3 = getBuiltIn$p('Promise'); -var TO_STRING_TAG$4 = wellKnownSymbol$f('toStringTag'); +var TO_STRING_TAG$4 = wellKnownSymbol$e('toStringTag'); var ASYNC_ITERATOR_HELPER = 'AsyncIteratorHelper'; var WRAP_FOR_VALID_ASYNC_ITERATOR = 'WrapForValidAsyncIterator'; var setInternalState$b = InternalStateModule$a.set; @@ -13049,12 +13110,12 @@ var asyncIteratorIndexed = function indexed() { }; // TODO: Remove from `core-js@4` -var $$2s = _export; +var $$2t = _export; var indexed$3 = asyncIteratorIndexed; // `AsyncIterator.prototype.asIndexedPairs` method // https://github.com/tc39/proposal-iterator-helpers -$$2s({ target: 'AsyncIterator', name: 'indexed', proto: true, real: true, forced: true }, { +$$2t({ target: 'AsyncIterator', name: 'indexed', proto: true, real: true, forced: true }, { asIndexedPairs: indexed$3 }); @@ -13064,10 +13125,10 @@ var defineBuiltIn$8 = defineBuiltIn$u; var getBuiltIn$o = getBuiltIn$M; var getMethod$5 = getMethod$l; var hasOwn$d = hasOwnProperty_1; -var wellKnownSymbol$e = wellKnownSymbol$T; +var wellKnownSymbol$d = wellKnownSymbol$S; var AsyncIteratorPrototype$1 = asyncIteratorPrototype; -var ASYNC_DISPOSE = wellKnownSymbol$e('asyncDispose'); +var ASYNC_DISPOSE = wellKnownSymbol$d('asyncDispose'); var Promise$2 = getBuiltIn$o('Promise'); if (!hasOwn$d(AsyncIteratorPrototype$1, ASYNC_DISPOSE)) { @@ -13089,10 +13150,10 @@ var $RangeError$4 = RangeError; var notANan = function (it) { // eslint-disable-next-line no-self-compare -- NaN check if (it === it) return it; - throw $RangeError$4('NaN is not allowed'); + throw new $RangeError$4('NaN is not allowed'); }; -var $$2r = _export; +var $$2s = _export; var call$z = functionCall; var anObject$A = anObject$1f; var getIteratorDirect$j = getIteratorDirect$o; @@ -13133,7 +13194,7 @@ var AsyncIteratorProxy$3 = createAsyncIteratorProxy$4(function (Promise) { // `AsyncIterator.prototype.drop` method // https://github.com/tc39/proposal-async-iterator-helpers -$$2r({ target: 'AsyncIterator', proto: true, real: true, forced: IS_PURE$e }, { +$$2s({ target: 'AsyncIterator', proto: true, real: true, forced: IS_PURE$e }, { drop: function drop(limit) { anObject$A(this); var remaining = toPositiveInteger$3(notANaN$3(+limit)); @@ -13143,18 +13204,18 @@ $$2r({ target: 'AsyncIterator', proto: true, real: true, forced: IS_PURE$e }, { } }); -var $$2q = _export; +var $$2r = _export; var $every = asyncIteratorIteration.every; // `AsyncIterator.prototype.every` method // https://github.com/tc39/proposal-async-iterator-helpers -$$2q({ target: 'AsyncIterator', proto: true, real: true }, { +$$2r({ target: 'AsyncIterator', proto: true, real: true }, { every: function every(predicate) { return $every(this, predicate); } }); -var $$2p = _export; +var $$2q = _export; var call$y = functionCall; var aCallable$n = aCallable$N; var anObject$z = anObject$1f; @@ -13211,7 +13272,7 @@ var AsyncIteratorProxy$2 = createAsyncIteratorProxy$3(function (Promise) { // `AsyncIterator.prototype.filter` method // https://github.com/tc39/proposal-async-iterator-helpers -$$2p({ target: 'AsyncIterator', proto: true, real: true, forced: IS_PURE$d }, { +$$2q({ target: 'AsyncIterator', proto: true, real: true, forced: IS_PURE$d }, { filter: function filter(predicate) { anObject$z(this); aCallable$n(predicate); @@ -13221,34 +13282,34 @@ $$2p({ target: 'AsyncIterator', proto: true, real: true, forced: IS_PURE$d }, { } }); -var $$2o = _export; +var $$2p = _export; var $find = asyncIteratorIteration.find; // `AsyncIterator.prototype.find` method // https://github.com/tc39/proposal-async-iterator-helpers -$$2o({ target: 'AsyncIterator', proto: true, real: true }, { +$$2p({ target: 'AsyncIterator', proto: true, real: true }, { find: function find(predicate) { return $find(this, predicate); } }); var call$x = functionCall; -var isCallable$c = isCallable$K; +var isCallable$b = isCallable$J; var anObject$y = anObject$1f; var getIteratorDirect$h = getIteratorDirect$o; var getIteratorMethod$2 = getIteratorMethod$8; var getMethod$4 = getMethod$l; -var wellKnownSymbol$d = wellKnownSymbol$T; +var wellKnownSymbol$c = wellKnownSymbol$S; var AsyncFromSyncIterator$1 = asyncFromSyncIterator; -var ASYNC_ITERATOR = wellKnownSymbol$d('asyncIterator'); +var ASYNC_ITERATOR = wellKnownSymbol$c('asyncIterator'); var getAsyncIteratorFlattenable$2 = function from(obj) { var object = anObject$y(obj); var alreadyAsync = true; var method = getMethod$4(object, ASYNC_ITERATOR); var iterator; - if (!isCallable$c(method)) { + if (!isCallable$b(method)) { method = getIteratorMethod$2(object); alreadyAsync = false; } @@ -13262,7 +13323,7 @@ var getAsyncIteratorFlattenable$2 = function from(obj) { return getIteratorDirect$h(alreadyAsync ? iterator : new AsyncFromSyncIterator$1(getIteratorDirect$h(iterator))); }; -var $$2n = _export; +var $$2o = _export; var call$w = functionCall; var aCallable$m = aCallable$N; var anObject$x = anObject$1f; @@ -13339,7 +13400,7 @@ var AsyncIteratorProxy$1 = createAsyncIteratorProxy$2(function (Promise) { // `AsyncIterator.prototype.flaMap` method // https://github.com/tc39/proposal-async-iterator-helpers -$$2n({ target: 'AsyncIterator', proto: true, real: true, forced: IS_PURE$c }, { +$$2o({ target: 'AsyncIterator', proto: true, real: true, forced: IS_PURE$c }, { flatMap: function flatMap(mapper) { anObject$x(this); aCallable$m(mapper); @@ -13350,12 +13411,12 @@ $$2n({ target: 'AsyncIterator', proto: true, real: true, forced: IS_PURE$c }, { } }); -var $$2m = _export; +var $$2n = _export; var $forEach = asyncIteratorIteration.forEach; // `AsyncIterator.prototype.forEach` method // https://github.com/tc39/proposal-async-iterator-helpers -$$2m({ target: 'AsyncIterator', proto: true, real: true }, { +$$2n({ target: 'AsyncIterator', proto: true, real: true }, { forEach: function forEach(fn) { return $forEach(this, fn); } @@ -13368,7 +13429,7 @@ var asyncIteratorWrap = createAsyncIteratorProxy$1(function () { return call$v(this.next, this.iterator); }, true); -var $$2l = _export; +var $$2m = _export; var toObject$3 = toObject$D; var isPrototypeOf$1 = objectIsPrototypeOf; var getAsyncIteratorFlattenable = getAsyncIteratorFlattenable$2; @@ -13378,7 +13439,7 @@ var IS_PURE$b = isPure; // `AsyncIterator.from` method // https://github.com/tc39/proposal-async-iterator-helpers -$$2l({ target: 'AsyncIterator', stat: true, forced: IS_PURE$b }, { +$$2m({ target: 'AsyncIterator', stat: true, forced: IS_PURE$b }, { from: function from(O) { var iteratorRecord = getAsyncIteratorFlattenable(typeof O == 'string' ? toObject$3(O) : O); return isPrototypeOf$1(AsyncIteratorPrototype, iteratorRecord.iterator) @@ -13388,26 +13449,26 @@ $$2l({ target: 'AsyncIterator', stat: true, forced: IS_PURE$b }, { }); // TODO: Remove from `core-js@4` -var $$2k = _export; +var $$2l = _export; var indexed$2 = asyncIteratorIndexed; // `AsyncIterator.prototype.indexed` method // https://github.com/tc39/proposal-iterator-helpers -$$2k({ target: 'AsyncIterator', proto: true, real: true, forced: true }, { +$$2l({ target: 'AsyncIterator', proto: true, real: true, forced: true }, { indexed: indexed$2 }); -var $$2j = _export; +var $$2k = _export; var map$2 = asyncIteratorMap; var IS_PURE$a = isPure; // `AsyncIterator.prototype.map` method // https://github.com/tc39/proposal-async-iterator-helpers -$$2j({ target: 'AsyncIterator', proto: true, real: true, forced: IS_PURE$a }, { +$$2k({ target: 'AsyncIterator', proto: true, real: true, forced: IS_PURE$a }, { map: map$2 }); -var $$2i = _export; +var $$2j = _export; var call$u = functionCall; var aCallable$l = aCallable$N; var anObject$w = anObject$1f; @@ -13421,7 +13482,7 @@ var $TypeError$h = TypeError; // `AsyncIterator.prototype.reduce` method // https://github.com/tc39/proposal-async-iterator-helpers -$$2i({ target: 'AsyncIterator', proto: true, real: true }, { +$$2j({ target: 'AsyncIterator', proto: true, real: true }, { reduce: function reduce(reducer /* , initialValue */) { anObject$w(this); aCallable$l(reducer); @@ -13442,7 +13503,7 @@ $$2i({ target: 'AsyncIterator', proto: true, real: true }, { Promise$1.resolve(anObject$w(call$u(next, iterator))).then(function (step) { try { if (anObject$w(step).done) { - noInitial ? reject($TypeError$h('Reduce of empty iterator with no initial value')) : resolve(accumulator); + noInitial ? reject(new $TypeError$h('Reduce of empty iterator with no initial value')) : resolve(accumulator); } else { var value = step.value; if (noInitial) { @@ -13472,18 +13533,18 @@ $$2i({ target: 'AsyncIterator', proto: true, real: true }, { } }); -var $$2h = _export; +var $$2i = _export; var $some = asyncIteratorIteration.some; // `AsyncIterator.prototype.some` method // https://github.com/tc39/proposal-async-iterator-helpers -$$2h({ target: 'AsyncIterator', proto: true, real: true }, { +$$2i({ target: 'AsyncIterator', proto: true, real: true }, { some: function some(predicate) { return $some(this, predicate); } }); -var $$2g = _export; +var $$2h = _export; var call$t = functionCall; var anObject$v = anObject$1f; var getIteratorDirect$e = getIteratorDirect$o; @@ -13521,7 +13582,7 @@ var AsyncIteratorProxy = createAsyncIteratorProxy(function (Promise) { // `AsyncIterator.prototype.take` method // https://github.com/tc39/proposal-async-iterator-helpers -$$2g({ target: 'AsyncIterator', proto: true, real: true, forced: IS_PURE$9 }, { +$$2h({ target: 'AsyncIterator', proto: true, real: true, forced: IS_PURE$9 }, { take: function take(limit) { anObject$v(this); var remaining = toPositiveInteger$2(notANaN$2(+limit)); @@ -13531,12 +13592,12 @@ $$2g({ target: 'AsyncIterator', proto: true, real: true, forced: IS_PURE$9 }, { } }); -var $$2f = _export; +var $$2g = _export; var $toArray = asyncIteratorIteration.toArray; // `AsyncIterator.prototype.toArray` method // https://github.com/tc39/proposal-async-iterator-helpers -$$2f({ target: 'AsyncIterator', proto: true, real: true }, { +$$2g({ target: 'AsyncIterator', proto: true, real: true }, { toArray: function toArray() { return $toArray(this, undefined, []); } @@ -13562,10 +13623,10 @@ var $TypeError$g = TypeError; var $RangeIterator = createIteratorConstructor$4(function NumericRangeIterator(start, end, option, type, zero, one) { // TODO: Drop the first `typeof` check after removing legacy methods in `core-js@4` if (typeof start != type || (end !== Infinity && end !== -Infinity && typeof end != type)) { - throw $TypeError$g(INCORRECT_RANGE); + throw new $TypeError$g(INCORRECT_RANGE); } if (start === Infinity || start === -Infinity) { - throw $RangeError$3(INCORRECT_RANGE); + throw new $RangeError$3(INCORRECT_RANGE); } var ifIncrease = end > start; var inclusiveEnd = false; @@ -13578,16 +13639,16 @@ var $RangeIterator = createIteratorConstructor$4(function NumericRangeIterator(s } else if (typeof option == type) { step = option; } else { - throw $TypeError$g(INCORRECT_RANGE); + throw new $TypeError$g(INCORRECT_RANGE); } if (isNullOrUndefined$4(step)) { step = ifIncrease ? one : -one; } if (typeof step != type) { - throw $TypeError$g(INCORRECT_RANGE); + throw new $TypeError$g(INCORRECT_RANGE); } if (step === Infinity || step === -Infinity || (step === zero && start !== end)) { - throw $RangeError$3(INCORRECT_RANGE); + throw new $RangeError$3(INCORRECT_RANGE); } // eslint-disable-next-line no-self-compare -- NaN check var hitsEnd = start !== start || end !== end || step !== step || (end > start) !== (step > zero); @@ -13649,14 +13710,14 @@ if (DESCRIPTORS$b) { var numericRangeIterator = $RangeIterator; /* eslint-disable es/no-bigint -- safe */ -var $$2e = _export; +var $$2f = _export; var NumericRangeIterator$2 = numericRangeIterator; // `BigInt.range` method // https://github.com/tc39/proposal-Number.range // TODO: Remove from `core-js@4` if (typeof BigInt == 'function') { - $$2e({ target: 'BigInt', stat: true, forced: true }, { + $$2f({ target: 'BigInt', stat: true, forced: true }, { range: function range(start, end, option) { return new NumericRangeIterator$2(start, end, option, 'bigint', BigInt(0), BigInt(1)); } @@ -13707,13 +13768,13 @@ var compositeKey = function () { for (i = 0; i < length; i++) { if (isObject$6(it = arguments[i])) active = active.next(i, it, true); } - if (this === $Object$2 && active === root) throw $TypeError$f('Composite keys must contain a non-primitive component'); + if (this === $Object$2 && active === root) throw new $TypeError$f('Composite keys must contain a non-primitive component'); for (i = 0; i < length; i++) { if (!isObject$6(it = arguments[i])) active = active.next(i, it, false); } return active; }; -var $$2d = _export; +var $$2e = _export; var apply$3 = functionApply$1; var getCompositeKeyNode$1 = compositeKey; var getBuiltIn$l = getBuiltIn$M; @@ -13727,98 +13788,111 @@ var initializer = function () { }; // https://github.com/tc39/proposal-richer-keys/tree/master/compositeKey -$$2d({ global: true, forced: true }, { +$$2e({ global: true, forced: true }, { compositeKey: function compositeKey() { return apply$3(getCompositeKeyNode$1, $Object$1, arguments).get('object', initializer); } }); -var $$2c = _export; +var $$2d = _export; var getCompositeKeyNode = compositeKey; var getBuiltIn$k = getBuiltIn$M; var apply$2 = functionApply$1; // https://github.com/tc39/proposal-richer-keys/tree/master/compositeKey -$$2c({ global: true, forced: true }, { +$$2d({ global: true, forced: true }, { compositeSymbol: function compositeSymbol() { if (arguments.length === 1 && typeof arguments[0] == 'string') return getBuiltIn$k('Symbol')['for'](arguments[0]); return apply$2(getCompositeKeyNode, null, arguments).get('symbol', getBuiltIn$k('Symbol')); } }); -var $$2b = _export; -var uncurryThis$x = functionUncurryThis; -var unpackIEEE754$1 = ieee754.unpack; +var $$2c = _export; +var uncurryThis$y = functionUncurryThis; +var unpackIEEE754 = ieee754.unpack; // eslint-disable-next-line es/no-typed-arrays -- safe -var getUint16 = uncurryThis$x(DataView.prototype.getUint16); +var getUint16 = uncurryThis$y(DataView.prototype.getUint16); // `DataView.prototype.getFloat16` method // https://github.com/tc39/proposal-float16array -$$2b({ target: 'DataView', proto: true }, { +$$2c({ target: 'DataView', proto: true }, { getFloat16: function getFloat16(byteOffset /* , littleEndian */) { var uint16 = getUint16(this, byteOffset, arguments.length > 1 ? arguments[1] : false); - return unpackIEEE754$1([uint16 & 0xFF, uint16 >> 8 & 0xFF], 10); + return unpackIEEE754([uint16 & 0xFF, uint16 >> 8 & 0xFF], 10); } }); -var $$2a = _export; -var uncurryThis$w = functionUncurryThis; +var $$2b = _export; +var uncurryThis$x = functionUncurryThis; // eslint-disable-next-line es/no-typed-arrays -- safe -var getUint8 = uncurryThis$w(DataView.prototype.getUint8); +var getUint8 = uncurryThis$x(DataView.prototype.getUint8); // `DataView.prototype.getUint8Clamped` method // https://github.com/tc39/proposal-dataview-get-set-uint8c -$$2a({ target: 'DataView', proto: true, forced: true }, { +$$2b({ target: 'DataView', proto: true, forced: true }, { getUint8Clamped: function getUint8Clamped(byteOffset) { return getUint8(this, byteOffset); } }); -var $$29 = _export; -var uncurryThis$v = functionUncurryThis; +var floatRound = mathFloatRound; + +var FLOAT16_EPSILON = 0.0009765625; +var FLOAT16_MAX_VALUE = 65504; +var FLOAT16_MIN_VALUE = 6.103515625e-05; + +// `Math.f16round` method implementation +// https://github.com/tc39/proposal-float16array +var mathF16round = Math.f16round || function f16round(x) { + return floatRound(x, FLOAT16_EPSILON, FLOAT16_MAX_VALUE, FLOAT16_MIN_VALUE); +}; + +var $$2a = _export; +var uncurryThis$w = functionUncurryThis; var classof$4 = classof$q; var toIndex$1 = toIndex$5; -var packIEEE754$1 = ieee754.pack; +var packIEEE754 = ieee754.pack; +var f16round$1 = mathF16round; var $TypeError$e = TypeError; // eslint-disable-next-line es/no-typed-arrays -- safe -var setUint16 = uncurryThis$v(DataView.prototype.setUint16); +var setUint16 = uncurryThis$w(DataView.prototype.setUint16); // `DataView.prototype.setFloat16` method // https://github.com/tc39/proposal-float16array -$$29({ target: 'DataView', proto: true }, { +$$2a({ target: 'DataView', proto: true }, { setFloat16: function setFloat16(byteOffset, value /* , littleEndian */) { - if (classof$4(this) !== 'DataView') throw $TypeError$e('Incorrect receiver'); + if (classof$4(this) !== 'DataView') throw new $TypeError$e('Incorrect receiver'); var offset = toIndex$1(byteOffset); - var bytes = packIEEE754$1(+value, 10, 2); + var bytes = packIEEE754(f16round$1(value), 10, 2); return setUint16(this, offset, bytes[1] << 8 | bytes[0], arguments.length > 2 ? arguments[2] : false); } }); -var $$28 = _export; -var uncurryThis$u = functionUncurryThis; +var $$29 = _export; +var uncurryThis$v = functionUncurryThis; var classof$3 = classof$q; var toIndex = toIndex$5; var toUint8Clamped = toUint8Clamped$2; var $TypeError$d = TypeError; // eslint-disable-next-line es/no-typed-arrays -- safe -var setUint8 = uncurryThis$u(DataView.prototype.setUint8); +var setUint8 = uncurryThis$v(DataView.prototype.setUint8); // `DataView.prototype.setUint8Clamped` method // https://github.com/tc39/proposal-dataview-get-set-uint8c -$$28({ target: 'DataView', proto: true, forced: true }, { +$$29({ target: 'DataView', proto: true, forced: true }, { setUint8Clamped: function setUint8Clamped(byteOffset, value) { - if (classof$3(this) !== 'DataView') throw $TypeError$d('Incorrect receiver'); + if (classof$3(this) !== 'DataView') throw new $TypeError$d('Incorrect receiver'); var offset = toIndex(byteOffset); return setUint8(this, offset, toUint8Clamped(value)); } }); // https://github.com/tc39/proposal-explicit-resource-management -var $$27 = _export; +var $$28 = _export; var DESCRIPTORS$a = descriptors; var getBuiltIn$j = getBuiltIn$M; var aCallable$k = aCallable$N; @@ -13826,15 +13900,15 @@ var anInstance$6 = anInstance$f; var defineBuiltIn$7 = defineBuiltIn$u; var defineBuiltIns$3 = defineBuiltIns$b; var defineBuiltInAccessor$6 = defineBuiltInAccessor$o; -var wellKnownSymbol$c = wellKnownSymbol$T; +var wellKnownSymbol$b = wellKnownSymbol$S; var InternalStateModule$8 = internalState; var addDisposableResource = addDisposableResource$2; var SuppressedError = getBuiltIn$j('SuppressedError'); var $ReferenceError = ReferenceError; -var DISPOSE$1 = wellKnownSymbol$c('dispose'); -var TO_STRING_TAG$3 = wellKnownSymbol$c('toStringTag'); +var DISPOSE$1 = wellKnownSymbol$b('dispose'); +var TO_STRING_TAG$3 = wellKnownSymbol$b('toStringTag'); var DISPOSABLE_STACK = 'DisposableStack'; var setInternalState$9 = InternalStateModule$8.set; @@ -13846,7 +13920,7 @@ var PENDING = 'pending'; var getPendingDisposableStackInternalState = function (stack) { var internalState = getDisposableStackInternalState(stack); - if (internalState.state === DISPOSED) throw $ReferenceError(DISPOSABLE_STACK + ' already disposed'); + if (internalState.state === DISPOSED) throw new $ReferenceError(DISPOSABLE_STACK + ' already disposed'); return internalState; }; @@ -13927,29 +14001,29 @@ if (DESCRIPTORS$a) defineBuiltInAccessor$6(DisposableStackPrototype, 'disposed', defineBuiltIn$7(DisposableStackPrototype, DISPOSE$1, DisposableStackPrototype.dispose, { name: 'dispose' }); defineBuiltIn$7(DisposableStackPrototype, TO_STRING_TAG$3, DISPOSABLE_STACK, { nonWritable: true }); -$$27({ global: true, constructor: true }, { +$$28({ global: true, constructor: true }, { DisposableStack: $DisposableStack }); -var uncurryThis$t = functionUncurryThis; +var uncurryThis$u = functionUncurryThis; var aCallable$j = aCallable$N; var functionDemethodize = function demethodize() { - return uncurryThis$t(aCallable$j(this)); + return uncurryThis$u(aCallable$j(this)); }; -var $$26 = _export; +var $$27 = _export; var demethodize$1 = functionDemethodize; // `Function.prototype.demethodize` method // https://github.com/js-choi/proposal-function-demethodize -$$26({ target: 'Function', proto: true, forced: true }, { +$$27({ target: 'Function', proto: true, forced: true }, { demethodize: demethodize$1 }); - -var $$25 = _export; -var uncurryThis$s = functionUncurryThis; -var $isCallable = isCallable$K; + +var $$26 = _export; +var uncurryThis$t = functionUncurryThis; +var $isCallable = isCallable$J; var inspectSource = inspectSource$4; var hasOwn$c = hasOwnProperty_1; var DESCRIPTORS$9 = descriptors; @@ -13957,7 +14031,7 @@ var DESCRIPTORS$9 = descriptors; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getOwnPropertyDescriptor$4 = Object.getOwnPropertyDescriptor; var classRegExp = /^\s*class\b/; -var exec$8 = uncurryThis$s(classRegExp.exec); +var exec$8 = uncurryThis$t(classRegExp.exec); var isClassConstructor = function (argument) { try { @@ -13971,25 +14045,25 @@ var isClassConstructor = function (argument) { // `Function.isCallable` method // https://github.com/caitp/TC39-Proposals/blob/trunk/tc39-reflect-isconstructor-iscallable.md -$$25({ target: 'Function', stat: true, sham: true, forced: true }, { +$$26({ target: 'Function', stat: true, sham: true, forced: true }, { isCallable: function isCallable(argument) { return $isCallable(argument) && !isClassConstructor(argument); } }); -var $$24 = _export; +var $$25 = _export; var isConstructor$3 = isConstructor$a; // `Function.isConstructor` method // https://github.com/caitp/TC39-Proposals/blob/trunk/tc39-reflect-isconstructor-iscallable.md -$$24({ target: 'Function', stat: true, forced: true }, { +$$25({ target: 'Function', stat: true, forced: true }, { isConstructor: isConstructor$3 }); -var wellKnownSymbol$b = wellKnownSymbol$T; +var wellKnownSymbol$a = wellKnownSymbol$S; var defineProperty$6 = objectDefineProperty.f; -var METADATA = wellKnownSymbol$b('metadata'); +var METADATA = wellKnownSymbol$a('metadata'); var FunctionPrototype = Function.prototype; // Function.prototype[@@metadata] @@ -14000,41 +14074,41 @@ if (FunctionPrototype[METADATA] === undefined) { }); } -var $$23 = _export; +var $$24 = _export; var demethodize = functionDemethodize; // `Function.prototype.unThis` method // https://github.com/js-choi/proposal-function-demethodize // TODO: Remove from `core-js@4` -$$23({ target: 'Function', proto: true, forced: true, name: 'demethodize' }, { +$$24({ target: 'Function', proto: true, forced: true, name: 'demethodize' }, { unThis: demethodize }); -var $$22 = _export; -var global$k = global$16; +var $$23 = _export; +var global$j = global$16; var anInstance$5 = anInstance$f; -var isCallable$b = isCallable$K; +var isCallable$a = isCallable$J; var getPrototypeOf$3 = objectGetPrototypeOf$2; var createNonEnumerableProperty$4 = createNonEnumerableProperty$k; var fails$a = fails$1u; var hasOwn$b = hasOwnProperty_1; -var wellKnownSymbol$a = wellKnownSymbol$T; +var wellKnownSymbol$9 = wellKnownSymbol$S; var IteratorPrototype$3 = iteratorsCore.IteratorPrototype; -var TO_STRING_TAG$2 = wellKnownSymbol$a('toStringTag'); +var TO_STRING_TAG$2 = wellKnownSymbol$9('toStringTag'); var $TypeError$c = TypeError; -var NativeIterator = global$k.Iterator; +var NativeIterator = global$j.Iterator; // FF56- have non-standard global helper `Iterator` -var FORCED = !isCallable$b(NativeIterator) +var FORCED = !isCallable$a(NativeIterator) || NativeIterator.prototype !== IteratorPrototype$3 // FF44- non-standard `Iterator` passes previous tests || !fails$a(function () { NativeIterator({}); }); var IteratorConstructor = function Iterator() { anInstance$5(this, IteratorPrototype$3); - if (getPrototypeOf$3(this) === IteratorPrototype$3) throw $TypeError$c('Abstract class Iterator not directly constructable'); + if (getPrototypeOf$3(this) === IteratorPrototype$3) throw new $TypeError$c('Abstract class Iterator not directly constructable'); }; if (!hasOwn$b(IteratorPrototype$3, TO_STRING_TAG$2)) { @@ -14049,7 +14123,7 @@ IteratorConstructor.prototype = IteratorPrototype$3; // `Iterator` constructor // https://github.com/tc39/proposal-iterator-helpers -$$22({ global: true, constructor: true, forced: FORCED }, { +$$23({ global: true, constructor: true, forced: FORCED }, { Iterator: IteratorConstructor }); @@ -14057,14 +14131,14 @@ var call$s = functionCall; var create$4 = objectCreate$1; var createNonEnumerableProperty$3 = createNonEnumerableProperty$k; var defineBuiltIns$2 = defineBuiltIns$b; -var wellKnownSymbol$9 = wellKnownSymbol$T; +var wellKnownSymbol$8 = wellKnownSymbol$S; var InternalStateModule$7 = internalState; var getMethod$3 = getMethod$l; var IteratorPrototype$2 = iteratorsCore.IteratorPrototype; var createIterResultObject$3 = createIterResultObject$g; var iteratorClose$4 = iteratorClose$8; -var TO_STRING_TAG$1 = wellKnownSymbol$9('toStringTag'); +var TO_STRING_TAG$1 = wellKnownSymbol$8('toStringTag'); var ITERATOR_HELPER = 'IteratorHelper'; var WRAP_FOR_VALID_ITERATOR = 'WrapForValidIterator'; var setInternalState$8 = InternalStateModule$7.set; @@ -14167,12 +14241,12 @@ var iteratorIndexed = function indexed() { }; // TODO: Remove from `core-js@4` -var $$21 = _export; +var $$22 = _export; var indexed$1 = iteratorIndexed; // `Iterator.prototype.asIndexedPairs` method // https://github.com/tc39/proposal-iterator-helpers -$$21({ target: 'Iterator', name: 'indexed', proto: true, real: true, forced: true }, { +$$22({ target: 'Iterator', name: 'indexed', proto: true, real: true, forced: true }, { asIndexedPairs: indexed$1 }); @@ -14181,10 +14255,10 @@ var call$p = functionCall; var defineBuiltIn$6 = defineBuiltIn$u; var getMethod$2 = getMethod$l; var hasOwn$a = hasOwnProperty_1; -var wellKnownSymbol$8 = wellKnownSymbol$T; +var wellKnownSymbol$7 = wellKnownSymbol$S; var IteratorPrototype$1 = iteratorsCore.IteratorPrototype; -var DISPOSE = wellKnownSymbol$8('dispose'); +var DISPOSE = wellKnownSymbol$7('dispose'); if (!hasOwn$a(IteratorPrototype$1, DISPOSE)) { defineBuiltIn$6(IteratorPrototype$1, DISPOSE, function () { @@ -14193,7 +14267,7 @@ if (!hasOwn$a(IteratorPrototype$1, DISPOSE)) { }); } -var $$20 = _export; +var $$21 = _export; var call$o = functionCall; var anObject$t = anObject$1f; var getIteratorDirect$c = getIteratorDirect$o; @@ -14219,7 +14293,7 @@ var IteratorProxy$4 = createIteratorProxy$4(function () { // `Iterator.prototype.drop` method // https://github.com/tc39/proposal-iterator-helpers -$$20({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$8 }, { +$$21({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$8 }, { drop: function drop(limit) { anObject$t(this); var remaining = toPositiveInteger$1(notANaN$1(+limit)); @@ -14229,7 +14303,7 @@ $$20({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$8 }, { } }); -var $$1$ = _export; +var $$20 = _export; var iterate$v = iterate$G; var aCallable$h = aCallable$N; var anObject$s = anObject$1f; @@ -14237,7 +14311,7 @@ var getIteratorDirect$b = getIteratorDirect$o; // `Iterator.prototype.every` method // https://github.com/tc39/proposal-iterator-helpers -$$1$({ target: 'Iterator', proto: true, real: true }, { +$$20({ target: 'Iterator', proto: true, real: true }, { every: function every(predicate) { anObject$s(this); aCallable$h(predicate); @@ -14249,7 +14323,7 @@ $$1$({ target: 'Iterator', proto: true, real: true }, { } }); -var $$1_ = _export; +var $$1$ = _export; var call$n = functionCall; var aCallable$g = aCallable$N; var anObject$r = anObject$1f; @@ -14274,7 +14348,7 @@ var IteratorProxy$3 = createIteratorProxy$3(function () { // `Iterator.prototype.filter` method // https://github.com/tc39/proposal-iterator-helpers -$$1_({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$7 }, { +$$1$({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$7 }, { filter: function filter(predicate) { anObject$r(this); aCallable$g(predicate); @@ -14284,7 +14358,7 @@ $$1_({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$7 }, { } }); -var $$1Z = _export; +var $$1_ = _export; var iterate$u = iterate$G; var aCallable$f = aCallable$N; var anObject$q = anObject$1f; @@ -14292,7 +14366,7 @@ var getIteratorDirect$9 = getIteratorDirect$o; // `Iterator.prototype.find` method // https://github.com/tc39/proposal-iterator-helpers -$$1Z({ target: 'Iterator', proto: true, real: true }, { +$$1_({ target: 'Iterator', proto: true, real: true }, { find: function find(predicate) { anObject$q(this); aCallable$f(predicate); @@ -14315,7 +14389,7 @@ var getIteratorFlattenable$2 = function (obj, stringHandling) { return getIteratorDirect$8(anObject$p(method !== undefined ? call$m(method, obj) : obj)); }; -var $$1Y = _export; +var $$1Z = _export; var call$l = functionCall; var aCallable$e = aCallable$N; var anObject$o = anObject$1f; @@ -14349,7 +14423,7 @@ var IteratorProxy$2 = createIteratorProxy$2(function () { // `Iterator.prototype.flatMap` method // https://github.com/tc39/proposal-iterator-helpers -$$1Y({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$6 }, { +$$1Z({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$6 }, { flatMap: function flatMap(mapper) { anObject$o(this); aCallable$e(mapper); @@ -14360,7 +14434,7 @@ $$1Y({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$6 }, { } }); -var $$1X = _export; +var $$1Y = _export; var iterate$t = iterate$G; var aCallable$d = aCallable$N; var anObject$n = anObject$1f; @@ -14368,7 +14442,7 @@ var getIteratorDirect$6 = getIteratorDirect$o; // `Iterator.prototype.forEach` method // https://github.com/tc39/proposal-iterator-helpers -$$1X({ target: 'Iterator', proto: true, real: true }, { +$$1Y({ target: 'Iterator', proto: true, real: true }, { forEach: function forEach(fn) { anObject$n(this); aCallable$d(fn); @@ -14380,7 +14454,7 @@ $$1X({ target: 'Iterator', proto: true, real: true }, { } }); -var $$1W = _export; +var $$1X = _export; var call$k = functionCall; var toObject$2 = toObject$D; var isPrototypeOf = objectIsPrototypeOf; @@ -14395,7 +14469,7 @@ var IteratorProxy$1 = createIteratorProxy$1(function () { // `Iterator.from` method // https://github.com/tc39/proposal-iterator-helpers -$$1W({ target: 'Iterator', stat: true, forced: IS_PURE$5 }, { +$$1X({ target: 'Iterator', stat: true, forced: IS_PURE$5 }, { from: function from(O) { var iteratorRecord = getIteratorFlattenable(typeof O == 'string' ? toObject$2(O) : O, true); return isPrototypeOf(IteratorPrototype, iteratorRecord.iterator) @@ -14405,42 +14479,42 @@ $$1W({ target: 'Iterator', stat: true, forced: IS_PURE$5 }, { }); // TODO: Remove from `core-js@4` -var $$1V = _export; +var $$1W = _export; var indexed = iteratorIndexed; // `Iterator.prototype.indexed` method // https://github.com/tc39/proposal-iterator-helpers -$$1V({ target: 'Iterator', proto: true, real: true, forced: true }, { +$$1W({ target: 'Iterator', proto: true, real: true, forced: true }, { indexed: indexed }); -var $$1U = _export; +var $$1V = _export; var map = iteratorMap; var IS_PURE$4 = isPure; // `Iterator.prototype.map` method // https://github.com/tc39/proposal-iterator-helpers -$$1U({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$4 }, { +$$1V({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$4 }, { map: map }); /* eslint-disable es/no-bigint -- safe */ -var $$1T = _export; +var $$1U = _export; var NumericRangeIterator$1 = numericRangeIterator; var $TypeError$b = TypeError; // `Iterator.range` method // https://github.com/tc39/proposal-Number.range -$$1T({ target: 'Iterator', stat: true, forced: true }, { +$$1U({ target: 'Iterator', stat: true, forced: true }, { range: function range(start, end, option) { if (typeof start == 'number') return new NumericRangeIterator$1(start, end, option, 'number', 0, 1); if (typeof start == 'bigint') return new NumericRangeIterator$1(start, end, option, 'bigint', BigInt(0), BigInt(1)); - throw $TypeError$b('Incorrect Iterator.range arguments'); + throw new $TypeError$b('Incorrect Iterator.range arguments'); } }); -var $$1S = _export; +var $$1T = _export; var iterate$s = iterate$G; var aCallable$c = aCallable$N; var anObject$m = anObject$1f; @@ -14450,7 +14524,7 @@ var $TypeError$a = TypeError; // `Iterator.prototype.reduce` method // https://github.com/tc39/proposal-iterator-helpers -$$1S({ target: 'Iterator', proto: true, real: true }, { +$$1T({ target: 'Iterator', proto: true, real: true }, { reduce: function reduce(reducer /* , initialValue */) { anObject$m(this); aCallable$c(reducer); @@ -14467,12 +14541,12 @@ $$1S({ target: 'Iterator', proto: true, real: true }, { } counter++; }, { IS_RECORD: true }); - if (noInitial) throw $TypeError$a('Reduce of empty iterator with no initial value'); + if (noInitial) throw new $TypeError$a('Reduce of empty iterator with no initial value'); return accumulator; } }); -var $$1R = _export; +var $$1S = _export; var iterate$r = iterate$G; var aCallable$b = aCallable$N; var anObject$l = anObject$1f; @@ -14480,7 +14554,7 @@ var getIteratorDirect$4 = getIteratorDirect$o; // `Iterator.prototype.some` method // https://github.com/tc39/proposal-iterator-helpers -$$1R({ target: 'Iterator', proto: true, real: true }, { +$$1S({ target: 'Iterator', proto: true, real: true }, { some: function some(predicate) { anObject$l(this); aCallable$b(predicate); @@ -14492,7 +14566,7 @@ $$1R({ target: 'Iterator', proto: true, real: true }, { } }); -var $$1Q = _export; +var $$1R = _export; var call$j = functionCall; var anObject$k = anObject$1f; var getIteratorDirect$3 = getIteratorDirect$o; @@ -14515,7 +14589,7 @@ var IteratorProxy = createIteratorProxy(function () { // `Iterator.prototype.take` method // https://github.com/tc39/proposal-iterator-helpers -$$1Q({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$3 }, { +$$1R({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$3 }, { take: function take(limit) { anObject$k(this); var remaining = toPositiveInteger(notANaN(+limit)); @@ -14525,7 +14599,7 @@ $$1Q({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$3 }, { } }); -var $$1P = _export; +var $$1Q = _export; var anObject$j = anObject$1f; var iterate$q = iterate$G; var getIteratorDirect$2 = getIteratorDirect$o; @@ -14534,7 +14608,7 @@ var push$d = [].push; // `Iterator.prototype.toArray` method // https://github.com/tc39/proposal-iterator-helpers -$$1P({ target: 'Iterator', proto: true, real: true }, { +$$1Q({ target: 'Iterator', proto: true, real: true }, { toArray: function toArray() { var result = []; iterate$q(getIteratorDirect$2(anObject$j(this)), push$d, { that: result, IS_RECORD: true }); @@ -14542,7 +14616,7 @@ $$1P({ target: 'Iterator', proto: true, real: true }, { } }); -var $$1O = _export; +var $$1P = _export; var anObject$i = anObject$1f; var AsyncFromSyncIterator = asyncFromSyncIterator; var WrapAsyncIterator = asyncIteratorWrap; @@ -14551,7 +14625,7 @@ var IS_PURE$2 = isPure; // `Iterator.prototype.toAsync` method // https://github.com/tc39/proposal-async-iterator-helpers -$$1O({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$2 }, { +$$1P({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$2 }, { toAsync: function toAsync() { return new WrapAsyncIterator(getIteratorDirect$1(new AsyncFromSyncIterator(getIteratorDirect$1(anObject$i(this))))); } @@ -14575,26 +14649,26 @@ var isRawJson = function isRawJSON(O) { return !!state && state.type === 'RawJSON'; }; -var $$1N = _export; +var $$1O = _export; var NATIVE_RAW_JSON$1 = nativeRawJson; var isRawJSON$1 = isRawJson; // `JSON.parse` method // https://tc39.es/proposal-json-parse-with-source/#sec-json.israwjson // https://github.com/tc39/proposal-json-parse-with-source -$$1N({ target: 'JSON', stat: true, forced: !NATIVE_RAW_JSON$1 }, { +$$1O({ target: 'JSON', stat: true, forced: !NATIVE_RAW_JSON$1 }, { isRawJSON: isRawJSON$1 }); -var uncurryThis$r = functionUncurryThis; +var uncurryThis$s = functionUncurryThis; var hasOwn$9 = hasOwnProperty_1; var $SyntaxError$2 = SyntaxError; var $parseInt = parseInt; var fromCharCode$3 = String.fromCharCode; -var at$2 = uncurryThis$r(''.charAt); -var slice$2 = uncurryThis$r(''.slice); -var exec$7 = uncurryThis$r(/./.exec); +var at$2 = uncurryThis$s(''.charAt); +var slice$2 = uncurryThis$s(''.slice); +var exec$7 = uncurryThis$s(/./.exec); var codePoints = { '\\"': '"', @@ -14624,52 +14698,52 @@ var parseJsonString = function (source, i) { } else if (twoChars === '\\u') { i += 2; var fourHexDigits = slice$2(source, i, i + 4); - if (!exec$7(IS_4_HEX_DIGITS, fourHexDigits)) throw $SyntaxError$2('Bad Unicode escape at: ' + i); + if (!exec$7(IS_4_HEX_DIGITS, fourHexDigits)) throw new $SyntaxError$2('Bad Unicode escape at: ' + i); value += fromCharCode$3($parseInt(fourHexDigits, 16)); i += 4; - } else throw $SyntaxError$2('Unknown escape sequence: "' + twoChars + '"'); + } else throw new $SyntaxError$2('Unknown escape sequence: "' + twoChars + '"'); } else if (chr === '"') { unterminated = false; i++; break; } else { - if (exec$7(IS_C0_CONTROL_CODE, chr)) throw $SyntaxError$2('Bad control character in string literal at: ' + i); + if (exec$7(IS_C0_CONTROL_CODE, chr)) throw new $SyntaxError$2('Bad control character in string literal at: ' + i); value += chr; i++; } } - if (unterminated) throw $SyntaxError$2('Unterminated string at: ' + i); + if (unterminated) throw new $SyntaxError$2('Unterminated string at: ' + i); return { value: value, end: i }; }; -var $$1M = _export; +var $$1N = _export; var DESCRIPTORS$8 = descriptors; -var global$j = global$16; +var global$i = global$16; var getBuiltIn$i = getBuiltIn$M; -var uncurryThis$q = functionUncurryThis; +var uncurryThis$r = functionUncurryThis; var call$i = functionCall; -var isCallable$a = isCallable$K; +var isCallable$9 = isCallable$J; var isObject$4 = isObject$K; var isArray = isArray$b; var hasOwn$8 = hasOwnProperty_1; -var toString$a = toString$I; +var toString$b = toString$J; var lengthOfArrayLike$4 = lengthOfArrayLike$C; var createProperty$2 = createProperty$b; var fails$8 = fails$1u; var parseJSONString$1 = parseJsonString; var NATIVE_SYMBOL = symbolConstructorDetection; -var JSON$1 = global$j.JSON; -var Number$1 = global$j.Number; -var SyntaxError$2 = global$j.SyntaxError; +var JSON$1 = global$i.JSON; +var Number$1 = global$i.Number; +var SyntaxError$2 = global$i.SyntaxError; var nativeParse = JSON$1 && JSON$1.parse; var enumerableOwnProperties = getBuiltIn$i('Object', 'keys'); // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getOwnPropertyDescriptor$3 = Object.getOwnPropertyDescriptor; -var at$1 = uncurryThis$q(''.charAt); -var slice$1 = uncurryThis$q(''.slice); -var exec$6 = uncurryThis$q(/./.exec); -var push$c = uncurryThis$q([].push); +var at$1 = uncurryThis$r(''.charAt); +var slice$1 = uncurryThis$r(''.slice); +var exec$6 = uncurryThis$r(/./.exec); +var push$c = uncurryThis$r([].push); var IS_DIGIT = /^\d$/; var IS_NON_ZERO_DIGIT = /^[1-9]$/; @@ -14680,15 +14754,15 @@ var PRIMITIVE = 0; var OBJECT = 1; var $parse = function (source, reviver) { - source = toString$a(source); + source = toString$b(source); var context = new Context(source, 0); var root = context.parse(); var value = root.value; var endIndex = context.skip(IS_WHITESPACE$1, root.end); if (endIndex < source.length) { - throw SyntaxError$2('Unexpected extra character: "' + at$1(source, endIndex) + '" after the parsed data at: ' + endIndex); + throw new SyntaxError$2('Unexpected extra character: "' + at$1(source, endIndex) + '" after the parsed data at: ' + endIndex); } - return isCallable$a(reviver) ? internalize({ '': value }, '', reviver, root) : value; + return isCallable$9(reviver) ? internalize({ '': value }, '', reviver, root) : value; }; var internalize = function (holder, name, reviver, node) { @@ -14762,7 +14836,7 @@ Context.prototype = { return fork.keyword(false); case 'n': return fork.keyword(null); - } throw SyntaxError$2('Unexpected character: "' + chr + '" at: ' + i); + } throw new SyntaxError$2('Unexpected character: "' + chr + '" at: ' + i); }, node: function (type, value, start, end, nodes) { return new Node(value, end, type ? null : slice$1(this.source, start, end), nodes); @@ -14839,14 +14913,14 @@ Context.prototype = { if (at$1(source, i) === '-') i++; if (at$1(source, i) === '0') i++; else if (exec$6(IS_NON_ZERO_DIGIT, at$1(source, i))) i = this.skip(IS_DIGIT, ++i); - else throw SyntaxError$2('Failed to parse number at: ' + i); + else throw new SyntaxError$2('Failed to parse number at: ' + i); if (at$1(source, i) === '.') i = this.skip(IS_DIGIT, ++i); if (at$1(source, i) === 'e' || at$1(source, i) === 'E') { i++; if (at$1(source, i) === '+' || at$1(source, i) === '-') i++; var exponentStartIndex = i; i = this.skip(IS_DIGIT, i); - if (exponentStartIndex === i) throw SyntaxError$2("Failed to parse number's exponent value at: " + i); + if (exponentStartIndex === i) throw new SyntaxError$2("Failed to parse number's exponent value at: " + i); } return this.node(PRIMITIVE, Number$1(slice$1(source, startIndex, i)), startIndex, i); }, @@ -14854,7 +14928,7 @@ Context.prototype = { var keyword = '' + value; var index = this.index; var endIndex = index + keyword.length; - if (slice$1(this.source, index, endIndex) !== keyword) throw SyntaxError$2('Failed to parse value at: ' + index); + if (slice$1(this.source, index, endIndex) !== keyword) throw new SyntaxError$2('Failed to parse value at: ' + index); return this.node(PRIMITIVE, value, index, endIndex); }, skip: function (regex, i) { @@ -14866,7 +14940,7 @@ Context.prototype = { i = this.skip(IS_WHITESPACE$1, i); var chr = at$1(this.source, i); for (var j = 0; j < array.length; j++) if (array[j] === chr) return i; - throw SyntaxError$2('Unexpected character: "' + chr + '" at: ' + i); + throw new SyntaxError$2('Unexpected character: "' + chr + '" at: ' + i); } }; @@ -14887,21 +14961,21 @@ var PROPER_BASE_PARSE = NATIVE_SYMBOL && !fails$8(function () { // `JSON.parse` method // https://tc39.es/ecma262/#sec-json.parse // https://github.com/tc39/proposal-json-parse-with-source -$$1M({ target: 'JSON', stat: true, forced: NO_SOURCE_SUPPORT }, { +$$1N({ target: 'JSON', stat: true, forced: NO_SOURCE_SUPPORT }, { parse: function parse(text, reviver) { - return PROPER_BASE_PARSE && !isCallable$a(reviver) ? nativeParse(text) : $parse(text, reviver); + return PROPER_BASE_PARSE && !isCallable$9(reviver) ? nativeParse(text) : $parse(text, reviver); } }); -var $$1L = _export; +var $$1M = _export; var FREEZING$1 = freezing; var NATIVE_RAW_JSON = nativeRawJson; var getBuiltIn$h = getBuiltIn$M; var call$h = functionCall; -var uncurryThis$p = functionUncurryThis; -var isCallable$9 = isCallable$K; +var uncurryThis$q = functionUncurryThis; +var isCallable$8 = isCallable$J; var isRawJSON = isRawJson; -var toString$9 = toString$I; +var toString$a = toString$J; var createProperty$1 = createProperty$b; var parseJSONString = parseJsonString; var getReplacerFunction = getJsonReplacerFunction; @@ -14914,10 +14988,10 @@ var parse$1 = getBuiltIn$h('JSON', 'parse'); var $stringify = getBuiltIn$h('JSON', 'stringify'); var create$3 = getBuiltIn$h('Object', 'create'); var freeze$1 = getBuiltIn$h('Object', 'freeze'); -var at = uncurryThis$p(''.charAt); -var slice = uncurryThis$p(''.slice); -var exec$5 = uncurryThis$p(/./.exec); -var push$b = uncurryThis$p([].push); +var at = uncurryThis$q(''.charAt); +var slice = uncurryThis$q(''.slice); +var exec$5 = uncurryThis$q(/./.exec); +var push$b = uncurryThis$q([].push); var MARK = uid$1(); var MARK_LENGTH = MARK.length; @@ -14927,14 +15001,14 @@ var IS_WHITESPACE = /^[\t\n\r ]$/; // `JSON.parse` method // https://tc39.es/proposal-json-parse-with-source/#sec-json.israwjson // https://github.com/tc39/proposal-json-parse-with-source -$$1L({ target: 'JSON', stat: true, forced: !NATIVE_RAW_JSON }, { +$$1M({ target: 'JSON', stat: true, forced: !NATIVE_RAW_JSON }, { rawJSON: function rawJSON(text) { - var jsonString = toString$9(text); + var jsonString = toString$a(text); if (jsonString === '' || exec$5(IS_WHITESPACE, at(jsonString, 0)) || exec$5(IS_WHITESPACE, at(jsonString, jsonString.length - 1))) { - throw $SyntaxError$1(ERROR_MESSAGE); + throw new $SyntaxError$1(ERROR_MESSAGE); } var parsed = parse$1(jsonString); - if (typeof parsed == 'object' && parsed !== null) throw $SyntaxError$1(ERROR_MESSAGE); + if (typeof parsed == 'object' && parsed !== null) throw new $SyntaxError$1(ERROR_MESSAGE); var obj = create$3(null); setInternalState$7(obj, { type: 'RawJSON' }); createProperty$1(obj, 'rawJSON', jsonString); @@ -14945,14 +15019,14 @@ $$1L({ target: 'JSON', stat: true, forced: !NATIVE_RAW_JSON }, { // `JSON.stringify` method // https://tc39.es/ecma262/#sec-json.stringify // https://github.com/tc39/proposal-json-parse-with-source -if ($stringify) $$1L({ target: 'JSON', stat: true, arity: 3, forced: !NATIVE_RAW_JSON }, { +if ($stringify) $$1M({ target: 'JSON', stat: true, arity: 3, forced: !NATIVE_RAW_JSON }, { stringify: function stringify(text, replacer, space) { var replacerFunction = getReplacerFunction(replacer); var rawStrings = []; var json = $stringify(text, function (key, value) { // some old implementations (like WebKit) could pass numbers as keys - var v = isCallable$9(replacerFunction) ? call$h(replacerFunction, this, $String(key), value) : value; + var v = isCallable$8(replacerFunction) ? call$h(replacerFunction, this, $String(key), value) : value; return isRawJSON(v) ? MARK + (push$b(rawStrings, v.rawJSON) - 1) : v; }, space); @@ -14985,13 +15059,13 @@ var aMap$e = function (it) { return it; }; -var $$1K = _export; +var $$1L = _export; var aMap$d = aMap$e; var remove$5 = mapHelpers.remove; // `Map.prototype.deleteAll` method // https://github.com/tc39/proposal-collection-methods -$$1K({ target: 'Map', proto: true, real: true, forced: true }, { +$$1L({ target: 'Map', proto: true, real: true, forced: true }, { deleteAll: function deleteAll(/* ...elements */) { var collection = aMap$d(this); var allDeleted = true; @@ -15003,7 +15077,7 @@ $$1K({ target: 'Map', proto: true, real: true, forced: true }, { } }); -var $$1J = _export; +var $$1K = _export; var aMap$c = aMap$e; var MapHelpers$6 = mapHelpers; @@ -15013,7 +15087,7 @@ var set$7 = MapHelpers$6.set; // `Map.prototype.emplace` method // https://github.com/tc39/proposal-upsert -$$1J({ target: 'Map', proto: true, real: true, forced: true }, { +$$1K({ target: 'Map', proto: true, real: true, forced: true }, { emplace: function emplace(key, handler) { var map = aMap$c(this); var value, inserted; @@ -15030,14 +15104,14 @@ $$1J({ target: 'Map', proto: true, real: true, forced: true }, { } }); -var $$1I = _export; +var $$1J = _export; var bind$e = functionBindContext; var aMap$b = aMap$e; var iterate$p = mapIterate; // `Map.prototype.every` method // https://github.com/tc39/proposal-collection-methods -$$1I({ target: 'Map', proto: true, real: true, forced: true }, { +$$1J({ target: 'Map', proto: true, real: true, forced: true }, { every: function every(callbackfn /* , thisArg */) { var map = aMap$b(this); var boundFunction = bind$e(callbackfn, arguments.length > 1 ? arguments[1] : undefined); @@ -15047,7 +15121,7 @@ $$1I({ target: 'Map', proto: true, real: true, forced: true }, { } }); -var $$1H = _export; +var $$1I = _export; var bind$d = functionBindContext; var aMap$a = aMap$e; var MapHelpers$5 = mapHelpers; @@ -15058,7 +15132,7 @@ var set$6 = MapHelpers$5.set; // `Map.prototype.filter` method // https://github.com/tc39/proposal-collection-methods -$$1H({ target: 'Map', proto: true, real: true, forced: true }, { +$$1I({ target: 'Map', proto: true, real: true, forced: true }, { filter: function filter(callbackfn /* , thisArg */) { var map = aMap$a(this); var boundFunction = bind$d(callbackfn, arguments.length > 1 ? arguments[1] : undefined); @@ -15070,14 +15144,14 @@ $$1H({ target: 'Map', proto: true, real: true, forced: true }, { } }); -var $$1G = _export; +var $$1H = _export; var bind$c = functionBindContext; var aMap$9 = aMap$e; var iterate$n = mapIterate; // `Map.prototype.find` method // https://github.com/tc39/proposal-collection-methods -$$1G({ target: 'Map', proto: true, real: true, forced: true }, { +$$1H({ target: 'Map', proto: true, real: true, forced: true }, { find: function find(callbackfn /* , thisArg */) { var map = aMap$9(this); var boundFunction = bind$c(callbackfn, arguments.length > 1 ? arguments[1] : undefined); @@ -15088,14 +15162,14 @@ $$1G({ target: 'Map', proto: true, real: true, forced: true }, { } }); -var $$1F = _export; +var $$1G = _export; var bind$b = functionBindContext; var aMap$8 = aMap$e; var iterate$m = mapIterate; // `Map.prototype.findKey` method // https://github.com/tc39/proposal-collection-methods -$$1F({ target: 'Map', proto: true, real: true, forced: true }, { +$$1G({ target: 'Map', proto: true, real: true, forced: true }, { findKey: function findKey(callbackfn /* , thisArg */) { var map = aMap$8(this); var boundFunction = bind$b(callbackfn, arguments.length > 1 ? arguments[1] : undefined); @@ -15137,17 +15211,17 @@ var collectionFrom = function from(source /* , mapFn, thisArg */) { return new this(array); }; -var $$1E = _export; +var $$1F = _export; var from$3 = collectionFrom; // `Map.from` method // https://tc39.github.io/proposal-setmap-offrom/#sec-map.from -$$1E({ target: 'Map', stat: true, forced: true }, { +$$1F({ target: 'Map', stat: true, forced: true }, { from: from$3 }); -var $$1D = _export; -var uncurryThis$o = functionUncurryThis; +var $$1E = _export; +var uncurryThis$p = functionUncurryThis; var aCallable$9 = aCallable$N; var requireObjectCoercible$3 = requireObjectCoercible$p; var iterate$k = iterate$G; @@ -15158,11 +15232,11 @@ var Map$6 = MapHelpers$4.Map; var has$a = MapHelpers$4.has; var get$2 = MapHelpers$4.get; var set$5 = MapHelpers$4.set; -var push$9 = uncurryThis$o([].push); +var push$9 = uncurryThis$p([].push); // `Map.groupBy` method // https://github.com/tc39/proposal-array-grouping -$$1D({ target: 'Map', stat: true, forced: IS_PURE$1 }, { +$$1E({ target: 'Map', stat: true, forced: IS_PURE$1 }, { groupBy: function groupBy(items, callbackfn) { requireObjectCoercible$3(items); aCallable$9(callbackfn); @@ -15184,14 +15258,14 @@ var sameValueZero$1 = function (x, y) { return x === y || x !== x && y !== y; }; -var $$1C = _export; +var $$1D = _export; var sameValueZero = sameValueZero$1; var aMap$7 = aMap$e; var iterate$j = mapIterate; // `Map.prototype.includes` method // https://github.com/tc39/proposal-collection-methods -$$1C({ target: 'Map', proto: true, real: true, forced: true }, { +$$1D({ target: 'Map', proto: true, real: true, forced: true }, { includes: function includes(searchElement) { return iterate$j(aMap$7(this), function (value) { if (sameValueZero(value, searchElement)) return true; @@ -15199,18 +15273,18 @@ $$1C({ target: 'Map', proto: true, real: true, forced: true }, { } }); -var $$1B = _export; +var $$1C = _export; var call$f = functionCall; var iterate$i = iterate$G; -var isCallable$8 = isCallable$K; +var isCallable$7 = isCallable$J; var aCallable$8 = aCallable$N; var Map$5 = mapHelpers.Map; // `Map.keyBy` method // https://github.com/tc39/proposal-collection-methods -$$1B({ target: 'Map', stat: true, forced: true }, { +$$1C({ target: 'Map', stat: true, forced: true }, { keyBy: function keyBy(iterable, keyDerivative) { - var C = isCallable$8(this) ? this : Map$5; + var C = isCallable$7(this) ? this : Map$5; var newMap = new C(); aCallable$8(keyDerivative); var setter = aCallable$8(newMap.set); @@ -15221,13 +15295,13 @@ $$1B({ target: 'Map', stat: true, forced: true }, { } }); -var $$1A = _export; +var $$1B = _export; var aMap$6 = aMap$e; var iterate$h = mapIterate; // `Map.prototype.keyOf` method // https://github.com/tc39/proposal-collection-methods -$$1A({ target: 'Map', proto: true, real: true, forced: true }, { +$$1B({ target: 'Map', proto: true, real: true, forced: true }, { keyOf: function keyOf(searchElement) { var result = iterate$h(aMap$6(this), function (value, key) { if (value === searchElement) return { key: key }; @@ -15236,7 +15310,7 @@ $$1A({ target: 'Map', proto: true, real: true, forced: true }, { } }); -var $$1z = _export; +var $$1A = _export; var bind$9 = functionBindContext; var aMap$5 = aMap$e; var MapHelpers$3 = mapHelpers; @@ -15247,7 +15321,7 @@ var set$4 = MapHelpers$3.set; // `Map.prototype.mapKeys` method // https://github.com/tc39/proposal-collection-methods -$$1z({ target: 'Map', proto: true, real: true, forced: true }, { +$$1A({ target: 'Map', proto: true, real: true, forced: true }, { mapKeys: function mapKeys(callbackfn /* , thisArg */) { var map = aMap$5(this); var boundFunction = bind$9(callbackfn, arguments.length > 1 ? arguments[1] : undefined); @@ -15259,7 +15333,7 @@ $$1z({ target: 'Map', proto: true, real: true, forced: true }, { } }); -var $$1y = _export; +var $$1z = _export; var bind$8 = functionBindContext; var aMap$4 = aMap$e; var MapHelpers$2 = mapHelpers; @@ -15270,7 +15344,7 @@ var set$3 = MapHelpers$2.set; // `Map.prototype.mapValues` method // https://github.com/tc39/proposal-collection-methods -$$1y({ target: 'Map', proto: true, real: true, forced: true }, { +$$1z({ target: 'Map', proto: true, real: true, forced: true }, { mapValues: function mapValues(callbackfn /* , thisArg */) { var map = aMap$4(this); var boundFunction = bind$8(callbackfn, arguments.length > 1 ? arguments[1] : undefined); @@ -15282,14 +15356,14 @@ $$1y({ target: 'Map', proto: true, real: true, forced: true }, { } }); -var $$1x = _export; +var $$1y = _export; var aMap$3 = aMap$e; var iterate$e = iterate$G; var set$2 = mapHelpers.set; // `Map.prototype.merge` method // https://github.com/tc39/proposal-collection-methods -$$1x({ target: 'Map', proto: true, real: true, arity: 1, forced: true }, { +$$1y({ target: 'Map', proto: true, real: true, arity: 1, forced: true }, { // eslint-disable-next-line no-unused-vars -- required for `.length` merge: function merge(iterable /* ...iterables */) { var map = aMap$3(this); @@ -15311,16 +15385,16 @@ var collectionOf = function of() { return new this(arraySlice$2(arguments)); }; -var $$1w = _export; +var $$1x = _export; var of$3 = collectionOf; // `Map.of` method // https://tc39.github.io/proposal-setmap-offrom/#sec-map.of -$$1w({ target: 'Map', stat: true, forced: true }, { +$$1x({ target: 'Map', stat: true, forced: true }, { of: of$3 }); -var $$1v = _export; +var $$1w = _export; var aCallable$7 = aCallable$N; var aMap$2 = aMap$e; var iterate$d = mapIterate; @@ -15329,7 +15403,7 @@ var $TypeError$9 = TypeError; // `Map.prototype.reduce` method // https://github.com/tc39/proposal-collection-methods -$$1v({ target: 'Map', proto: true, real: true, forced: true }, { +$$1w({ target: 'Map', proto: true, real: true, forced: true }, { reduce: function reduce(callbackfn /* , initialValue */) { var map = aMap$2(this); var noInitial = arguments.length < 2; @@ -15343,19 +15417,19 @@ $$1v({ target: 'Map', proto: true, real: true, forced: true }, { accumulator = callbackfn(accumulator, value, key, map); } }); - if (noInitial) throw $TypeError$9('Reduce of empty map with no initial value'); + if (noInitial) throw new $TypeError$9('Reduce of empty map with no initial value'); return accumulator; } }); -var $$1u = _export; +var $$1v = _export; var bind$7 = functionBindContext; var aMap$1 = aMap$e; var iterate$c = mapIterate; // `Map.prototype.some` method // https://github.com/tc39/proposal-collection-methods -$$1u({ target: 'Map', proto: true, real: true, forced: true }, { +$$1v({ target: 'Map', proto: true, real: true, forced: true }, { some: function some(callbackfn /* , thisArg */) { var map = aMap$1(this); var boundFunction = bind$7(callbackfn, arguments.length > 1 ? arguments[1] : undefined); @@ -15365,7 +15439,7 @@ $$1u({ target: 'Map', proto: true, real: true, forced: true }, { } }); -var $$1t = _export; +var $$1u = _export; var aCallable$6 = aCallable$N; var aMap = aMap$e; var MapHelpers$1 = mapHelpers; @@ -15377,14 +15451,14 @@ var set$1 = MapHelpers$1.set; // `Map.prototype.update` method // https://github.com/tc39/proposal-collection-methods -$$1t({ target: 'Map', proto: true, real: true, forced: true }, { +$$1u({ target: 'Map', proto: true, real: true, forced: true }, { update: function update(key, callback /* , thunk */) { var map = aMap(this); var length = arguments.length; aCallable$6(callback); var isPresentInMap = has$9(map, key); if (!isPresentInMap && length < 3) { - throw $TypeError$8('Updating absent value'); + throw new $TypeError$8('Updating absent value'); } var value = isPresentInMap ? get$1(map, key) : aCallable$6(length > 2 ? arguments[2] : undefined)(key, map); set$1(map, key, callback(value, key, map)); @@ -15394,7 +15468,7 @@ $$1t({ target: 'Map', proto: true, real: true, forced: true }, { var call$e = functionCall; var aCallable$5 = aCallable$N; -var isCallable$7 = isCallable$K; +var isCallable$6 = isCallable$J; var anObject$h = anObject$1f; var $TypeError$7 = TypeError; @@ -15408,69 +15482,69 @@ var mapUpsert = function upsert(key, updateFn /* , insertFn */) { var set = aCallable$5(map.set); var insertFn = arguments.length > 2 ? arguments[2] : undefined; var value; - if (!isCallable$7(updateFn) && !isCallable$7(insertFn)) { - throw $TypeError$7('At least one callback required'); + if (!isCallable$6(updateFn) && !isCallable$6(insertFn)) { + throw new $TypeError$7('At least one callback required'); } if (call$e(has, map, key)) { value = call$e(get, map, key); - if (isCallable$7(updateFn)) { + if (isCallable$6(updateFn)) { value = updateFn(value); call$e(set, map, key, value); } - } else if (isCallable$7(insertFn)) { + } else if (isCallable$6(insertFn)) { value = insertFn(); call$e(set, map, key, value); } return value; }; // TODO: remove from `core-js@4` -var $$1s = _export; +var $$1t = _export; var upsert$2 = mapUpsert; // `Map.prototype.updateOrInsert` method (replaced by `Map.prototype.emplace`) // https://github.com/thumbsupep/proposal-upsert -$$1s({ target: 'Map', proto: true, real: true, name: 'upsert', forced: true }, { +$$1t({ target: 'Map', proto: true, real: true, name: 'upsert', forced: true }, { updateOrInsert: upsert$2 }); // TODO: remove from `core-js@4` -var $$1r = _export; +var $$1s = _export; var upsert$1 = mapUpsert; // `Map.prototype.upsert` method (replaced by `Map.prototype.emplace`) // https://github.com/thumbsupep/proposal-upsert -$$1r({ target: 'Map', proto: true, real: true, forced: true }, { +$$1s({ target: 'Map', proto: true, real: true, forced: true }, { upsert: upsert$1 }); -var $$1q = _export; +var $$1r = _export; var min$2 = Math.min; var max$2 = Math.max; // `Math.clamp` method // https://rwaldron.github.io/proposal-math-extensions/ -$$1q({ target: 'Math', stat: true, forced: true }, { +$$1r({ target: 'Math', stat: true, forced: true }, { clamp: function clamp(x, lower, upper) { return min$2(upper, max$2(lower, x)); } }); -var $$1p = _export; +var $$1q = _export; // `Math.DEG_PER_RAD` constant // https://rwaldron.github.io/proposal-math-extensions/ -$$1p({ target: 'Math', stat: true, nonConfigurable: true, nonWritable: true }, { +$$1q({ target: 'Math', stat: true, nonConfigurable: true, nonWritable: true }, { DEG_PER_RAD: Math.PI / 180 }); -var $$1o = _export; +var $$1p = _export; var RAD_PER_DEG = 180 / Math.PI; // `Math.degrees` method // https://rwaldron.github.io/proposal-math-extensions/ -$$1o({ target: 'Math', stat: true, forced: true }, { +$$1p({ target: 'Math', stat: true, forced: true }, { degrees: function degrees(radians) { return radians * RAD_PER_DEG; } @@ -15490,41 +15564,32 @@ var mathScale = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) return (nx - nInLow) * (nOutHigh - nOutLow) / (nInHigh - nInLow) + nOutLow; }; -var $$1n = _export; +var $$1o = _export; var scale$1 = mathScale; var fround = mathFround; // `Math.fscale` method // https://rwaldron.github.io/proposal-math-extensions/ -$$1n({ target: 'Math', stat: true, forced: true }, { +$$1o({ target: 'Math', stat: true, forced: true }, { fscale: function fscale(x, inLow, inHigh, outLow, outHigh) { return fround(scale$1(x, inLow, inHigh, outLow, outHigh)); } }); -var $$1m = _export; -var IEEE754 = ieee754; - -var packIEEE754 = IEEE754.pack; -var unpackIEEE754 = IEEE754.unpack; -var $isFinite = isFinite; +var $$1n = _export; +var f16round = mathF16round; // `Math.f16round` method // https://github.com/tc39/proposal-float16array -$$1m({ target: 'Math', stat: true }, { - f16round: function f16round(x) { - var n = +x; - return $isFinite(n) && n !== 0 ? unpackIEEE754(packIEEE754(n, 10, 2), 10) : n; - } -}); +$$1n({ target: 'Math', stat: true }, { f16round: f16round }); -var $$1l = _export; +var $$1m = _export; // `Math.iaddh` method // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 // TODO: Remove from `core-js@4` -$$1l({ target: 'Math', stat: true, forced: true }, { +$$1m({ target: 'Math', stat: true, forced: true }, { iaddh: function iaddh(x0, x1, y0, y1) { var $x0 = x0 >>> 0; var $x1 = x1 >>> 0; @@ -15533,12 +15598,12 @@ $$1l({ target: 'Math', stat: true, forced: true }, { } }); -var $$1k = _export; +var $$1l = _export; // `Math.imulh` method // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 // TODO: Remove from `core-js@4` -$$1k({ target: 'Math', stat: true, forced: true }, { +$$1l({ target: 'Math', stat: true, forced: true }, { imulh: function imulh(u, v) { var UINT16 = 0xFFFF; var $u = +u; @@ -15552,12 +15617,12 @@ $$1k({ target: 'Math', stat: true, forced: true }, { } }); -var $$1j = _export; +var $$1k = _export; // `Math.isubh` method // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 // TODO: Remove from `core-js@4` -$$1j({ target: 'Math', stat: true, forced: true }, { +$$1k({ target: 'Math', stat: true, forced: true }, { isubh: function isubh(x0, x1, y0, y1) { var $x0 = x0 >>> 0; var $x1 = x1 >>> 0; @@ -15566,36 +15631,36 @@ $$1j({ target: 'Math', stat: true, forced: true }, { } }); -var $$1i = _export; +var $$1j = _export; // `Math.RAD_PER_DEG` constant // https://rwaldron.github.io/proposal-math-extensions/ -$$1i({ target: 'Math', stat: true, nonConfigurable: true, nonWritable: true }, { +$$1j({ target: 'Math', stat: true, nonConfigurable: true, nonWritable: true }, { RAD_PER_DEG: 180 / Math.PI }); -var $$1h = _export; +var $$1i = _export; var DEG_PER_RAD = Math.PI / 180; // `Math.radians` method // https://rwaldron.github.io/proposal-math-extensions/ -$$1h({ target: 'Math', stat: true, forced: true }, { +$$1i({ target: 'Math', stat: true, forced: true }, { radians: function radians(degrees) { return degrees * DEG_PER_RAD; } }); -var $$1g = _export; +var $$1h = _export; var scale = mathScale; // `Math.scale` method // https://rwaldron.github.io/proposal-math-extensions/ -$$1g({ target: 'Math', stat: true, forced: true }, { +$$1h({ target: 'Math', stat: true, forced: true }, { scale: scale }); -var $$1f = _export; +var $$1g = _export; var anObject$g = anObject$1f; var numberIsFinite = numberIsFinite$2; var createIteratorConstructor$3 = iteratorCreateConstructor; @@ -15623,19 +15688,19 @@ var $SeededRandomGenerator = createIteratorConstructor$3(function SeededRandomGe // `Math.seededPRNG` method // https://github.com/tc39/proposal-seeded-random // based on https://github.com/tc39/proposal-seeded-random/blob/78b8258835b57fc2100d076151ab506bc3202ae6/demo.html -$$1f({ target: 'Math', stat: true, forced: true }, { +$$1g({ target: 'Math', stat: true, forced: true }, { seededPRNG: function seededPRNG(it) { var seed = anObject$g(it).seed; - if (!numberIsFinite(seed)) throw $TypeError$6(SEED_TYPE_ERROR); + if (!numberIsFinite(seed)) throw new $TypeError$6(SEED_TYPE_ERROR); return new $SeededRandomGenerator(seed); } }); -var $$1e = _export; +var $$1f = _export; // `Math.signbit` method // https://github.com/tc39/proposal-Math.signbit -$$1e({ target: 'Math', stat: true, forced: true }, { +$$1f({ target: 'Math', stat: true, forced: true }, { signbit: function signbit(x) { var n = +x; // eslint-disable-next-line no-self-compare -- NaN check @@ -15643,12 +15708,12 @@ $$1e({ target: 'Math', stat: true, forced: true }, { } }); -var $$1d = _export; +var $$1e = _export; // `Math.umulh` method // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 // TODO: Remove from `core-js@4` -$$1d({ target: 'Math', stat: true, forced: true }, { +$$1e({ target: 'Math', stat: true, forced: true }, { umulh: function umulh(u, v) { var UINT16 = 0xFFFF; var $u = +u; @@ -15662,8 +15727,8 @@ $$1d({ target: 'Math', stat: true, forced: true }, { } }); -var $$1c = _export; -var uncurryThis$n = functionUncurryThis; +var $$1d = _export; +var uncurryThis$o = functionUncurryThis; var toIntegerOrInfinity$3 = toIntegerOrInfinity$p; var parseInt$2 = numberParseInt; @@ -15673,40 +15738,40 @@ var $RangeError$2 = RangeError; var $SyntaxError = SyntaxError; var $TypeError$5 = TypeError; var valid = /^[\da-z]+$/; -var charAt$8 = uncurryThis$n(''.charAt); -var exec$4 = uncurryThis$n(valid.exec); -var numberToString$1 = uncurryThis$n(1.0.toString); -var stringSlice$4 = uncurryThis$n(''.slice); +var charAt$8 = uncurryThis$o(''.charAt); +var exec$4 = uncurryThis$o(valid.exec); +var numberToString$1 = uncurryThis$o(1.0.toString); +var stringSlice$4 = uncurryThis$o(''.slice); // `Number.fromString` method // https://github.com/tc39/proposal-number-fromstring -$$1c({ target: 'Number', stat: true, forced: true }, { +$$1d({ target: 'Number', stat: true, forced: true }, { fromString: function fromString(string, radix) { var sign = 1; var R, mathNum; - if (typeof string != 'string') throw $TypeError$5(INVALID_NUMBER_REPRESENTATION); - if (!string.length) throw $SyntaxError(INVALID_NUMBER_REPRESENTATION); + if (typeof string != 'string') throw new $TypeError$5(INVALID_NUMBER_REPRESENTATION); + if (!string.length) throw new $SyntaxError(INVALID_NUMBER_REPRESENTATION); if (charAt$8(string, 0) === '-') { sign = -1; string = stringSlice$4(string, 1); - if (!string.length) throw $SyntaxError(INVALID_NUMBER_REPRESENTATION); + if (!string.length) throw new $SyntaxError(INVALID_NUMBER_REPRESENTATION); } R = radix === undefined ? 10 : toIntegerOrInfinity$3(radix); - if (R < 2 || R > 36) throw $RangeError$2(INVALID_RADIX); + if (R < 2 || R > 36) throw new $RangeError$2(INVALID_RADIX); if (!exec$4(valid, string) || numberToString$1(mathNum = parseInt$2(string, R), R) !== string) { - throw $SyntaxError(INVALID_NUMBER_REPRESENTATION); + throw new $SyntaxError(INVALID_NUMBER_REPRESENTATION); } return sign * mathNum; } }); -var $$1b = _export; +var $$1c = _export; var NumericRangeIterator = numericRangeIterator; // `Number.range` method // https://github.com/tc39/proposal-Number.range // TODO: Remove from `core-js@4` -$$1b({ target: 'Number', stat: true, forced: true }, { +$$1c({ target: 'Number', stat: true, forced: true }, { range: function range(start, end, option) { return new NumericRangeIterator(start, end, option, 'number', 0, 1); } @@ -15751,55 +15816,55 @@ var objectIterator = createIteratorConstructor$2(function ObjectIterator(source, }); // TODO: Remove from `core-js@4` -var $$1a = _export; +var $$1b = _export; var ObjectIterator$2 = objectIterator; // `Object.iterateEntries` method // https://github.com/tc39/proposal-object-iteration -$$1a({ target: 'Object', stat: true, forced: true }, { +$$1b({ target: 'Object', stat: true, forced: true }, { iterateEntries: function iterateEntries(object) { return new ObjectIterator$2(object, 'entries'); } }); // TODO: Remove from `core-js@4` -var $$19 = _export; +var $$1a = _export; var ObjectIterator$1 = objectIterator; // `Object.iterateKeys` method // https://github.com/tc39/proposal-object-iteration -$$19({ target: 'Object', stat: true, forced: true }, { +$$1a({ target: 'Object', stat: true, forced: true }, { iterateKeys: function iterateKeys(object) { return new ObjectIterator$1(object, 'keys'); } }); // TODO: Remove from `core-js@4` -var $$18 = _export; +var $$19 = _export; var ObjectIterator = objectIterator; // `Object.iterateValues` method // https://github.com/tc39/proposal-object-iteration -$$18({ target: 'Object', stat: true, forced: true }, { +$$19({ target: 'Object', stat: true, forced: true }, { iterateValues: function iterateValues(object) { return new ObjectIterator(object, 'values'); } }); -var $$17 = _export; +var $$18 = _export; var getBuiltIn$g = getBuiltIn$M; -var uncurryThis$m = functionUncurryThis; +var uncurryThis$n = functionUncurryThis; var aCallable$4 = aCallable$N; var requireObjectCoercible$2 = requireObjectCoercible$p; var toPropertyKey = toPropertyKey$a; var iterate$b = iterate$G; var create$2 = getBuiltIn$g('Object', 'create'); -var push$8 = uncurryThis$m([].push); +var push$8 = uncurryThis$n([].push); // `Object.groupBy` method // https://github.com/tc39/proposal-array-grouping -$$17({ target: 'Object', stat: true }, { +$$18({ target: 'Object', stat: true }, { groupBy: function groupBy(items, callbackfn) { requireObjectCoercible$2(items); aCallable$4(callbackfn); @@ -15816,29 +15881,15 @@ $$17({ target: 'Object', stat: true }, { } }); -var global$i = global$16; -var isCallable$6 = isCallable$K; -var wellKnownSymbol$7 = wellKnownSymbol$T; - -var $$OBSERVABLE$2 = wellKnownSymbol$7('observable'); -var NativeObservable = global$i.Observable; -var NativeObservablePrototype = NativeObservable && NativeObservable.prototype; - -var observableForced = !isCallable$6(NativeObservable) - || !isCallable$6(NativeObservable.from) - || !isCallable$6(NativeObservable.of) - || !isCallable$6(NativeObservablePrototype.subscribe) - || !isCallable$6(NativeObservablePrototype[$$OBSERVABLE$2]); - // https://github.com/tc39/proposal-observable -var $$16 = _export; +var $$17 = _export; var call$d = functionCall; var DESCRIPTORS$7 = descriptors; var setSpecies = setSpecies$7; var aCallable$3 = aCallable$N; var anObject$f = anObject$1f; var anInstance$4 = anInstance$f; -var isCallable$5 = isCallable$K; +var isCallable$5 = isCallable$J; var isNullOrUndefined$2 = isNullOrUndefined$k; var isObject$3 = isObject$K; var getMethod$1 = getMethod$l; @@ -15846,9 +15897,8 @@ var defineBuiltIn$5 = defineBuiltIn$u; var defineBuiltIns$1 = defineBuiltIns$b; var defineBuiltInAccessor$5 = defineBuiltInAccessor$o; var hostReportErrors = hostReportErrors$2; -var wellKnownSymbol$6 = wellKnownSymbol$T; +var wellKnownSymbol$6 = wellKnownSymbol$S; var InternalStateModule$4 = internalState; -var OBSERVABLE_FORCED$2 = observableForced; var $$OBSERVABLE$1 = wellKnownSymbol$6('observable'); var OBSERVABLE = 'Observable'; @@ -16012,13 +16062,13 @@ defineBuiltIns$1(ObservablePrototype, { defineBuiltIn$5(ObservablePrototype, $$OBSERVABLE$1, function () { return this; }); -$$16({ global: true, constructor: true, forced: OBSERVABLE_FORCED$2 }, { +$$17({ global: true, constructor: true, forced: true }, { Observable: $Observable }); setSpecies(OBSERVABLE); -var $$15 = _export; +var $$16 = _export; var getBuiltIn$f = getBuiltIn$M; var call$c = functionCall; var anObject$e = anObject$1f; @@ -16026,14 +16076,13 @@ var isConstructor$2 = isConstructor$a; var getIterator$1 = getIterator$7; var getMethod = getMethod$l; var iterate$a = iterate$G; -var wellKnownSymbol$5 = wellKnownSymbol$T; -var OBSERVABLE_FORCED$1 = observableForced; +var wellKnownSymbol$5 = wellKnownSymbol$S; var $$OBSERVABLE = wellKnownSymbol$5('observable'); // `Observable.from` method // https://github.com/tc39/proposal-observable -$$15({ target: 'Observable', stat: true, forced: OBSERVABLE_FORCED$1 }, { +$$16({ target: 'Observable', stat: true, forced: true }, { from: function from(x) { var C = isConstructor$2(this) ? this : getBuiltIn$f('Observable'); var observableMethod = getMethod(anObject$e(x), $$OBSERVABLE); @@ -16054,16 +16103,15 @@ $$15({ target: 'Observable', stat: true, forced: OBSERVABLE_FORCED$1 }, { } }); -var $$14 = _export; +var $$15 = _export; var getBuiltIn$e = getBuiltIn$M; var isConstructor$1 = isConstructor$a; -var OBSERVABLE_FORCED = observableForced; var Array$2 = getBuiltIn$e('Array'); // `Observable.of` method // https://github.com/tc39/proposal-observable -$$14({ target: 'Observable', stat: true, forced: OBSERVABLE_FORCED }, { +$$15({ target: 'Observable', stat: true, forced: true }, { of: function of() { var C = isConstructor$1(this) ? this : getBuiltIn$e('Observable'); var length = arguments.length; @@ -16080,13 +16128,13 @@ $$14({ target: 'Observable', stat: true, forced: OBSERVABLE_FORCED }, { }); // TODO: Remove from `core-js@4` -var $$13 = _export; +var $$14 = _export; var newPromiseCapabilityModule$1 = newPromiseCapability$2; var perform = perform$7; // `Promise.try` method // https://github.com/tc39/proposal-promise-try -$$13({ target: 'Promise', stat: true, forced: true }, { +$$14({ target: 'Promise', stat: true, forced: true }, { 'try': function (callbackfn) { var promiseCapability = newPromiseCapabilityModule$1.f(this); var result = perform(callbackfn); @@ -16095,12 +16143,12 @@ $$13({ target: 'Promise', stat: true, forced: true }, { } }); -var $$12 = _export; +var $$13 = _export; var newPromiseCapabilityModule = newPromiseCapability$2; // `Promise.withResolvers` method // https://github.com/tc39/proposal-promise-with-resolvers -$$12({ target: 'Promise', stat: true }, { +$$13({ target: 'Promise', stat: true }, { withResolvers: function withResolvers() { var promiseCapability = newPromiseCapabilityModule.f(this); return { @@ -16115,12 +16163,12 @@ $$12({ target: 'Promise', stat: true }, { var getBuiltIn$d = getBuiltIn$M; -var uncurryThis$l = functionUncurryThis; +var uncurryThis$m = functionUncurryThis; var shared$2 = sharedExports; var Map$2 = getBuiltIn$d('Map'); var WeakMap$2 = getBuiltIn$d('WeakMap'); -var push$7 = uncurryThis$l([].push); +var push$7 = uncurryThis$m([].push); var metadata = shared$2('metadata'); var store$1 = metadata.store || (metadata.store = new WeakMap$2()); @@ -16174,7 +16222,7 @@ var reflectMetadata = { }; // TODO: Remove from `core-js@4` -var $$11 = _export; +var $$12 = _export; var ReflectMetadataModule$8 = reflectMetadata; var anObject$d = anObject$1f; @@ -16183,14 +16231,14 @@ var ordinaryDefineOwnMetadata$1 = ReflectMetadataModule$8.set; // `Reflect.defineMetadata` method // https://github.com/rbuckton/reflect-metadata -$$11({ target: 'Reflect', stat: true }, { +$$12({ target: 'Reflect', stat: true }, { defineMetadata: function defineMetadata(metadataKey, metadataValue, target /* , targetKey */) { var targetKey = arguments.length < 4 ? undefined : toMetadataKey$8(arguments[3]); ordinaryDefineOwnMetadata$1(metadataKey, metadataValue, anObject$d(target), targetKey); } }); -var $$10 = _export; +var $$11 = _export; var ReflectMetadataModule$7 = reflectMetadata; var anObject$c = anObject$1f; @@ -16200,7 +16248,7 @@ var store = ReflectMetadataModule$7.store; // `Reflect.deleteMetadata` method // https://github.com/rbuckton/reflect-metadata -$$10({ target: 'Reflect', stat: true }, { +$$11({ target: 'Reflect', stat: true }, { deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) { var targetKey = arguments.length < 3 ? undefined : toMetadataKey$7(arguments[2]); var metadataMap = getOrCreateMetadataMap(anObject$c(target), targetKey, false); @@ -16213,7 +16261,7 @@ $$10({ target: 'Reflect', stat: true }, { }); // TODO: Remove from `core-js@4` -var $$$ = _export; +var $$10 = _export; var ReflectMetadataModule$6 = reflectMetadata; var anObject$b = anObject$1f; var getPrototypeOf$2 = objectGetPrototypeOf$2; @@ -16231,7 +16279,7 @@ var ordinaryGetMetadata = function (MetadataKey, O, P) { // `Reflect.getMetadata` method // https://github.com/rbuckton/reflect-metadata -$$$({ target: 'Reflect', stat: true }, { +$$10({ target: 'Reflect', stat: true }, { getMetadata: function getMetadata(metadataKey, target /* , targetKey */) { var targetKey = arguments.length < 3 ? undefined : toMetadataKey$6(arguments[2]); return ordinaryGetMetadata(metadataKey, anObject$b(target), targetKey); @@ -16239,15 +16287,15 @@ $$$({ target: 'Reflect', stat: true }, { }); // TODO: Remove from `core-js@4` -var $$_ = _export; -var uncurryThis$k = functionUncurryThis; +var $$$ = _export; +var uncurryThis$l = functionUncurryThis; var ReflectMetadataModule$5 = reflectMetadata; var anObject$a = anObject$1f; var getPrototypeOf$1 = objectGetPrototypeOf$2; var $arrayUniqueBy$1 = arrayUniqueBy$2; -var arrayUniqueBy$1 = uncurryThis$k($arrayUniqueBy$1); -var concat = uncurryThis$k([].concat); +var arrayUniqueBy$1 = uncurryThis$l($arrayUniqueBy$1); +var concat = uncurryThis$l([].concat); var ordinaryOwnMetadataKeys$1 = ReflectMetadataModule$5.keys; var toMetadataKey$5 = ReflectMetadataModule$5.toKey; @@ -16261,7 +16309,7 @@ var ordinaryMetadataKeys = function (O, P) { // `Reflect.getMetadataKeys` method // https://github.com/rbuckton/reflect-metadata -$$_({ target: 'Reflect', stat: true }, { +$$$({ target: 'Reflect', stat: true }, { getMetadataKeys: function getMetadataKeys(target /* , targetKey */) { var targetKey = arguments.length < 2 ? undefined : toMetadataKey$5(arguments[1]); return ordinaryMetadataKeys(anObject$a(target), targetKey); @@ -16269,7 +16317,7 @@ $$_({ target: 'Reflect', stat: true }, { }); // TODO: Remove from `core-js@4` -var $$Z = _export; +var $$_ = _export; var ReflectMetadataModule$4 = reflectMetadata; var anObject$9 = anObject$1f; @@ -16278,7 +16326,7 @@ var toMetadataKey$4 = ReflectMetadataModule$4.toKey; // `Reflect.getOwnMetadata` method // https://github.com/rbuckton/reflect-metadata -$$Z({ target: 'Reflect', stat: true }, { +$$_({ target: 'Reflect', stat: true }, { getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) { var targetKey = arguments.length < 3 ? undefined : toMetadataKey$4(arguments[2]); return ordinaryGetOwnMetadata(metadataKey, anObject$9(target), targetKey); @@ -16286,7 +16334,7 @@ $$Z({ target: 'Reflect', stat: true }, { }); // TODO: Remove from `core-js@4` -var $$Y = _export; +var $$Z = _export; var ReflectMetadataModule$3 = reflectMetadata; var anObject$8 = anObject$1f; @@ -16295,7 +16343,7 @@ var toMetadataKey$3 = ReflectMetadataModule$3.toKey; // `Reflect.getOwnMetadataKeys` method // https://github.com/rbuckton/reflect-metadata -$$Y({ target: 'Reflect', stat: true }, { +$$Z({ target: 'Reflect', stat: true }, { getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) { var targetKey = arguments.length < 2 ? undefined : toMetadataKey$3(arguments[1]); return ordinaryOwnMetadataKeys(anObject$8(target), targetKey); @@ -16303,7 +16351,7 @@ $$Y({ target: 'Reflect', stat: true }, { }); // TODO: Remove from `core-js@4` -var $$X = _export; +var $$Y = _export; var ReflectMetadataModule$2 = reflectMetadata; var anObject$7 = anObject$1f; var getPrototypeOf = objectGetPrototypeOf$2; @@ -16320,7 +16368,7 @@ var ordinaryHasMetadata = function (MetadataKey, O, P) { // `Reflect.hasMetadata` method // https://github.com/rbuckton/reflect-metadata -$$X({ target: 'Reflect', stat: true }, { +$$Y({ target: 'Reflect', stat: true }, { hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) { var targetKey = arguments.length < 3 ? undefined : toMetadataKey$2(arguments[2]); return ordinaryHasMetadata(metadataKey, anObject$7(target), targetKey); @@ -16328,7 +16376,7 @@ $$X({ target: 'Reflect', stat: true }, { }); // TODO: Remove from `core-js@4` -var $$W = _export; +var $$X = _export; var ReflectMetadataModule$1 = reflectMetadata; var anObject$6 = anObject$1f; @@ -16337,14 +16385,14 @@ var toMetadataKey$1 = ReflectMetadataModule$1.toKey; // `Reflect.hasOwnMetadata` method // https://github.com/rbuckton/reflect-metadata -$$W({ target: 'Reflect', stat: true }, { +$$X({ target: 'Reflect', stat: true }, { hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) { var targetKey = arguments.length < 3 ? undefined : toMetadataKey$1(arguments[2]); return ordinaryHasOwnMetadata(metadataKey, anObject$6(target), targetKey); } }); -var $$V = _export; +var $$W = _export; var ReflectMetadataModule = reflectMetadata; var anObject$5 = anObject$1f; @@ -16353,7 +16401,7 @@ var ordinaryDefineOwnMetadata = ReflectMetadataModule.set; // `Reflect.metadata` method // https://github.com/rbuckton/reflect-metadata -$$V({ target: 'Reflect', stat: true }, { +$$W({ target: 'Reflect', stat: true }, { metadata: function metadata(metadataKey, metadataValue) { return function decorator(target, key) { ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject$5(target), toMetadataKey(key)); @@ -16361,6 +16409,26 @@ $$V({ target: 'Reflect', stat: true }, { } }); +var $$V = _export; +var uncurryThis$k = functionUncurryThis; +var toString$9 = toString$J; +var WHITESPACES = whitespaces$6; + +var charCodeAt$3 = uncurryThis$k(''.charCodeAt); +var replace$4 = uncurryThis$k(''.replace); +var NEED_ESCAPING = RegExp('[!"#$%&\'()*+,\\-./:;<=>?@[\\\\\\]^`{|}~' + WHITESPACES + ']', 'g'); + +// `RegExp.escape` method +// https://github.com/tc39/proposal-regex-escaping +$$V({ target: 'RegExp', stat: true, forced: true }, { + escape: function escape(S) { + var str = toString$9(S); + var firstCode = charCodeAt$3(str, 0); + // escape first DecimalDigit + return (firstCode > 47 && firstCode < 58 ? '\\x3' : '') + replace$4(str, NEED_ESCAPING, '\\$&'); + } +}); + var uncurryThis$j = functionUncurryThis; // eslint-disable-next-line es/no-set -- safe @@ -16485,9 +16553,9 @@ var getSetRecord$7 = function (obj) { var numSize = +obj.size; // NOTE: If size is undefined, then numSize will be NaN // eslint-disable-next-line no-self-compare -- NaN check - if (numSize !== numSize) throw $TypeError$4(INVALID_SIZE); + if (numSize !== numSize) throw new $TypeError$4(INVALID_SIZE); var intSize = toIntegerOrInfinity$2(numSize); - if (intSize < 0) throw $RangeError$1(INVALID_SIZE); + if (intSize < 0) throw new $RangeError$1(INVALID_SIZE); return new SetRecord( obj, max$1(intSize, 0), @@ -16570,7 +16638,7 @@ $$S({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$6( var classof$2 = classof$q; var hasOwn$6 = hasOwnProperty_1; var isNullOrUndefined$1 = isNullOrUndefined$k; -var wellKnownSymbol$4 = wellKnownSymbol$T; +var wellKnownSymbol$4 = wellKnownSymbol$S; var Iterators = iterators; var ITERATOR$3 = wellKnownSymbol$4('iterator'); @@ -16585,7 +16653,7 @@ var isIterable$1 = function (it) { }; var getBuiltIn$b = getBuiltIn$M; -var isCallable$4 = isCallable$K; +var isCallable$4 = isCallable$J; var isIterable = isIterable$1; var isObject$2 = isObject$K; @@ -16879,7 +16947,7 @@ var $$E = _export; var uncurryThis$h = functionUncurryThis; var aSet$5 = aSet$g; var iterate$4 = setIterate; -var toString$8 = toString$I; +var toString$8 = toString$J; var arrayJoin = uncurryThis$h([].join); var push$6 = uncurryThis$h([].push); @@ -16953,7 +17021,7 @@ $$B({ target: 'Set', proto: true, real: true, forced: true }, { accumulator = callbackfn(accumulator, value, value, set); } }); - if (noInitial) throw $TypeError$3('Reduce of empty set with no initial value'); + if (noInitial) throw new $TypeError$3('Reduce of empty set with no initial value'); return accumulator; } }); @@ -17069,7 +17137,7 @@ var $$v = _export; var charAt$7 = stringMultibyte.charAt; var requireObjectCoercible$1 = requireObjectCoercible$p; var toIntegerOrInfinity$1 = toIntegerOrInfinity$p; -var toString$7 = toString$I; +var toString$7 = toString$J; // `String.prototype.at` method // https://github.com/mathiasbynens/String.prototype.at @@ -17085,7 +17153,7 @@ $$v({ target: 'String', proto: true, forced: true }, { var uncurryThis$g = functionUncurryThis; var toIndexedObject = toIndexedObject$k; -var toString$6 = toString$I; +var toString$6 = toString$J; var lengthOfArrayLike$3 = lengthOfArrayLike$C; var $TypeError$2 = TypeError; @@ -17103,7 +17171,7 @@ var stringCooked = function cooked(template /* , ...substitutions */) { var i = 0; while (true) { var nextVal = cookedTemplate[i++]; - if (nextVal === undefined) throw $TypeError$2('Incorrect template'); + if (nextVal === undefined) throw new $TypeError$2('Incorrect template'); push$5(elements, toString$6(nextVal)); if (i === literalSegments) return join$3(elements, ''); if (i < argumentsLength) push$5(elements, toString$6(arguments[i])); @@ -17123,7 +17191,7 @@ var $$t = _export; var createIteratorConstructor$1 = iteratorCreateConstructor; var createIterResultObject = createIterResultObject$g; var requireObjectCoercible = requireObjectCoercible$p; -var toString$5 = toString$I; +var toString$5 = toString$J; var InternalStateModule$3 = internalState; var StringMultibyteModule = stringMultibyte; @@ -17287,7 +17355,7 @@ var uncurryThis$e = functionUncurryThis; var apply$1 = functionApply$1; var anObject$3 = anObject$1f; var toObject = toObject$D; -var isCallable$3 = isCallable$K; +var isCallable$3 = isCallable$J; var lengthOfArrayLike$2 = lengthOfArrayLike$C; var defineProperty$5 = objectDefineProperty.f; var createArrayFromList = arraySliceSimple; @@ -17326,7 +17394,7 @@ var INVALID_CLOSING_LINE = 'Invalid closing line'; var dedentTemplateStringsArray = function (template) { var rawInput = template.raw; // https://github.com/tc39/proposal-string-dedent/issues/75 - if (FREEZING && !isFrozen(rawInput)) throw $TypeError$1('Raw template should be frozen'); + if (FREEZING && !isFrozen(rawInput)) throw new $TypeError$1('Raw template should be frozen'); if (globalDedentRegistry.has(rawInput)) return globalDedentRegistry.get(rawInput); var raw = dedentStringsArray(rawInput); var cookedArr = cookStrings(raw); @@ -17346,12 +17414,12 @@ var dedentStringsArray = function (template) { var i = 0; var lines, common, quasi, k; - if (!length) throw $TypeError$1(INVALID_TAG); + if (!length) throw new $TypeError$1(INVALID_TAG); for (; i < length; i++) { var element = t[i]; if (typeof element == 'string') blocks[i] = split$3(element, NEW_LINE); - else throw $TypeError$1(INVALID_TAG); + else throw new $TypeError$1(INVALID_TAG); } for (i = 0; i < length; i++) { @@ -17359,13 +17427,13 @@ var dedentStringsArray = function (template) { lines = blocks[i]; if (i === 0) { if (lines.length === 1 || lines[0].length > 0) { - throw $TypeError$1(INVALID_OPENING_LINE); + throw new $TypeError$1(INVALID_OPENING_LINE); } lines[1] = ''; } if (lastSplit) { if (lines.length === 1 || exec$3(NON_WHITESPACE, lines[lines.length - 1])) { - throw $TypeError$1(INVALID_CLOSING_LINE); + throw new $TypeError$1(INVALID_CLOSING_LINE); } lines[lines.length - 2] = ''; lines[lines.length - 1] = ''; @@ -17516,7 +17584,7 @@ var shared = sharedExports; var getBuiltIn$7 = getBuiltIn$M; var uncurryThis$c = functionUncurryThis; var isSymbol$1 = isSymbol$8; -var wellKnownSymbol$3 = wellKnownSymbol$T; +var wellKnownSymbol$3 = wellKnownSymbol$S; var Symbol$1 = getBuiltIn$7('Symbol'); var $isWellKnownSymbol = Symbol$1.isWellKnownSymbol; @@ -17941,7 +18009,7 @@ var getBuiltIn$5 = getBuiltIn$M; var uncurryThis$8 = functionUncurryThis; var call$3 = functionCall; var fails$5 = fails$1u; -var toString$4 = toString$I; +var toString$4 = toString$J; var hasOwn$5 = hasOwnProperty_1; var validateArgumentsLength$9 = validateArgumentsLength$b; var ctoi = base64Map.ctoi; @@ -18003,7 +18071,7 @@ var getBuiltIn$4 = getBuiltIn$M; var uncurryThis$7 = functionUncurryThis; var call$2 = functionCall; var fails$4 = fails$1u; -var toString$3 = toString$I; +var toString$3 = toString$J; var validateArgumentsLength$8 = validateArgumentsLength$b; var itoc = base64Map.itoc; @@ -18116,7 +18184,7 @@ var DOMIterables = domIterables; var DOMTokenListPrototype = domTokenListPrototype; var ArrayIteratorMethods = es_array_iterator; var createNonEnumerableProperty$1 = createNonEnumerableProperty$k; -var wellKnownSymbol$2 = wellKnownSymbol$T; +var wellKnownSymbol$2 = wellKnownSymbol$S; var ITERATOR$2 = wellKnownSymbol$2('iterator'); var TO_STRING_TAG = wellKnownSymbol$2('toStringTag'); @@ -18150,15 +18218,6 @@ for (var COLLECTION_NAME in DOMIterables) { handlePrototype(DOMTokenListPrototype, 'DOMTokenList'); -var IS_NODE$1 = engineIsNode; - -var tryNodeRequire$1 = function (name) { - try { - // eslint-disable-next-line no-new-func -- safe - if (IS_NODE$1) return Function('return require("' + name + '")')(); - } catch (error) { /* empty */ } -}; - var domExceptionConstants = { IndexSizeError: { s: 'INDEX_SIZE_ERR', c: 1, m: 1 }, DOMStringSizeError: { s: 'DOMSTRING_SIZE_ERR', c: 2, m: 0 }, @@ -18188,7 +18247,7 @@ var domExceptionConstants = { }; var $$c = _export; -var tryNodeRequire = tryNodeRequire$1; +var tryNodeRequire = tryNodeRequire$2; var getBuiltIn$3 = getBuiltIn$M; var fails$3 = fails$1u; var create$1 = objectCreate$1; @@ -18224,7 +18283,7 @@ var NativeDOMExceptionPrototype = NativeDOMException$1 && NativeDOMException$1.p var ErrorPrototype = Error$3.prototype; var setInternalState$2 = InternalStateModule$2.set; var getInternalState = InternalStateModule$2.getterFor(DOM_EXCEPTION$2); -var HAS_STACK = 'stack' in Error$3(DOM_EXCEPTION$2); +var HAS_STACK = 'stack' in new Error$3(DOM_EXCEPTION$2); var codeFor = function (name) { return hasOwn$4(DOMExceptionConstants$1, name) && DOMExceptionConstants$1[name].m ? DOMExceptionConstants$1[name].c : 0; @@ -18248,7 +18307,7 @@ var $DOMException$1 = function DOMException() { this.code = code; } if (HAS_STACK) { - var error = Error$3(message); + var error = new Error$3(message); error.name = DOM_EXCEPTION$2; defineProperty$2(this, 'stack', createPropertyDescriptor$2(1, clearErrorStack$1(error.stack, 1))); } @@ -18354,7 +18413,7 @@ var $DOMException = function DOMException() { var message = normalizeStringArgument(argumentsLength < 1 ? undefined : arguments[0]); var name = normalizeStringArgument(argumentsLength < 2 ? undefined : arguments[1], 'Error'); var that = new NativeDOMException(message, name); - var error = Error$2(message); + var error = new Error$2(message); error.name = DOM_EXCEPTION$1; defineProperty$1(that, 'stack', createPropertyDescriptor$1(1, clearErrorStack(error.stack, 1))); inheritIfRequired(that, this, $DOMException); @@ -18363,7 +18422,7 @@ var $DOMException = function DOMException() { var DOMExceptionPrototype = $DOMException.prototype = NativeDOMException.prototype; -var ERROR_HAS_STACK = 'stack' in Error$2(DOM_EXCEPTION$1); +var ERROR_HAS_STACK = 'stack' in new Error$2(DOM_EXCEPTION$1); var DOM_EXCEPTION_HAS_STACK = 'stack' in new NativeDOMException(1, 2); // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe @@ -18421,7 +18480,7 @@ var engineIsBun = typeof Bun == 'function' && Bun && typeof Bun.version == 'stri var global$9 = global$16; var apply = functionApply$1; -var isCallable$2 = isCallable$K; +var isCallable$2 = isCallable$J; var ENGINE_IS_BUN = engineIsBun; var USER_AGENT = engineUserAgent; var arraySlice$1 = arraySlice$b; @@ -18508,7 +18567,7 @@ try { return global$6; }, set: function self(value) { - if (this !== global$6) throw $TypeError('Illegal invocation'); + if (this !== global$6) throw new $TypeError('Illegal invocation'); defineProperty(global$6, 'self', { value: value, writable: true, @@ -18531,7 +18590,7 @@ var getBuiltin = getBuiltIn$M; var uncurryThis$6 = functionUncurryThis; var fails$2 = fails$1u; var uid = uid$7; -var isCallable$1 = isCallable$K; +var isCallable$1 = isCallable$J; var isConstructor = isConstructor$a; var isNullOrUndefined = isNullOrUndefined$k; var isObject$1 = isObject$K; @@ -18547,8 +18606,9 @@ var validateArgumentsLength$5 = validateArgumentsLength$b; var getRegExpFlags = regexpGetFlags; var MapHelpers = mapHelpers; var SetHelpers = setHelpers; +var arrayBufferTransfer = arrayBufferTransfer$1; var ERROR_STACK_INSTALLABLE = errorStackInstallable; -var PROPER_TRANSFER = structuredCloneProperTransfer; +var PROPER_STRUCTURED_CLONE_TRANSFER = structuredCloneProperTransfer; var Object$1 = global$5.Object; var Array$1 = global$5.Array; @@ -18754,37 +18814,37 @@ var structuredCloneInternal = function (value, map, transferredBuffers) { name = value.name; switch (name) { case 'AggregateError': - cloned = getBuiltin('AggregateError')([]); + cloned = new (getBuiltin('AggregateError'))([]); break; case 'EvalError': - cloned = EvalError(); + cloned = new EvalError(); break; case 'RangeError': - cloned = RangeError$1(); + cloned = new RangeError$1(); break; case 'ReferenceError': - cloned = ReferenceError$1(); + cloned = new ReferenceError$1(); break; case 'SyntaxError': - cloned = SyntaxError$1(); + cloned = new SyntaxError$1(); break; case 'TypeError': - cloned = TypeError$3(); + cloned = new TypeError$3(); break; case 'URIError': - cloned = URIError(); + cloned = new URIError(); break; case 'CompileError': - cloned = CompileError(); + cloned = new CompileError(); break; case 'LinkError': - cloned = LinkError(); + cloned = new LinkError(); break; case 'RuntimeError': - cloned = RuntimeError(); + cloned = new RuntimeError(); break; default: - cloned = Error$1(); + cloned = new Error$1(); } break; case 'DOMException': @@ -19047,7 +19107,7 @@ var replacePlaceholders = function (value, map) { }; var tryToTransfer = function (rawTransfer, map) { - if (!isObject$1(rawTransfer)) throw TypeError$3('Transfer option cannot be converted to a sequence'); + if (!isObject$1(rawTransfer)) throw new TypeError$3('Transfer option cannot be converted to a sequence'); var transfer = []; @@ -19072,7 +19132,7 @@ var tryToTransfer = function (rawTransfer, map) { if (mapHas(map, value)) throw new DOMException('Duplicate transferable', DATA_CLONE_ERROR); - if (PROPER_TRANSFER) { + if (PROPER_STRUCTURED_CLONE_TRANSFER) { transferred = nativeStructuredClone(value, { transfer: [value] }); } else switch (type) { case 'ImageBitmap': @@ -19120,8 +19180,8 @@ var tryToTransferBuffers = function (transfer, map) { if (mapHas(map, value)) throw new DOMException('Duplicate transferable', DATA_CLONE_ERROR); - if (PROPER_TRANSFER) { - transferred = nativeStructuredClone(value, { transfer: [value] }); + if (arrayBufferTransfer) { + transferred = arrayBufferTransfer(value, undefined, true); } else { if (!isCallable$1(value.transfer)) throwUnpolyfillable('ArrayBuffer', TRANSFERRING); transferred = value.transfer(); @@ -19133,7 +19193,7 @@ var tryToTransferBuffers = function (transfer, map) { // `structuredClone` method // https://html.spec.whatwg.org/multipage/structured-data.html#dom-structuredclone -$$6({ global: true, enumerable: true, sham: !PROPER_TRANSFER, forced: FORCED_REPLACEMENT }, { +$$6({ global: true, enumerable: true, sham: !PROPER_STRUCTURED_CLONE_TRANSFER, forced: FORCED_REPLACEMENT }, { structuredClone: function structuredClone(value /* , { transfer } */) { var options = validateArgumentsLength$5(arguments.length, 1) > 1 && !isNullOrUndefined(arguments[1]) ? anObject$1(arguments[1]) : undefined; var transfer = options ? options.transfer : undefined; @@ -19185,7 +19245,7 @@ $$4({ global: true, bind: true, forced: global$3.setTimeout !== setTimeout$1 }, }); var fails$1 = fails$1u; -var wellKnownSymbol$1 = wellKnownSymbol$T; +var wellKnownSymbol$1 = wellKnownSymbol$S; var DESCRIPTORS$3 = descriptors; var IS_PURE = isPure; @@ -19358,7 +19418,7 @@ var encode = function (input) { // Increase `delta` enough to advance the decoder's state to , but guard against overflow. var handledCPCountPlusOne = handledCPCount + 1; if (m - n > floor$1((maxInt - delta) / handledCPCountPlusOne)) { - throw $RangeError(OVERFLOW_ERROR); + throw new $RangeError(OVERFLOW_ERROR); } delta += (m - n) * handledCPCountPlusOne; @@ -19367,7 +19427,7 @@ var encode = function (input) { for (i = 0; i < input.length; i++) { currentValue = input[i]; if (currentValue < n && ++delta > maxInt) { - throw $RangeError(OVERFLOW_ERROR); + throw new $RangeError(OVERFLOW_ERROR); } if (currentValue === n) { // Represent delta as a generalized variable-length integer. @@ -19422,19 +19482,19 @@ var setToStringTag$1 = setToStringTag$d; var createIteratorConstructor = iteratorCreateConstructor; var InternalStateModule$1 = internalState; var anInstance$1 = anInstance$f; -var isCallable = isCallable$K; +var isCallable = isCallable$J; var hasOwn$1 = hasOwnProperty_1; var bind$1 = functionBindContext; var classof = classof$q; var anObject = anObject$1f; var isObject = isObject$K; -var $toString$1 = toString$I; +var $toString$1 = toString$J; var create = objectCreate$1; var createPropertyDescriptor = createPropertyDescriptor$d; var getIterator = getIterator$7; var getIteratorMethod = getIteratorMethod$8; var validateArgumentsLength$4 = validateArgumentsLength$b; -var wellKnownSymbol = wellKnownSymbol$T; +var wellKnownSymbol = wellKnownSymbol$S; var arraySort = arraySort$1; var ITERATOR = wellKnownSymbol('iterator'); @@ -19564,7 +19624,7 @@ URLSearchParamsState.prototype = { (first = call$1(entryNext, entryIterator)).done || (second = call$1(entryNext, entryIterator)).done || !call$1(entryNext, entryIterator).done - ) throw TypeError$2('Expected sequence with length 2'); + ) throw new TypeError$2('Expected sequence with length 2'); push$2(this.entries, { key: $toString$1(first.value), value: $toString$1(second.value) }); } } else for (var key in object) if (hasOwn$1(object, key)) { @@ -19839,7 +19899,7 @@ var arrayFrom = arrayFrom$1; var arraySlice = arraySliceSimple; var codeAt = stringMultibyte.codeAt; var toASCII = stringPunycodeToAscii; -var $toString = toString$I; +var $toString = toString$J; var setToStringTag = setToStringTag$d; var validateArgumentsLength$3 = validateArgumentsLength$b; var URLSearchParamsModule = web_urlSearchParams_constructor; @@ -20143,12 +20203,12 @@ var URLState = function (url, isBase, base) { var baseState, failure, searchParams; if (isBase) { failure = this.parse(urlString); - if (failure) throw TypeError$1(failure); + if (failure) throw new TypeError$1(failure); this.searchParams = null; } else { if (base !== undefined) baseState = new URLState(base, true); failure = this.parse(urlString, null, baseState); - if (failure) throw TypeError$1(failure); + if (failure) throw new TypeError$1(failure); searchParams = getInternalSearchParamsState(new URLSearchParams$1()); searchParams.bindURL(this); this.searchParams = searchParams; @@ -20637,7 +20697,7 @@ URLState.prototype = { // https://url.spec.whatwg.org/#dom-url-href setHref: function (href) { var failure = this.parse(href); - if (failure) throw TypeError$1(failure); + if (failure) throw new TypeError$1(failure); this.searchParams.update(); }, // https://url.spec.whatwg.org/#dom-url-origin @@ -20874,7 +20934,7 @@ var $$1 = _export; var getBuiltIn = getBuiltIn$M; var fails = fails$1u; var validateArgumentsLength$2 = validateArgumentsLength$b; -var toString$2 = toString$I; +var toString$2 = toString$J; var USE_NATIVE_URL = urlConstructorDetection; var URL$1 = getBuiltIn('URL'); @@ -20913,7 +20973,7 @@ $({ target: 'URL', proto: true, enumerable: true }, { var defineBuiltIn$1 = defineBuiltIn$u; var uncurryThis$2 = functionUncurryThis; -var toString$1 = toString$I; +var toString$1 = toString$J; var validateArgumentsLength$1 = validateArgumentsLength$b; var $URLSearchParams$1 = URLSearchParams; @@ -20962,7 +21022,7 @@ if (params$1 + '' !== 'a=2') { var defineBuiltIn = defineBuiltIn$u; var uncurryThis$1 = functionUncurryThis; -var toString = toString$I; +var toString = toString$J; var validateArgumentsLength = validateArgumentsLength$b; var $URLSearchParams = URLSearchParams; diff --git a/test/function/samples/deprecations/externalImportAssertions/main.js b/test/function/samples/deprecations/externalImportAssertions/main.js index 38bfed638..025b60451 100644 --- a/test/function/samples/deprecations/externalImportAssertions/main.js +++ b/test/function/samples/deprecations/externalImportAssertions/main.js @@ -1,6 +1,6 @@ -import('external', { assert: { type: 'special' } }); -import(globalThis.unknown, { assert: { type: 'special' } }); -import(`external-${globalThis.unknown}`, { assert: { type: 'special' } }); -import('external' + globalThis.unknown, { assert: { type: 'special' } }); -import('external-resolved', { assert: { type: 'special' } }); -import('unresolved', { assert: { type: 'special' } }); +import('external', { with: { type: 'special' } }); +import(globalThis.unknown, { with: { type: 'special' } }); +import(`external-${globalThis.unknown}`, { with: { type: 'special' } }); +import('external' + globalThis.unknown, { with: { type: 'special' } }); +import('external-resolved', { with: { type: 'special' } }); +import('unresolved', { with: { type: 'special' } }); diff --git a/test/function/samples/import-assertions/warn-assertion-conflicts/_config.js b/test/function/samples/import-assertions/warn-assertion-conflicts/_config.js index 0b3503d14..2877a6665 100644 --- a/test/function/samples/import-assertions/warn-assertion-conflicts/_config.js +++ b/test/function/samples/import-assertions/warn-assertion-conflicts/_config.js @@ -11,11 +11,11 @@ module.exports = defineTest({ code: 'INCONSISTENT_IMPORT_ATTRIBUTES', frame: ` 1: import './other.js'; -2: import 'external' assert { type: 'foo' }; -3: import 'external' assert { type: 'bar' }; +2: import 'external' with { type: 'foo' }; +3: import 'external' with { type: 'bar' }; ^ 4: import 'external'; -5: import('external', { assert: { type: 'baz' } });`, +5: import('external', { with: { type: 'baz' } });`, id: ID_MAIN, loc: { column: 0, @@ -24,17 +24,17 @@ module.exports = defineTest({ }, message: 'Module "main.js" tried to import "external" with "type": "bar" attributes, but it was already imported elsewhere with "type": "foo" attributes. Please ensure that import attributes for the same module are always consistent.', - pos: 63 + pos: 61 }, { code: 'INCONSISTENT_IMPORT_ATTRIBUTES', frame: ` -2: import 'external' assert { type: 'foo' }; -3: import 'external' assert { type: 'bar' }; +2: import 'external' with { type: 'foo' }; +3: import 'external' with { type: 'bar' }; 4: import 'external'; ^ -5: import('external', { assert: { type: 'baz' } }); -6: import './dep.js' assert { type: 'foo' };`, +5: import('external', { with: { type: 'baz' } }); +6: import './dep.js' with { type: 'foo' };`, id: ID_MAIN, loc: { column: 0, @@ -43,7 +43,7 @@ module.exports = defineTest({ }, message: 'Module "main.js" tried to import "external" with no attributes, but it was already imported elsewhere with "type": "foo" attributes. Please ensure that import attributes for the same module are always consistent.', - pos: 105 + pos: 101 }, { code: 'INCONSISTENT_IMPORT_ATTRIBUTES', diff --git a/test/function/samples/import-assertions/warn-assertion-conflicts/main.js b/test/function/samples/import-assertions/warn-assertion-conflicts/main.js index 50f9cdb8b..21a4d427b 100644 --- a/test/function/samples/import-assertions/warn-assertion-conflicts/main.js +++ b/test/function/samples/import-assertions/warn-assertion-conflicts/main.js @@ -1,6 +1,6 @@ import './other.js'; -import 'external' assert { type: 'foo' }; -import 'external' assert { type: 'bar' }; +import 'external' with { type: 'foo' }; +import 'external' with { type: 'bar' }; import 'external'; -import('external', { assert: { type: 'baz' } }); -import './dep.js' assert { type: 'foo' }; +import('external', { with: { type: 'baz' } }); +import './dep.js' with { type: 'foo' }; diff --git a/test/function/samples/import-assertions/warn-assertion-conflicts/other.js b/test/function/samples/import-assertions/warn-assertion-conflicts/other.js index 779091a91..24533e1eb 100644 --- a/test/function/samples/import-assertions/warn-assertion-conflicts/other.js +++ b/test/function/samples/import-assertions/warn-assertion-conflicts/other.js @@ -1,2 +1,2 @@ -import 'external' assert { type: 'quuz' }; -import './dep.js' assert { type: 'bar' }; +import 'external' with { type: 'quuz' }; +import './dep.js' with { type: 'bar' }; From 4e8e5b40cf6eb1be278c9e2146c073db8ea603ec Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Thu, 5 Oct 2023 15:42:35 +0200 Subject: [PATCH 15/44] [v4.0] Expose parser (#5169) * Expose parser as separate API * Ensure key and value of a shorthand property have different references --- browser/package.json | 2 +- build-plugins/copy-types.ts | 3 +- docs/javascript-api/index.md | 33 ++++++ docs/plugin-development/index.md | 2 +- package-lock.json | 4 +- package.json | 7 +- rollup.config.ts | 2 + src/Bundle.ts | 3 +- src/Graph.ts | 12 -- src/Module.ts | 7 +- src/rollup/types.d.ts | 7 +- src/utils/PluginContext.ts | 3 +- src/utils/convert-ast.ts | 9 +- src/utils/logs.ts | 6 +- src/utils/parseAst.ts | 10 ++ src/utils/parseAstType.d.ts | 3 + .../samples/double-default-export/_config.js | 1 + .../samples/double-named-export/_config.js | 1 + .../samples/double-named-reexport/_config.js | 1 + .../samples/duplicate-import-fails/_config.js | 1 + .../_config.js | 1 + .../samples/error-parse-json/_config.js | 1 + .../error-parse-unknown-extension/_config.js | 1 + .../export-not-at-top-level-fails/_config.js | 1 + .../import-not-at-top-level-fails/_config.js | 1 + .../parse-return-outside-function/_config.js | 2 + .../samples/reassign-import-fails/_config.js | 1 + .../_config.js | 1 + .../_config.js | 1 + test/misc/index.js | 1 + test/misc/parse-ast.js | 111 ++++++++++++++++++ 31 files changed, 208 insertions(+), 31 deletions(-) create mode 100644 src/utils/parseAst.ts create mode 100644 src/utils/parseAstType.d.ts create mode 100644 test/misc/parse-ast.js diff --git a/browser/package.json b/browser/package.json index 7de0b3359..e0a4ed54e 100644 --- a/browser/package.json +++ b/browser/package.json @@ -1,6 +1,6 @@ { "name": "@rollup/browser", - "version": "4.0.0-24", + "version": "4.0.0-25", "description": "Next-generation ES module bundler browser build", "main": "dist/rollup.browser.js", "module": "dist/es/rollup.browser.js", diff --git a/build-plugins/copy-types.ts b/build-plugins/copy-types.ts index d979968e2..d68cfa349 100644 --- a/build-plugins/copy-types.ts +++ b/build-plugins/copy-types.ts @@ -33,6 +33,7 @@ export function copyNodeTypes(): Plugin[] { 'cli/run/loadConfigFileType.d.ts', '../../src/rollup/types' ), - copyRollupType('getLogFilter.d.ts', 'src/utils/getLogFilterType.d.ts', '../rollup/types') + copyRollupType('getLogFilter.d.ts', 'src/utils/getLogFilterType.d.ts', '../rollup/types'), + copyRollupType('parseAst.d.ts', 'src/utils/parseAstType.d.ts', '../rollup/types') ]; } diff --git a/docs/javascript-api/index.md b/docs/javascript-api/index.md index dee42b402..0b2e44ab2 100755 --- a/docs/javascript-api/index.md +++ b/docs/javascript-api/index.md @@ -336,3 +336,36 @@ export default { } }; ``` + +## Accessing the parser + +In order to parse arbitrary code using Rollup's parser, plugins can use [`this.parse`](../plugin-development/index.md#this-parse). To use this functionality outside the context of a Rollup build, the parser is also exposed as a separate export. It has the same signature as `this.parse`: + +```js +import { parseAst } from 'rollup/parseAst'; +import assert from 'node:assert'; + +assert.deepEqual( + parseAst('return 42;', { allowReturnOutsideFunction: true }), + { + type: 'Program', + start: 0, + end: 10, + body: [ + { + type: 'ReturnStatement', + start: 0, + end: 10, + argument: { + type: 'Literal', + start: 7, + end: 9, + raw: '42', + value: 42 + } + } + ], + sourceType: 'module' + } +); +``` diff --git a/docs/plugin-development/index.md b/docs/plugin-development/index.md index 53be2a707..a21a72933 100644 --- a/docs/plugin-development/index.md +++ b/docs/plugin-development/index.md @@ -1669,7 +1669,7 @@ interface ParseOptions { } ``` -Use Rollup's internal SWC-based parser to parse code to an AST. +Use Rollup's internal SWC-based parser to parse code to an [ESTree-compatible](https://github.com/estree/estree) AST. - `allowReturnOutsideFunction`: When `true` this allows return statements to be outside functions to e.g. support parsing CommonJS code. diff --git a/package-lock.json b/package-lock.json index 8a68e5b1f..920c1ea60 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rollup", - "version": "4.0.0-24", + "version": "4.0.0-25", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rollup", - "version": "4.0.0-24", + "version": "4.0.0-25", "license": "MIT", "bin": { "rollup": "dist/bin/rollup" diff --git a/package.json b/package.json index 8a2cc558b..903806468 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rollup", - "version": "4.0.0-24", + "version": "4.0.0-25", "description": "Next-generation ES module bundler", "main": "dist/rollup.js", "module": "dist/es/rollup.js", @@ -214,6 +214,11 @@ "require": "./dist/getLogFilter.js", "import": "./dist/es/getLogFilter.js" }, + "./parseAst": { + "types": "./dist/parseAst.d.ts", + "require": "./dist/parseAst.js", + "import": "./dist/es/parseAst.js" + }, "./dist/*": "./dist/*" } } diff --git a/rollup.config.ts b/rollup.config.ts index dae1d86f6..9fe4872bf 100644 --- a/rollup.config.ts +++ b/rollup.config.ts @@ -66,6 +66,7 @@ export default async function ( input: { 'getLogFilter.js': 'src/utils/getLogFilter.ts', 'loadConfigFile.js': 'cli/run/loadConfigFile.ts', + 'parseAst.js': 'src/utils/parseAst.ts', 'rollup.js': 'src/node-entry.ts' }, onwarn, @@ -112,6 +113,7 @@ export default async function ( ...commonJSBuild, input: { 'getLogFilter.js': 'src/utils/getLogFilter.ts', + 'parseAst.js': 'src/utils/parseAst.ts', 'rollup.js': 'src/node-entry.ts' }, output: { diff --git a/src/Bundle.ts b/src/Bundle.ts index 883af627b..32ae59271 100644 --- a/src/Bundle.ts +++ b/src/Bundle.ts @@ -26,6 +26,7 @@ import { } from './utils/logs'; import type { OutputBundleWithPlaceholders } from './utils/outputBundle'; import { getOutputBundle, removeUnreferencedAssets } from './utils/outputBundle'; +import { parseAst } from './utils/parseAst'; import { isAbsolute } from './utils/path'; import { renderChunks } from './utils/renderChunks'; import { timeEnd, timeStart } from './utils/timers'; @@ -150,7 +151,7 @@ export default class Bundle { for (const file of Object.values(bundle)) { if ('code' in file) { try { - this.graph.contextParse(file.code); + parseAst(file.code); } catch (error_: any) { this.inputOptions.onLog(LOGLEVEL_WARN, logChunkInvalid(file, error_)); } diff --git a/src/Graph.ts b/src/Graph.ts index a532c5227..10e8ef5e5 100644 --- a/src/Graph.ts +++ b/src/Graph.ts @@ -1,5 +1,4 @@ import flru from 'flru'; -import { parse } from '../native'; import type ExternalModule from './ExternalModule'; import Module from './Module'; import { ModuleLoader, type UnresolvedModule } from './ModuleLoader'; @@ -18,9 +17,7 @@ import type { import { PluginDriver } from './utils/PluginDriver'; import Queue from './utils/Queue'; import { BuildPhase } from './utils/buildPhase'; -import { convertProgram, type ProgramAst } from './utils/convert-ast'; import { analyseModuleExecution } from './utils/executionOrder'; -import getReadStringFunction from './utils/getReadStringFunction'; import { LOGLEVEL_WARN } from './utils/logging'; import { error, @@ -123,15 +120,6 @@ export default class Graph { this.phase = BuildPhase.GENERATE; } - contextParse( - code: string, - { allowReturnOutsideFunction = false }: { allowReturnOutsideFunction?: boolean } = {} - ): ProgramAst { - const astBuffer = parse(code, allowReturnOutsideFunction); - const readString = getReadStringFunction(astBuffer); - return convertProgram(astBuffer.buffer, readString); - } - getCache(): RollupCache { // handle plugin cache eviction for (const name in this.pluginCache) { diff --git a/src/Module.ts b/src/Module.ts index c1488c95e..5f9fbb42c 100644 --- a/src/Module.ts +++ b/src/Module.ts @@ -63,11 +63,12 @@ import { logInvalidFormatForTopLevelAwait, logInvalidSourcemapForError, logMissingExport, + logModuleParseError, logNamespaceConflict, - logParseError, logShimmedExport, logSyntheticNamedExportsNeedNamespaceExport } from './utils/logs'; +import { parseAst } from './utils/parseAst'; import { doAttributesDiffer, getAttributesFromImportExportDeclaration @@ -1328,9 +1329,9 @@ export default class Module { private tryParse(): ProgramAst { try { - return this.graph.contextParse(this.info.code!); + return parseAst(this.info.code!) as ProgramAst; } catch (error_: any) { - return this.error(logParseError(error_, this.id), error_.pos); + return this.error(logModuleParseError(error_, this.id), error_.pos); } } } diff --git a/src/rollup/types.d.ts b/src/rollup/types.d.ts index 907d1df32..d99306cd5 100644 --- a/src/rollup/types.d.ts +++ b/src/rollup/types.d.ts @@ -201,6 +201,11 @@ type LoggingFunctionWithPosition = ( pos?: number | { column: number; line: number } ) => void; +export type ParseAst = ( + input: string, + options?: { allowReturnOutsideFunction?: boolean } +) => AstNode; + export interface PluginContext extends MinimalPluginContext { addWatchFile: (id: string) => void; cache: PluginCache; @@ -215,7 +220,7 @@ export interface PluginContext extends MinimalPluginContext { load: ( options: { id: string; resolveDependencies?: boolean } & Partial> ) => Promise; - parse: (input: string, options?: { allowReturnOutsideFunction?: boolean }) => AstNode; + parse: ParseAst; resolve: ( source: string, importer?: string, diff --git a/src/utils/PluginContext.ts b/src/utils/PluginContext.ts index 88c62dbf6..a3ef169ce 100644 --- a/src/utils/PluginContext.ts +++ b/src/utils/PluginContext.ts @@ -15,6 +15,7 @@ import { getLogHandler } from './logHandler'; import { LOGLEVEL_DEBUG, LOGLEVEL_INFO, LOGLEVEL_WARN } from './logging'; import { error, logInvalidRollupPhaseForAddWatchFile, logPluginError } from './logs'; import { normalizeLog } from './options/options'; +import { parseAst } from './parseAst'; import { ANONYMOUS_OUTPUT_PLUGIN_PREFIX, ANONYMOUS_PLUGIN_PREFIX } from './pluginUtils'; export function getPluginContext( @@ -76,7 +77,7 @@ export function getPluginContext( rollupVersion, watchMode: graph.watchMode }, - parse: graph.contextParse.bind(graph), + parse: parseAst, resolve(source, importer, { attributes, custom, isEntry, skipSelf } = BLANK) { skipSelf ??= true; return graph.moduleLoader.resolveId( diff --git a/src/utils/convert-ast.ts b/src/utils/convert-ast.ts index eb33b6760..6be26053a 100644 --- a/src/utils/convert-ast.ts +++ b/src/utils/convert-ast.ts @@ -1,7 +1,7 @@ import type * as estree from 'estree'; import type { AstNode } from '../rollup/types'; import { FIXED_STRINGS } from './convert-ast-strings'; -import { error } from './logs'; +import { error, logParseError } from './logs'; type ReadString = (start: number, length: number) => string; @@ -862,7 +862,7 @@ const nodeConverters: ((position: number, buffer: Uint32Array, readString: ReadS kind, method, shorthand, - value: valuePosition ? convertNode(valuePosition, buffer, readString) : key + value: valuePosition ? convertNode(valuePosition, buffer, readString) : { ...key } }; }, // index:55; PropertyDefinition @@ -1156,10 +1156,7 @@ const nodeConverters: ((position: number, buffer: Uint32Array, readString: ReadS (position, buffer, readString): never => { const pos = buffer[position++]; const message = convertString(position, buffer, readString); - error({ - pos, - message - }); + error(logParseError(message, pos)); } ]; diff --git a/src/utils/logs.ts b/src/utils/logs.ts index 27dd4892b..8623674e5 100644 --- a/src/utils/logs.ts +++ b/src/utils/logs.ts @@ -809,7 +809,11 @@ export function logOptimizeChunkStatus( }; } -export function logParseError(error: Error, moduleId: string): RollupLog { +export function logParseError(message: string, pos: number): RollupLog { + return { code: PARSE_ERROR, message, pos }; +} + +export function logModuleParseError(error: Error, moduleId: string): RollupLog { let message = error.message.replace(/ \(\d+:\d+\)$/, ''); if (moduleId.endsWith('.json')) { message += ' (Note that you need @rollup/plugin-json to import JSON files)'; diff --git a/src/utils/parseAst.ts b/src/utils/parseAst.ts new file mode 100644 index 000000000..87e6056fd --- /dev/null +++ b/src/utils/parseAst.ts @@ -0,0 +1,10 @@ +import { parse } from '../../native'; +import type { ParseAst } from '../rollup/types'; +import { convertProgram } from './convert-ast'; +import getReadStringFunction from './getReadStringFunction'; + +export const parseAst: ParseAst = (input, { allowReturnOutsideFunction = false } = {}) => { + const astBuffer = parse(input, allowReturnOutsideFunction); + const readString = getReadStringFunction(astBuffer); + return convertProgram(astBuffer.buffer, readString); +}; diff --git a/src/utils/parseAstType.d.ts b/src/utils/parseAstType.d.ts new file mode 100644 index 000000000..9e67dd862 --- /dev/null +++ b/src/utils/parseAstType.d.ts @@ -0,0 +1,3 @@ +import type { ParseAst } from '../rollup/types'; + +export const parseAst: ParseAst; diff --git a/test/function/samples/double-default-export/_config.js b/test/function/samples/double-default-export/_config.js index f6643d7ef..cda58349b 100644 --- a/test/function/samples/double-default-export/_config.js +++ b/test/function/samples/double-default-export/_config.js @@ -6,6 +6,7 @@ module.exports = defineTest({ description: 'throws on double default exports', error: { cause: { + code: 'PARSE_ERROR', message: 'the name `default` is exported multiple times', pos: 18 }, diff --git a/test/function/samples/double-named-export/_config.js b/test/function/samples/double-named-export/_config.js index e8131fd68..51903cfa9 100644 --- a/test/function/samples/double-named-export/_config.js +++ b/test/function/samples/double-named-export/_config.js @@ -6,6 +6,7 @@ module.exports = defineTest({ description: 'throws on duplicate named exports', error: { cause: { + code: 'PARSE_ERROR', message: 'the name `foo` is exported multiple times', pos: 38 }, diff --git a/test/function/samples/double-named-reexport/_config.js b/test/function/samples/double-named-reexport/_config.js index 68f71c1db..12ea35747 100644 --- a/test/function/samples/double-named-reexport/_config.js +++ b/test/function/samples/double-named-reexport/_config.js @@ -6,6 +6,7 @@ module.exports = defineTest({ description: 'throws on duplicate named exports', error: { cause: { + code: 'PARSE_ERROR', message: 'the name `foo` is exported multiple times', pos: 38 }, diff --git a/test/function/samples/duplicate-import-fails/_config.js b/test/function/samples/duplicate-import-fails/_config.js index 14450a068..9688aa7af 100644 --- a/test/function/samples/duplicate-import-fails/_config.js +++ b/test/function/samples/duplicate-import-fails/_config.js @@ -5,6 +5,7 @@ module.exports = defineTest({ description: 'disallows duplicate imports', error: { cause: { + code: 'PARSE_ERROR', message: 'the name `a` is defined multiple times', pos: 36 }, diff --git a/test/function/samples/duplicate-import-specifier-fails/_config.js b/test/function/samples/duplicate-import-specifier-fails/_config.js index 2ea759b83..28c02f0af 100644 --- a/test/function/samples/duplicate-import-specifier-fails/_config.js +++ b/test/function/samples/duplicate-import-specifier-fails/_config.js @@ -5,6 +5,7 @@ module.exports = defineTest({ description: 'disallows duplicate import specifiers', error: { cause: { + code: 'PARSE_ERROR', message: 'the name `a` is defined multiple times', pos: 12 }, diff --git a/test/function/samples/error-parse-json/_config.js b/test/function/samples/error-parse-json/_config.js index f02689a2b..494ac4c26 100644 --- a/test/function/samples/error-parse-json/_config.js +++ b/test/function/samples/error-parse-json/_config.js @@ -7,6 +7,7 @@ module.exports = defineTest({ 'throws with an extended error message when failing to parse a file with ".json" extension', error: { cause: { + code: 'PARSE_ERROR', pos: 10, message: "Expected ';', '}' or " }, diff --git a/test/function/samples/error-parse-unknown-extension/_config.js b/test/function/samples/error-parse-unknown-extension/_config.js index d9268c3cb..45a72f9ff 100644 --- a/test/function/samples/error-parse-unknown-extension/_config.js +++ b/test/function/samples/error-parse-unknown-extension/_config.js @@ -7,6 +7,7 @@ module.exports = defineTest({ 'throws with an extended error message when failing to parse a file without .(m)js extension', error: { cause: { + code: 'PARSE_ERROR', pos: 0, message: 'Expression expected' }, diff --git a/test/function/samples/export-not-at-top-level-fails/_config.js b/test/function/samples/export-not-at-top-level-fails/_config.js index a7f314181..0940179df 100644 --- a/test/function/samples/export-not-at-top-level-fails/_config.js +++ b/test/function/samples/export-not-at-top-level-fails/_config.js @@ -5,6 +5,7 @@ module.exports = defineTest({ description: 'disallows non-top-level exports', error: { cause: { + code: 'PARSE_ERROR', pos: 19, message: "'import', and 'export' cannot be used outside of module code" }, diff --git a/test/function/samples/import-not-at-top-level-fails/_config.js b/test/function/samples/import-not-at-top-level-fails/_config.js index 9339c8017..3d270e449 100644 --- a/test/function/samples/import-not-at-top-level-fails/_config.js +++ b/test/function/samples/import-not-at-top-level-fails/_config.js @@ -5,6 +5,7 @@ module.exports = defineTest({ description: 'disallows non-top-level imports', error: { cause: { + code: 'PARSE_ERROR', pos: 19, message: "'import', and 'export' cannot be used outside of module code" }, diff --git a/test/function/samples/parse-return-outside-function/_config.js b/test/function/samples/parse-return-outside-function/_config.js index 862bda7d7..a698f1291 100644 --- a/test/function/samples/parse-return-outside-function/_config.js +++ b/test/function/samples/parse-return-outside-function/_config.js @@ -36,6 +36,7 @@ module.exports = defineTest({ expectedError = error; } compareError(expectedError, { + code: 'PARSE_ERROR', message: 'Return statement is not allowed here', pos: 0 }); @@ -46,6 +47,7 @@ module.exports = defineTest({ expectedError = error; } compareError(expectedError, { + code: 'PARSE_ERROR', message: 'Return statement is not allowed here', pos: 0 }); diff --git a/test/function/samples/reassign-import-fails/_config.js b/test/function/samples/reassign-import-fails/_config.js index 48cd70097..88553b160 100644 --- a/test/function/samples/reassign-import-fails/_config.js +++ b/test/function/samples/reassign-import-fails/_config.js @@ -6,6 +6,7 @@ module.exports = defineTest({ error: { code: 'PARSE_ERROR', cause: { + code: 'PARSE_ERROR', message: 'cannot reassign to an imported binding', pos: 113 }, diff --git a/test/function/samples/reassign-import-not-at-top-level-fails/_config.js b/test/function/samples/reassign-import-not-at-top-level-fails/_config.js index fe0020431..eff76cc8b 100644 --- a/test/function/samples/reassign-import-not-at-top-level-fails/_config.js +++ b/test/function/samples/reassign-import-not-at-top-level-fails/_config.js @@ -6,6 +6,7 @@ module.exports = defineTest({ error: { code: 'PARSE_ERROR', cause: { + code: 'PARSE_ERROR', message: 'cannot reassign to an imported binding', pos: 95 }, diff --git a/test/function/samples/update-expression-of-import-fails/_config.js b/test/function/samples/update-expression-of-import-fails/_config.js index a961315b1..06c97549e 100644 --- a/test/function/samples/update-expression-of-import-fails/_config.js +++ b/test/function/samples/update-expression-of-import-fails/_config.js @@ -6,6 +6,7 @@ module.exports = defineTest({ error: { code: 'PARSE_ERROR', cause: { + code: 'PARSE_ERROR', message: 'cannot reassign to an imported binding', pos: 28 }, diff --git a/test/misc/index.js b/test/misc/index.js index 2782f23e2..8950e1f05 100644 --- a/test/misc/index.js +++ b/test/misc/index.js @@ -1,5 +1,6 @@ require('./bundle-information'); require('./get-log-filter'); +require('./parse-ast'); require('./iife'); require('./in-memory-sourcemaps'); require('./misc'); diff --git a/test/misc/parse-ast.js b/test/misc/parse-ast.js new file mode 100644 index 000000000..705506017 --- /dev/null +++ b/test/misc/parse-ast.js @@ -0,0 +1,111 @@ +const assert = require('node:assert'); +const { parseAst } = require('../../dist/parseAst'); + +describe('parseAst', () => { + it('parses an AST', async () => { + assert.deepStrictEqual(parseAst('console.log("ok")'), { + type: 'Program', + start: 0, + end: 17, + body: [ + { + type: 'ExpressionStatement', + start: 0, + end: 17, + expression: { + type: 'CallExpression', + start: 0, + end: 17, + arguments: [{ type: 'Literal', start: 12, end: 16, raw: '"ok"', value: 'ok' }], + callee: { + type: 'MemberExpression', + start: 0, + end: 11, + computed: false, + object: { type: 'Identifier', start: 0, end: 7, name: 'console' }, + optional: false, + property: { type: 'Identifier', start: 8, end: 11, name: 'log' } + }, + optional: false + } + } + ], + sourceType: 'module' + }); + }); + + it('works as an ES module', async () => { + // eslint-disable-next-line import/no-unresolved + const { parseAst: parseEsm } = await import('../../dist/es/parseAst.js'); + assert.deepStrictEqual(parseEsm('console.log("ok")'), { + type: 'Program', + start: 0, + end: 17, + body: [ + { + type: 'ExpressionStatement', + start: 0, + end: 17, + expression: { + type: 'CallExpression', + start: 0, + end: 17, + arguments: [{ type: 'Literal', start: 12, end: 16, raw: '"ok"', value: 'ok' }], + callee: { + type: 'MemberExpression', + start: 0, + end: 11, + computed: false, + object: { type: 'Identifier', start: 0, end: 7, name: 'console' }, + optional: false, + property: { type: 'Identifier', start: 8, end: 11, name: 'log' } + }, + optional: false + } + } + ], + sourceType: 'module' + }); + }); + + it('throws on parse errors', async () => { + assert.throws(() => parseAst('<=>'), { + name: 'RollupError', + message: 'Expression expected', + code: 'PARSE_ERROR', + pos: 0 + }); + }); + + it('throws on return outside function by default', async () => { + assert.throws(() => parseAst('return 42;'), { + name: 'RollupError', + message: 'Return statement is not allowed here', + code: 'PARSE_ERROR', + pos: 0 + }); + }); + + it('can handle return outside function if enabled', async () => { + assert.deepStrictEqual(parseAst('return 42;', { allowReturnOutsideFunction: true }), { + type: 'Program', + start: 0, + end: 10, + body: [ + { + type: 'ReturnStatement', + start: 0, + end: 10, + argument: { type: 'Literal', start: 7, end: 9, raw: '42', value: 42 } + } + ], + sourceType: 'module' + }); + }); + + it('uses different references for key and value of a shorthand property', async () => { + const { key, value } = parseAst('({ foo });').body[0].expression.properties[0]; + assert.deepStrictEqual(key, value); + assert.ok(key !== value); + }); +}); From 2f261358c62b4f9e62cb86bf99de8d4ff3668994 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Thu, 5 Oct 2023 16:44:50 +0200 Subject: [PATCH 16/44] 4.0.0 --- CHANGELOG.md | 72 +++++++++++++++++++++++++++++++++++++++++++- browser/package.json | 2 +- package-lock.json | 4 +-- package.json | 2 +- 4 files changed, 75 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66bb96254..808239d06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,74 @@ - # rollup changelog +# rollup changelog + +## 4.0.0 + +_2023-10-05_ + +### BREAKING CHANGES + +#### General Changes + +- The minimal required Node version is now 18.0.0 (#5142) +- The browser build now relies on a WASM artifact that needs to be provided as well (#5073) +- The NodeJS build now relies on an optional native binary; for unsupported platforms, users can use the `@rollup/wasm-node` package that has the same interface as Rollup but relies on WASM artifacts (#5073) +- The "with" syntax for import attributes is not yet supported, awaiting support in SWC (#5073) +- The `INVALID_IMPORT_ASSERTION` error code has been replaced with `INVALID_IMPORT_ATTRIBUTE` (#5073) +- Rollup will now warn for `@__PURE__` and `@__NO_SIDE_EFFECTS__` annotations in invalid locations (#5165) +- If an entry module starts with a shebang comment `#!...`, this comment will be prepended to the output for `es` and `cjs` formats (#5163) +- File hashes will now use url-safe base64 encoded hashes (#5155) +- The maximum hash length has been reduced to 22 characters (#5155) +- The `RollupWarning` type has been removed in favor of the `RollupLog` type (#5147) + +#### Changes to Rollup Options + +- Acorn plugins are no longer supported, the `acornInjectPlugins` option has been removed (#5073) +- The `acorn` option has been removed (#5073) +- `output.externalImportAssertions` has been deprecated in favor of `output.externalImportAttributes` (#5073) +- `inlineDynamicImports`, `manualChunks` and `preserveModules` have been removed on input option level: Please use the corresponding output options of the same names (#5143) +- Removed output options (#5143): + - `output.experimentalDeepDynamicChunkOptimization`: This option is no longer needed as Rollup now always runs the full chunking algorithm + - `output.dynamicImportFunction`: Use the `renderDynamicImport` plugin hook instead + - `output.namespaceToStringTag`: Use `output.generatedCode.symbols` instead + - `output.preferConst`: Use `output.generatedCode.constBindings` instead + +#### Plugin API Changes + +- For `this.resolve`, the default of the `skipSelf` option is now `true` (#5142) +- `this.parse` now only supports the `allowReturnOutsideFunction` option for now (#5073) +- Import assertions now use the [new import attribute AST structure](https://github.com/estree/estree/blob/master/experimental/import-attributes.md) (#5073) +- "assertions" have been replaced with "attributes" in various places of the plugin interface (#5073) +- If the import of a module id is handled by the `load` hook of a plugin, `rollup.watch` no longer watches the actual file if the module id corresponds to a real path; if this is intended, then the plugin is responsible for calling `this.addWatchFile` for any dependency files (#5150) +- The normalized input options provided by `buildStart` and other hooks no longer contain an `onwarn` handler; plugins should use `onLog` instead (#5147) +- `this.moduleIds` has been removed from the plugin context: Use `this.getModuleIds()` instead (#5143) +- The `hasModuleSideEffects` flag has been removed from the `ModuleInfo` returned by `thi s.getModuleInfo()`: Use `moduleSideEffects` on the `ModuleInfo` instead (#5143) + +### Features + +- Improve parsing speed by switching to a native SWC-based parser (#5073) +- Rollup will now warn for `@__PURE__` and `@__NO_SIDE_EFFECTS__` annotations in invalid locations (#5165) +- The parser is now exposed as a separate export `parseAst` (#5169) + +### Bug Fixes + +- Rollup no longer tries to watch virtual files if their name corresponds to an actual file name; instead, plugins handle watching via `this.addWatchFile()` (#5150) + +### Pull Requests + +- [#5073](https://github.com/rollup/rollup/pull/5073): [v4.0] Switch parser to SWC and introduce native/WASM code (@lukastaegert) +- [#5142](https://github.com/rollup/rollup/pull/5142): [v4.0] Set the default of skipSelf to true (@TrickyPi) +- [#5143](https://github.com/rollup/rollup/pull/5143): [v4.0] Remove deprecated features (@lukastaegert) +- [#5144](https://github.com/rollup/rollup/pull/5144): [v4.0] Imporve the performance of generating ast and rollup ast nodes (@TrickyPi) +- [#5147](https://github.com/rollup/rollup/pull/5147): [v4.0] Remove onwarn from normalized input options (@lukastaegert) +- [#5150](https://github.com/rollup/rollup/pull/5150): [v4.0] feat: Do not watch files anymore if their content is returned by the load hook (@TrickyPi) +- [#5154](https://github.com/rollup/rollup/pull/5154): [v4.0] Add parse option to allow return outside function (@lukastaegert) +- [#5155](https://github.com/rollup/rollup/pull/5155): [v4.0] feat: implement hashing content in Rust (@TrickyPi) +- [#5157](https://github.com/rollup/rollup/pull/5157): [v4.0] Handle empty exports (@lukastaegert) +- [#5160](https://github.com/rollup/rollup/pull/5160): chore(deps): lock file maintenance minor/patch updates (@renovate[bot]) +- [#5163](https://github.com/rollup/rollup/pull/5163): [v4.0] feat: preserve shebang in entry module for CJS and ESM outputs (@TrickyPi) +- [#5164](https://github.com/rollup/rollup/pull/5164): [v4.0] fix: also strip BOM from code strings in JS (@TrickyPi) +- [#5165](https://github.com/rollup/rollup/pull/5165): [v4.0] warn for invalid annotations (@lukastaegert) +- [#5168](https://github.com/rollup/rollup/pull/5168): [v4.0] Ensure we support new import attribute "with" syntax (@lukastaegert) +- [#5169](https://github.com/rollup/rollup/pull/5169): [v4.0] Expose parser (@lukastaegert) ## 3.29.4 diff --git a/browser/package.json b/browser/package.json index e0a4ed54e..61b2c23eb 100644 --- a/browser/package.json +++ b/browser/package.json @@ -1,6 +1,6 @@ { "name": "@rollup/browser", - "version": "4.0.0-25", + "version": "4.0.0", "description": "Next-generation ES module bundler browser build", "main": "dist/rollup.browser.js", "module": "dist/es/rollup.browser.js", diff --git a/package-lock.json b/package-lock.json index 920c1ea60..8cd85c4b1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rollup", - "version": "4.0.0-25", + "version": "4.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rollup", - "version": "4.0.0-25", + "version": "4.0.0", "license": "MIT", "bin": { "rollup": "dist/bin/rollup" diff --git a/package.json b/package.json index 903806468..314755ffd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rollup", - "version": "4.0.0-25", + "version": "4.0.0", "description": "Next-generation ES module bundler", "main": "dist/rollup.js", "module": "dist/es/rollup.js", From 95c2da8a46263b5f0f59e1e5cc85710e2fef8ea4 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Fri, 6 Oct 2023 06:35:20 +0200 Subject: [PATCH 17/44] Fix REPL artifacts workflow --- .github/workflows/build-and-tests.yml | 2 +- .github/workflows/repl-artefacts.yml | 12 ------------ renovate.json | 1 - rust/parse_ast/src/convert_ast/converter.rs | 3 +-- test/form/samples/supports-es5-shim/_config.js | 1 - 5 files changed, 2 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-and-tests.yml b/.github/workflows/build-and-tests.yml index 5164c9960..65d2b6581 100644 --- a/.github/workflows/build-and-tests.yml +++ b/.github/workflows/build-and-tests.yml @@ -297,7 +297,7 @@ jobs: needs: - test - lint - # TODO SWC once v4 is live, this should be changed + # This needs to be adapted for Rollup 5 if: startsWith(github.ref_name, 'v4') steps: - name: Checkout Commit diff --git a/.github/workflows/repl-artefacts.yml b/.github/workflows/repl-artefacts.yml index 560feb49d..d6403878a 100644 --- a/.github/workflows/repl-artefacts.yml +++ b/.github/workflows/repl-artefacts.yml @@ -25,15 +25,11 @@ jobs: ref: refs/pull/${{ github.event.number }}/merge - name: Install Toolchain uses: dtolnay/rust-toolchain@stable - #TODO: remove after or before merging release-4.0 - if: ${{ github.head_ref == 'release-4.0' || github.base_ref == 'release-4.0' }} with: toolchain: nightly targets: x86_64-unknown-linux-gnu - name: Cache cargo uses: actions/cache@v3 - #TODO: remove after or before merging release-4.0 - if: ${{ github.head_ref == 'release-4.0' || github.base_ref == 'release-4.0' }} with: path: | ~/.cargo/registry/index/ @@ -57,13 +53,7 @@ jobs: if: steps.cache-node-modules.outputs.cache-hit != 'true' run: npm ci --ignore-scripts - name: Build artefacts - #TODO: remove after or before merging release-4.0 - if: ${{ github.head_ref == 'release-4.0' || github.base_ref == 'release-4.0' }} run: npm exec -- concurrently -c green,blue,yellow 'npm:build:napi -- --release' 'npm run build:wasm' 'npm:build:cjs' && npm run build:copy-native && npm run build:bootstrap - #TODO: remove after or before merging release-4.0 - - name: Build artefacts - if: ${{ github.head_ref != 'release-4.0' && github.base_ref != 'release-4.0' }} - run: npm run build:cjs && npm run build:bootstrap - name: Upload "${{ github.event.number }}/rollup.browser.js" to bucket uses: zdurham/s3-upload-github-action@master with: @@ -88,8 +78,6 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - name: Upload "${{ github.event.number }}/bindings_wasm_bg.wasm" to bucket uses: zdurham/s3-upload-github-action@master - #TODO: remove after or before merging release-4.0 - if: ${{ github.head_ref == 'release-4.0' || github.base_ref == 'release-4.0' }} with: args: --cache-control max-age=300,public env: diff --git a/renovate.json b/renovate.json index af7318b1d..31bea8626 100644 --- a/renovate.json +++ b/renovate.json @@ -16,7 +16,6 @@ }, { "matchUpdateTypes": ["minor", "patch", "lockFileMaintenance"], - "automergeSchedule": ["after 10am on Friday"], "groupName": "minor/patch updates" } ], diff --git a/rust/parse_ast/src/convert_ast/converter.rs b/rust/parse_ast/src/convert_ast/converter.rs index 8eaa8a643..912e80e21 100644 --- a/rust/parse_ast/src/convert_ast/converter.rs +++ b/rust/parse_ast/src/convert_ast/converter.rs @@ -42,8 +42,7 @@ pub struct AstConverter<'a> { impl<'a> AstConverter<'a> { pub fn new(code: &'a str, annotations: &'a Vec) -> Self { Self { - // TODO SWC This is just a wild guess and should be refined with a large - // block of minified code + // This is just a wild guess and should be revisited from time to time buffer: Vec::with_capacity(20 * code.len()), code: code.as_bytes(), index_converter: Utf8ToUtf16ByteIndexConverterAndAnnotationHandler::new(code, annotations), diff --git a/test/form/samples/supports-es5-shim/_config.js b/test/form/samples/supports-es5-shim/_config.js index 8d44b41d4..564ffd1e5 100644 --- a/test/form/samples/supports-es5-shim/_config.js +++ b/test/form/samples/supports-es5-shim/_config.js @@ -6,7 +6,6 @@ module.exports = defineTest({ throw new Error(warning.message); } }, - // TODO notable exception: Promise.resolve(thenable) not yet retained // check against tree-shake: false when updating the shim treeshake: true, plugins: [ From 7d88ef0709e3c4719b51ee206d0b664bcb4ff8b6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 6 Oct 2023 07:05:29 +0000 Subject: [PATCH 18/44] chore(deps): lock file maintenance minor/patch updates (#5172) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- rust/Cargo.lock | 154 +++++++++++++++++++------------------- rust/parse_ast/Cargo.toml | 16 ++-- 2 files changed, 85 insertions(+), 85 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index b6156c721..d15a427c1 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -86,7 +86,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -330,7 +330,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37e366bff8cd32dd8754b0991fb66b279dc48f598c3a18914852a6673deef583" dependencies = [ "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -408,7 +408,7 @@ dependencies = [ "pmutil", "proc-macro2", "swc_macros_common", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -546,7 +546,7 @@ dependencies = [ "pmutil", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -965,7 +965,7 @@ checksum = "52a40bc70c2c58040d2d8b167ba9a5ff59fc9dab7ad44771cfde3dcfde7a09c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -1030,9 +1030,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.67" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "5b1106fec09662ec6dd98ccac0f81cef56984d0b49f75c92d8cbad76e20c005c" dependencies = [ "unicode-ident", ] @@ -1246,7 +1246,7 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -1354,7 +1354,7 @@ dependencies = [ "pmutil", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -1399,7 +1399,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -1432,9 +1432,9 @@ dependencies = [ [[package]] name = "swc" -version = "0.266.36" +version = "0.266.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34095ecd01255e4eb0dc0e62f3a2a3f4cdf546584b3e0cea3bc4b2e2dbc98ea" +checksum = "a4d460e7778c38dca5ffbc0a41487ef179d89768e690e499f72ce786f90a726b" dependencies = [ "anyhow", "base64 0.13.1", @@ -1508,9 +1508,9 @@ dependencies = [ [[package]] name = "swc_common" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c84742fc22df1c293da5354c1cc8a5b45a045e9dc941005c1fd9cb4e9bdabc1" +checksum = "0eef62cc9409135ad6770ca4d52aa443ee8367d5322a5c7cab4c0eb96644a6ee" dependencies = [ "ahash", "ast_node", @@ -1537,9 +1537,9 @@ dependencies = [ [[package]] name = "swc_compiler_base" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e584232fc052442fef404e73f19c61152794cd55e904b1ca59d27ce892c5901" +checksum = "b912871245c50114f2796710f29f7af45695f5bfcaf339c874654128d5cfb974" dependencies = [ "anyhow", "base64 0.13.1", @@ -1579,14 +1579,14 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] name = "swc_ecma_ast" -version = "0.109.1" +version = "0.109.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e063a1614daed3ea8be56e5dd8edb17003409088d2fc9ce4aca3378879812607" +checksum = "1df3fdd0752abca14a106322b4db96f954274adfb1fbef387866691ea4bc6fe4" dependencies = [ "bitflags 2.4.0", "is-macro", @@ -1601,9 +1601,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "0.145.5" +version = "0.145.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "547ed57b827ea4df3e2c27cea153482f8b2ce2d271ae30c456fbb2d5a5ecc19d" +checksum = "0824227db6b9c78acb557c2ce5d03c83e71ff2a3891a74b6adb044f1e51c8f4f" dependencies = [ "memchr", "num-bigint", @@ -1628,14 +1628,14 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] name = "swc_ecma_ext_transforms" -version = "0.109.1" +version = "0.109.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2180a180a4ddf53d645be35f155fd2cd96f84dbba9399a9c52e795b15f7dcf76" +checksum = "f60582664a950ef5175b9b58376b2a498495cce674f66a3244756097b210ffce" dependencies = [ "phf", "swc_atoms", @@ -1647,9 +1647,9 @@ dependencies = [ [[package]] name = "swc_ecma_lints" -version = "0.88.7" +version = "0.88.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "289a6f347173c502f9ec95916a424f566ad0d1e9e8514d4fa754d400b8f4d29d" +checksum = "97f1265c5c86952370864421411b2cce3651b3972200ab31e2ae799f6aac703e" dependencies = [ "auto_impl", "dashmap", @@ -1667,9 +1667,9 @@ dependencies = [ [[package]] name = "swc_ecma_loader" -version = "0.44.4" +version = "0.44.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b2b3a3ec38fc9c691b787d32ac2aa5eb6871d1fe74ac4a10638fbd9b9bc407b" +checksum = "fde105c1234030b4e02b363bcb3bfeedc057cb40707e0695f6f84b99706307ff" dependencies = [ "anyhow", "dashmap", @@ -1688,9 +1688,9 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "0.187.29" +version = "0.187.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "737807edd59a7027b323ffe9b4f997d04d9be75ae523d7d0d72f49276a42a518" +checksum = "735941d928a141c7e46e7d0a65afdcdef12204b08ba6be69cbb7b7aedb7b4fb7" dependencies = [ "arrayvec", "indexmap 1.9.3", @@ -1722,9 +1722,9 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "0.140.0" +version = "0.140.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c968599841fcecfdc2e490188ad93251897a1bb912882547e6889e14a368399" +checksum = "316c11593fc4f52a81446fae0e1f1d32836c00f546eb80405024c04cd5f8bec6" dependencies = [ "either", "num-bigint", @@ -1742,9 +1742,9 @@ dependencies = [ [[package]] name = "swc_ecma_preset_env" -version = "0.201.28" +version = "0.201.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32427f265c65e691e6917c8146d90ab5b63bea09776e2f1e93a4f5fedceb135" +checksum = "d55cf2967058b01ad8be678f2683657e2ff93d5fd2a4e3b0f19e9b145be9f9ba" dependencies = [ "anyhow", "dashmap", @@ -1767,9 +1767,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "0.224.26" +version = "0.224.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49978f8430c1a975f0eecd966a6739eee76efe57af855d121f025b1017bb78d5" +checksum = "0ec5a80bb7603141a9a4e1df1a1036f54ae1b6ae8df807fec076bda196d84026" dependencies = [ "swc_atoms", "swc_common", @@ -1787,9 +1787,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "0.133.6" +version = "0.133.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7632e73dd031d97279579b4f2442ca2956fa8d523053aae10544b3392ac7c7de" +checksum = "5228db1f98c4027ded35c6e1c30bbf13f248c0321367ee5fa5fb3f55fa9f485f" dependencies = [ "better_scoped_tls", "bitflags 2.4.0", @@ -1810,9 +1810,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_classes" -version = "0.122.6" +version = "0.122.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32c1cd6b6b89fc2f4b2df5beb77b2f7c0311dc047394a753d331f6459f879e13" +checksum = "04783748e4401ea2f7ad1e5ba66cea89687c163ed612ba042266ababb784e9f4" dependencies = [ "swc_atoms", "swc_common", @@ -1824,9 +1824,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_compat" -version = "0.159.14" +version = "0.159.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edda36087deb901decd80aa310eafdc1b0ca99eb6b450985c0526c1fa81c5b3e" +checksum = "0be21b678c1bec2e24bf807187461bde2d8e08b991173cce1b1c2ca2fcf1d307" dependencies = [ "arrayvec", "indexmap 1.9.3", @@ -1857,14 +1857,14 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] name = "swc_ecma_transforms_module" -version = "0.176.18" +version = "0.176.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a6f6691e475c3221f0a71111d36db1b82c564797eff50ec52a60556570bf3dd" +checksum = "814598ac1079bba87c69ae1b191857dd3f9da2080885967fd50f785fe4775f62" dependencies = [ "Inflector", "anyhow", @@ -1889,9 +1889,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "0.193.26" +version = "0.193.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a05f5f1b9ee949c11f8b09b8a91a1f33c9071a170582f4da89d55acb63b5f33" +checksum = "f7061fc7578140c458652b281f3a6d8bd293a1adb3ad1a6bdf4b34bddc114be1" dependencies = [ "dashmap", "indexmap 1.9.3", @@ -1913,9 +1913,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_proposal" -version = "0.167.18" +version = "0.167.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dabacad5ab4169d12170bd02724655b995182face7e3f7359829c5f395daf4f7" +checksum = "6c1b2c1d36416ac5b03b804d38bb455205b6540c531748fdd30b584f7d1916d0" dependencies = [ "either", "rustc-hash", @@ -1933,9 +1933,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "0.179.18" +version = "0.179.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f96690d7ae5574f720b02347a759ebf7841c484546c40ae164cb7f095aa02d7a" +checksum = "63f846ebbf26d88538a4fcbb30e4f721d4ebcb8d2cf2f30dba555a11c00cc864" dependencies = [ "base64 0.13.1", "dashmap", @@ -1957,9 +1957,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "0.183.25" +version = "0.183.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf6feca762a992c3859c92a58b0c679a2a23e9d5b258dfafe7c853e8df2f88c8" +checksum = "6260277312ebd99a207114edac5721724a1b2e5b2aed9c604ae98c11de347f5e" dependencies = [ "ryu-js", "serde", @@ -1974,9 +1974,9 @@ dependencies = [ [[package]] name = "swc_ecma_usage_analyzer" -version = "0.19.1" +version = "0.19.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9aff7e336152eab07d074602bce9e2d43a3384f9b7d8397e78441b83fc0f1ed" +checksum = "91afe4cab139c51dfe8bcb1401cb6e53e900cc88fcfc65e370aa1b96fff842d0" dependencies = [ "indexmap 1.9.3", "rustc-hash", @@ -1991,9 +1991,9 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "0.123.1" +version = "0.123.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d3f8e4d11d124d9527d04ba7fc9f1efec376a67598ad7affda0440a48b13c1" +checksum = "46a1ead96a2422d0b4a9ff42cde3e529dfc8dafac26a310fbcfb28ba6f158571" dependencies = [ "indexmap 1.9.3", "num_cpus", @@ -2009,9 +2009,9 @@ dependencies = [ [[package]] name = "swc_ecma_visit" -version = "0.95.1" +version = "0.95.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2774848b306e17fa280c598ecb192cc2c72a1163942b02d48606514336e9e7c5" +checksum = "2decba8d98d8ecb241e3a75df568bb3818c657adeef7bc2025335a1efbd92d60" dependencies = [ "num-bigint", "swc_atoms", @@ -2030,14 +2030,14 @@ dependencies = [ "pmutil", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] name = "swc_error_reporters" -version = "0.16.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c76b479ad1a69bec65b261354b8e2dec8ed0f9ed43c7b54ab053dc4923e1c90e" +checksum = "4af16b3941d6ca7b16a6ef882c8b1b179158ddb588d77ba9cc6da8170f192540" dependencies = [ "anyhow", "miette", @@ -2048,9 +2048,9 @@ dependencies = [ [[package]] name = "swc_fast_graph" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2f7297cdefdb54d8d09e0294c1aec3826825b1feefd0c25978365aa7f447a1c" +checksum = "2cb088cba15977a1c7959d9f319c72705ab0e8bbb352cdbe068de1749bf846e0" dependencies = [ "indexmap 1.9.3", "petgraph", @@ -2067,14 +2067,14 @@ dependencies = [ "pmutil", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] name = "swc_node_comments" -version = "0.19.1" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b9597573f1ab8bae72329eef550d214ced0955c7a4f1b6b4ae5e216219e710" +checksum = "7020412829d83fa3a8ac787ba7c2b7c9bd2359b33e93dce4e8663d23e973fc7b" dependencies = [ "dashmap", "swc_atoms", @@ -2083,9 +2083,9 @@ dependencies = [ [[package]] name = "swc_timer" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b740ce6b402ed04176bd28dc4f4f92c764fe0defe8437c2f3b6e1b5818b4e10c" +checksum = "1841a4bd92674f684a3e27b8e162d4eac912af87b34ecd4b6dc126fe4fd230fe" dependencies = [ "tracing", ] @@ -2098,7 +2098,7 @@ checksum = "ff9719b6085dd2824fd61938a881937be14b08f95e2d27c64c825a9f65e052ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -2122,7 +2122,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -2138,9 +2138,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.37" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -2185,7 +2185,7 @@ checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -2223,7 +2223,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -2352,7 +2352,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", "wasm-bindgen-shared", ] @@ -2374,7 +2374,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", "wasm-bindgen-backend", "wasm-bindgen-shared", ] diff --git a/rust/parse_ast/Cargo.toml b/rust/parse_ast/Cargo.toml index cde32caf8..1c5f421a8 100644 --- a/rust/parse_ast/Cargo.toml +++ b/rust/parse_ast/Cargo.toml @@ -7,12 +7,12 @@ edition = "2021" [dependencies] anyhow = "1.0.75" -swc = "0.266.36" -swc_common = "0.32.1" -swc_ecma_ast = "0.109.1" -swc_ecma_parser = "0.140.0" -swc_error_reporters = "0.16.1" +swc = "0.266.37" +swc_common = "0.32.2" +swc_ecma_ast = "0.109.2" +swc_ecma_parser = "0.140.1" +swc_error_reporters = "0.16.2" parking_lot = "0.12.1" -swc_ecma_lints = "0.88.7" -swc_ecma_transforms_base = "0.133.6" -swc_ecma_visit = "0.95.1" +swc_ecma_lints = "0.88.9" +swc_ecma_transforms_base = "0.133.8" +swc_ecma_visit = "0.95.2" From 4611d8170cbd70a18d9096b166db975a2118f645 Mon Sep 17 00:00:00 2001 From: XiaoPi <530257315@qq.com> Date: Fri, 6 Oct 2023 19:54:25 +0800 Subject: [PATCH 19/44] fix: ignores empty statements in class body that is returned by SWC parser (#5173) * fix: convert empty statement from class member and remove it * Ignores empty statements in class body that is returned by SWC parser --- rust/parse_ast/src/convert_ast/converter.rs | 11 +++++++++-- .../empty-statament-class-member/_config.js | 3 +++ .../_expected/amd.js | 11 +++++++++++ .../_expected/cjs.js | 9 +++++++++ .../empty-statament-class-member/_expected/es.js | 7 +++++++ .../_expected/iife.js | 12 ++++++++++++ .../_expected/system.js | 16 ++++++++++++++++ .../_expected/umd.js | 14 ++++++++++++++ .../samples/empty-statament-class-member/main.js | 7 +++++++ 9 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 test/form/samples/empty-statament-class-member/_config.js create mode 100644 test/form/samples/empty-statament-class-member/_expected/amd.js create mode 100644 test/form/samples/empty-statament-class-member/_expected/cjs.js create mode 100644 test/form/samples/empty-statament-class-member/_expected/es.js create mode 100644 test/form/samples/empty-statament-class-member/_expected/iife.js create mode 100644 test/form/samples/empty-statament-class-member/_expected/system.js create mode 100644 test/form/samples/empty-statament-class-member/_expected/umd.js create mode 100644 test/form/samples/empty-statament-class-member/main.js diff --git a/rust/parse_ast/src/convert_ast/converter.rs b/rust/parse_ast/src/convert_ast/converter.rs index 912e80e21..07acfba41 100644 --- a/rust/parse_ast/src/convert_ast/converter.rs +++ b/rust/parse_ast/src/convert_ast/converter.rs @@ -558,8 +558,8 @@ impl<'a> AstConverter<'a> { ClassMember::TsIndexSignature(_) => { unimplemented!("Cannot convert ClassMember::TsIndexSignature") } - ClassMember::Empty(_) => unimplemented!("Cannot convert ClassMember::Empty"), ClassMember::AutoAccessor(_) => unimplemented!("Cannot convert ClassMember::AutoAccessor"), + ClassMember::Empty(_) => {} } } @@ -1542,8 +1542,15 @@ impl<'a> AstConverter<'a> { fn convert_class_body(&mut self, class_members: &Vec, start: u32, end: u32) { let end_position = self.add_type_and_explicit_start(&TYPE_CLASS_BODY, start); + let class_members_filtered: Vec<&ClassMember> = class_members + .iter() + .filter(|class_member| match class_member { + ClassMember::Empty(_) => false, + _ => true, + }) + .collect(); // body - self.convert_item_list(class_members, |ast_converter, class_member| { + self.convert_item_list(&class_members_filtered, |ast_converter, class_member| { ast_converter.convert_class_member(class_member); true }); diff --git a/test/form/samples/empty-statament-class-member/_config.js b/test/form/samples/empty-statament-class-member/_config.js new file mode 100644 index 000000000..31e35cc41 --- /dev/null +++ b/test/form/samples/empty-statament-class-member/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'Do not crash if class body has empty statements' +}); diff --git a/test/form/samples/empty-statament-class-member/_expected/amd.js b/test/form/samples/empty-statament-class-member/_expected/amd.js new file mode 100644 index 000000000..5300be6a4 --- /dev/null +++ b/test/form/samples/empty-statament-class-member/_expected/amd.js @@ -0,0 +1,11 @@ +define((function () { 'use strict'; + + class Foo { + foo() { + console.log('foo'); + }; + } + + console.log(Foo); + +})); diff --git a/test/form/samples/empty-statament-class-member/_expected/cjs.js b/test/form/samples/empty-statament-class-member/_expected/cjs.js new file mode 100644 index 000000000..5c7b09b47 --- /dev/null +++ b/test/form/samples/empty-statament-class-member/_expected/cjs.js @@ -0,0 +1,9 @@ +'use strict'; + +class Foo { + foo() { + console.log('foo'); + }; +} + +console.log(Foo); diff --git a/test/form/samples/empty-statament-class-member/_expected/es.js b/test/form/samples/empty-statament-class-member/_expected/es.js new file mode 100644 index 000000000..d6767f3d0 --- /dev/null +++ b/test/form/samples/empty-statament-class-member/_expected/es.js @@ -0,0 +1,7 @@ +class Foo { + foo() { + console.log('foo'); + }; +} + +console.log(Foo); diff --git a/test/form/samples/empty-statament-class-member/_expected/iife.js b/test/form/samples/empty-statament-class-member/_expected/iife.js new file mode 100644 index 000000000..59053d3a1 --- /dev/null +++ b/test/form/samples/empty-statament-class-member/_expected/iife.js @@ -0,0 +1,12 @@ +(function () { + 'use strict'; + + class Foo { + foo() { + console.log('foo'); + }; + } + + console.log(Foo); + +})(); diff --git a/test/form/samples/empty-statament-class-member/_expected/system.js b/test/form/samples/empty-statament-class-member/_expected/system.js new file mode 100644 index 000000000..dc2eff5bb --- /dev/null +++ b/test/form/samples/empty-statament-class-member/_expected/system.js @@ -0,0 +1,16 @@ +System.register([], (function () { + 'use strict'; + return { + execute: (function () { + + class Foo { + foo() { + console.log('foo'); + }; + } + + console.log(Foo); + + }) + }; +})); diff --git a/test/form/samples/empty-statament-class-member/_expected/umd.js b/test/form/samples/empty-statament-class-member/_expected/umd.js new file mode 100644 index 000000000..dd4f83d34 --- /dev/null +++ b/test/form/samples/empty-statament-class-member/_expected/umd.js @@ -0,0 +1,14 @@ +(function (factory) { + typeof define === 'function' && define.amd ? define(factory) : + factory(); +})((function () { 'use strict'; + + class Foo { + foo() { + console.log('foo'); + }; + } + + console.log(Foo); + +})); diff --git a/test/form/samples/empty-statament-class-member/main.js b/test/form/samples/empty-statament-class-member/main.js new file mode 100644 index 000000000..d6767f3d0 --- /dev/null +++ b/test/form/samples/empty-statament-class-member/main.js @@ -0,0 +1,7 @@ +class Foo { + foo() { + console.log('foo'); + }; +} + +console.log(Foo); From 10eb5e8e43613ef91ee9e1bf0c46eb34dbac6110 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Fri, 6 Oct 2023 14:14:48 +0200 Subject: [PATCH 20/44] Fix linux arm musl build (#5176) * Replace native loader with hand-crafted code * Add back Linux arm64 for debugging * Take some inspiration from SWC * more tests * more tests * more tests * more tests * more tests * more tests * more tests * more tests * more tests * more tests * more tests * more tests * more tests * more tests --- .eslintrc.js | 2 +- .github/workflows/build-and-tests.yml | 21 +- native.js | 306 +++++--------------------- package.json | 3 +- 4 files changed, 65 insertions(+), 267 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index ca86abc8d..45097ef1b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -21,7 +21,7 @@ module.exports = { 'coverage', '_tmp', 'cache', - 'native*.*', + 'native.d.ts', '/test/*/samples/**/*.*', '!/test/*/samples/**/_config.js', '!/test/*/samples/**/rollup.config.js', diff --git a/.github/workflows/build-and-tests.yml b/.github/workflows/build-and-tests.yml index 65d2b6581..874dc6f64 100644 --- a/.github/workflows/build-and-tests.yml +++ b/.github/workflows/build-and-tests.yml @@ -108,6 +108,7 @@ jobs: docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64 build: |- set -e && + export JEMALLOC_SYS_WITH_LG_PAGE=16 && rustup default nightly && rustup target add aarch64-unknown-linux-gnu && npm run build:napi -- --release --target aarch64-unknown-linux-gnu && @@ -131,16 +132,16 @@ jobs: build: | npm run build:napi -- --release --target armv7-linux-androideabi ${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip *.node - # TODO SWC this does not work yet, also add back in package.json - # - host: ubuntu-latest - # target: aarch64-unknown-linux-musl - # docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine - # build: |- - # set -e && - # rustup default nightly && - # rustup target add aarch64-unknown-linux-musl && - # npm run build:napi -- --release --target aarch64-unknown-linux-musl && - # /aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node + - host: ubuntu-latest + target: aarch64-unknown-linux-musl + docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine + build: >- + set -e && + export JEMALLOC_SYS_WITH_LG_PAGE=16 && + rustup default nightly && + rustup target add aarch64-unknown-linux-musl && + RUSTFLAGS='-C target-feature=-crt-static -C linker=aarch64-linux-musl-gcc' npm run build:napi -- --release --target aarch64-unknown-linux-musl && + /aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node - host: windows-latest target: aarch64-pc-windows-msvc build: npm run build:napi -- --release --target aarch64-pc-windows-msvc diff --git a/native.js b/native.js index 3c63511cc..ef67586a2 100644 --- a/native.js +++ b/native.js @@ -1,258 +1,54 @@ -/* tslint:disable */ -/* eslint-disable */ -/* prettier-ignore */ - -/* auto-generated by NAPI-RS */ - -const { existsSync, readFileSync } = require('fs') -const { join } = require('path') - -const { platform, arch } = process - -let nativeBinding = null -let localFileExisted = false -let loadError = null - -function isMusl() { - // For Node 10 - if (!process.report || typeof process.report.getReport !== 'function') { - try { - const lddPath = require('child_process').execSync('which ldd').toString().trim() - return readFileSync(lddPath, 'utf8').includes('musl') - } catch (e) { - return true - } - } else { - const { glibcVersionRuntime } = process.report.getReport().header - return !glibcVersionRuntime - } -} - -switch (platform) { - case 'android': - switch (arch) { - case 'arm64': - localFileExisted = existsSync(join(__dirname, 'rollup.android-arm64.node')) - try { - if (localFileExisted) { - nativeBinding = require('./rollup.android-arm64.node') - } else { - nativeBinding = require('@rollup/rollup-android-arm64') - } - } catch (e) { - loadError = e - } - break - case 'arm': - localFileExisted = existsSync(join(__dirname, 'rollup.android-arm-eabi.node')) - try { - if (localFileExisted) { - nativeBinding = require('./rollup.android-arm-eabi.node') - } else { - nativeBinding = require('@rollup/rollup-android-arm-eabi') - } - } catch (e) { - loadError = e - } - break - default: - throw new Error(`Unsupported architecture on Android ${arch}`) - } - break - case 'win32': - switch (arch) { - case 'x64': - localFileExisted = existsSync( - join(__dirname, 'rollup.win32-x64-msvc.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./rollup.win32-x64-msvc.node') - } else { - nativeBinding = require('@rollup/rollup-win32-x64-msvc') - } - } catch (e) { - loadError = e - } - break - case 'ia32': - localFileExisted = existsSync( - join(__dirname, 'rollup.win32-ia32-msvc.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./rollup.win32-ia32-msvc.node') - } else { - nativeBinding = require('@rollup/rollup-win32-ia32-msvc') - } - } catch (e) { - loadError = e - } - break - case 'arm64': - localFileExisted = existsSync( - join(__dirname, 'rollup.win32-arm64-msvc.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./rollup.win32-arm64-msvc.node') - } else { - nativeBinding = require('@rollup/rollup-win32-arm64-msvc') - } - } catch (e) { - loadError = e - } - break - default: - throw new Error(`Unsupported architecture on Windows: ${arch}`) - } - break - case 'darwin': - localFileExisted = existsSync(join(__dirname, 'rollup.darwin-universal.node')) - try { - if (localFileExisted) { - nativeBinding = require('./rollup.darwin-universal.node') - } else { - nativeBinding = require('@rollup/rollup-darwin-universal') - } - break - } catch {} - switch (arch) { - case 'x64': - localFileExisted = existsSync(join(__dirname, 'rollup.darwin-x64.node')) - try { - if (localFileExisted) { - nativeBinding = require('./rollup.darwin-x64.node') - } else { - nativeBinding = require('@rollup/rollup-darwin-x64') - } - } catch (e) { - loadError = e - } - break - case 'arm64': - localFileExisted = existsSync( - join(__dirname, 'rollup.darwin-arm64.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./rollup.darwin-arm64.node') - } else { - nativeBinding = require('@rollup/rollup-darwin-arm64') - } - } catch (e) { - loadError = e - } - break - default: - throw new Error(`Unsupported architecture on macOS: ${arch}`) - } - break - case 'freebsd': - if (arch !== 'x64') { - throw new Error(`Unsupported architecture on FreeBSD: ${arch}`) - } - localFileExisted = existsSync(join(__dirname, 'rollup.freebsd-x64.node')) - try { - if (localFileExisted) { - nativeBinding = require('./rollup.freebsd-x64.node') - } else { - nativeBinding = require('@rollup/rollup-freebsd-x64') - } - } catch (e) { - loadError = e - } - break - case 'linux': - switch (arch) { - case 'x64': - if (isMusl()) { - localFileExisted = existsSync( - join(__dirname, 'rollup.linux-x64-musl.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./rollup.linux-x64-musl.node') - } else { - nativeBinding = require('@rollup/rollup-linux-x64-musl') - } - } catch (e) { - loadError = e - } - } else { - localFileExisted = existsSync( - join(__dirname, 'rollup.linux-x64-gnu.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./rollup.linux-x64-gnu.node') - } else { - nativeBinding = require('@rollup/rollup-linux-x64-gnu') - } - } catch (e) { - loadError = e - } - } - break - case 'arm64': - if (isMusl()) { - localFileExisted = existsSync( - join(__dirname, 'rollup.linux-arm64-musl.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./rollup.linux-arm64-musl.node') - } else { - nativeBinding = require('@rollup/rollup-linux-arm64-musl') - } - } catch (e) { - loadError = e - } - } else { - localFileExisted = existsSync( - join(__dirname, 'rollup.linux-arm64-gnu.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./rollup.linux-arm64-gnu.node') - } else { - nativeBinding = require('@rollup/rollup-linux-arm64-gnu') - } - } catch (e) { - loadError = e - } - } - break - case 'arm': - localFileExisted = existsSync( - join(__dirname, 'rollup.linux-arm-gnueabihf.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./rollup.linux-arm-gnueabihf.node') - } else { - nativeBinding = require('@rollup/rollup-linux-arm-gnueabihf') - } - } catch (e) { - loadError = e - } - break - default: - throw new Error(`Unsupported architecture on Linux: ${arch}`) - } - break - default: - throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`) -} - -if (!nativeBinding) { - if (loadError) { - throw loadError - } - throw new Error(`Failed to load native binding`) +const { existsSync } = require('node:fs'); +const { join } = require('node:path'); +const { platform, arch, report } = require('node:process'); + +const isMusl = () => !report.getReport().header.glibcVersionRuntime; + +const bindingsByPlatformAndArch = { + android: { + arm: { base: 'android-arm-eabi' }, + arm64: { base: 'android-arm64' } + }, + darwin: { + arm64: { base: 'darwin-arm64' }, + x64: { base: 'darwin-x64' } + }, + linux: { + arm: { base: 'linux-arm-gnueabihf' }, + arm64: { base: 'linux-arm64-gnu', musl: 'linux-arm64-musl' }, + x64: { base: 'linux-x64-gnu', musl: 'linux-x64-musl' } + }, + win32: { + arm64: { base: 'win32-arm64-msvc' }, + ia32: { base: 'win32-ia32-msvc' }, + x64: { base: 'win32-x64-msvc' } + } +}; + +const imported = bindingsByPlatformAndArch[platform]?.[arch]; +if (!imported) { + throw new Error( + `Your current platform "${platform}" and architecture "${arch}" combination is not yet supported by the native Rollup build. Please use the WASM build "@rollup/wasm-node" instead. + +The following platform-architecture combinations are supported: +${Object.entries(bindingsByPlatformAndArch) + .flatMap(([platformName, architectures]) => + Object.entries(architectures).flatMap(([architectureName, { musl }]) => { + const name = `${platformName}-${architectureName}`; + return musl ? [name, `${name} (musl)`] : [name]; + }) + ) + .join('\n')} + +If this is important to you, please consider supporting Rollup to make a native build for your platform and architecture available.` + ); } -const { parse, xxhashBase64Url } = nativeBinding +const packageBase = imported.musl && isMusl() ? imported.musl : imported.base; +const localName = `./rollup.${packageBase}.node`; +const { parse, xxhashBase64Url } = require( + existsSync(join(__dirname, localName)) ? localName : `@rollup/rollup-${packageBase}` +); -module.exports.parse = parse -module.exports.xxhashBase64Url = xxhashBase64Url +module.exports.parse = parse; +module.exports.xxhashBase64Url = xxhashBase64Url; diff --git a/package.json b/package.json index 314755ffd..8ea6d8b30 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "aarch64-linux-android", "aarch64-pc-windows-msvc", "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", "armv7-linux-androideabi", "armv7-unknown-linux-gnueabihf", "i686-pc-windows-msvc", @@ -33,7 +34,7 @@ "scripts": { "build": "npm run build:wasm && concurrently -c green,blue \"npm run build:napi -- --release\" \"npm:build:js\" && npm run build:copy-native", "build:quick": "concurrently -c green,blue 'npm:build:napi' 'npm:build:cjs' && npm run build:copy-native", - "build:napi": "napi build --platform --dts native.d.ts --js native.js --cargo-cwd rust -p bindings_napi --cargo-name bindings_napi", + "build:napi": "napi build --platform --dts native.d.ts --js false --cargo-cwd rust -p bindings_napi --cargo-name bindings_napi", "build:wasm": "wasm-pack build rust/bindings_wasm --out-dir ../../wasm --target web --no-pack && shx rm wasm/.gitignore", "build:wasm:node": "wasm-pack build rust/bindings_wasm --out-dir ../../wasm-node --target nodejs --no-pack && shx rm wasm-node/.gitignore", "update:napi": "npm run build:napi && npm run build:copy-native", From fcab1f610fefb24621ce001dfb0831dd30e59ab3 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Fri, 6 Oct 2023 14:17:34 +0200 Subject: [PATCH 21/44] 4.0.1 --- CHANGELOG.md | 15 +++++++++++++++ browser/package.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 808239d06..6b1119f4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # rollup changelog +## 4.0.1 + +_2023-10-06_ + +### Bug Fixes + +- Do not panic on trailing semicolons after class methods (#5173) +- Add artifact for arm64 linux musl target (#5176) + +### Pull Requests + +- [#5172](https://github.com/rollup/rollup/pull/5172): chore(deps): lock file maintenance minor/patch updates (@renovate[bot]) +- [#5173](https://github.com/rollup/rollup/pull/5173): fix: ignores empty statements in class body that is returned by SWC parser (@TrickyPi) +- [#5176](https://github.com/rollup/rollup/pull/5176): Fix linux arm musl build (@lukastaegert) + ## 4.0.0 _2023-10-05_ diff --git a/browser/package.json b/browser/package.json index 61b2c23eb..264837f62 100644 --- a/browser/package.json +++ b/browser/package.json @@ -1,6 +1,6 @@ { "name": "@rollup/browser", - "version": "4.0.0", + "version": "4.0.1", "description": "Next-generation ES module bundler browser build", "main": "dist/rollup.browser.js", "module": "dist/es/rollup.browser.js", diff --git a/package-lock.json b/package-lock.json index 8cd85c4b1..285a5bebe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rollup", - "version": "4.0.0", + "version": "4.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rollup", - "version": "4.0.0", + "version": "4.0.1", "license": "MIT", "bin": { "rollup": "dist/bin/rollup" diff --git a/package.json b/package.json index 8ea6d8b30..72ec58bf9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rollup", - "version": "4.0.0", + "version": "4.0.1", "description": "Next-generation ES module bundler", "main": "dist/rollup.js", "module": "dist/es/rollup.js", From b132bd43144b7699eda599ac5aa4693b7f5c0867 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Fri, 6 Oct 2023 15:52:55 +0200 Subject: [PATCH 22/44] Handle special characters before double underscores (#5178) --- rust/parse_ast/src/convert_ast/annotations.rs | 17 +++++++++++++---- .../samples/handles-special-comments/_config.js | 3 +++ .../handles-special-comments/_expected.js | 2 ++ .../samples/handles-special-comments/main.js | 2 ++ 4 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 test/form/samples/handles-special-comments/_config.js create mode 100644 test/form/samples/handles-special-comments/_expected.js create mode 100644 test/form/samples/handles-special-comments/main.js diff --git a/rust/parse_ast/src/convert_ast/annotations.rs b/rust/parse_ast/src/convert_ast/annotations.rs index 6128718a7..05ff58800 100644 --- a/rust/parse_ast/src/convert_ast/annotations.rs +++ b/rust/parse_ast/src/convert_ast/annotations.rs @@ -8,6 +8,9 @@ pub struct SequentialComments { annotations: RefCell>, } +const ASCII_AT: u8 = '@' as u8; +const ASCII_HASH: u8 = '#' as u8; + impl SequentialComments { pub fn add_comment(&self, comment: Comment) { if comment.text.starts_with('#') && comment.text.contains("sourceMappingURL=") { @@ -17,12 +20,18 @@ impl SequentialComments { }); return; } - let mut search_position = 1; + let mut search_position = comment + .text + .chars() + .nth(0) + .map(|first_char| first_char.len_utf8()) + .unwrap_or(0); while let Some(Some(match_position)) = comment.text.get(search_position..).map(|s| s.find("__")) { search_position += match_position; - match &comment.text[search_position - 1..search_position] { - "@" | "#" => { + // Using a byte reference avoids UTF8 character boundary checks + match &comment.text.as_bytes()[search_position - 1] { + &ASCII_AT | &ASCII_HASH => { let annotation_slice = &comment.text[search_position..]; if annotation_slice.starts_with("__PURE__") { self.annotations.borrow_mut().push(AnnotationWithType { @@ -41,7 +50,7 @@ impl SequentialComments { } _ => {} } - search_position += 3; + search_position += 2; } } diff --git a/test/form/samples/handles-special-comments/_config.js b/test/form/samples/handles-special-comments/_config.js new file mode 100644 index 000000000..f1866b5bf --- /dev/null +++ b/test/form/samples/handles-special-comments/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'does not fail on certain comments (#5174)' +}); diff --git a/test/form/samples/handles-special-comments/_expected.js b/test/form/samples/handles-special-comments/_expected.js new file mode 100644 index 000000000..e9a293a63 --- /dev/null +++ b/test/form/samples/handles-special-comments/_expected.js @@ -0,0 +1,2 @@ +// “__ +console.log('main'); diff --git a/test/form/samples/handles-special-comments/main.js b/test/form/samples/handles-special-comments/main.js new file mode 100644 index 000000000..e9a293a63 --- /dev/null +++ b/test/form/samples/handles-special-comments/main.js @@ -0,0 +1,2 @@ +// “__ +console.log('main'); From 3d9c833c4fcb666301967554bac7ab0a0a698efe Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Fri, 6 Oct 2023 15:55:08 +0200 Subject: [PATCH 23/44] 4.0.2 --- CHANGELOG.md | 12 ++++++++++++ browser/package.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b1119f4e..8d1131c40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # rollup changelog +## 4.0.2 + +_2023-10-06_ + +### Bug Fixes + +- Fix annotation detection logic to not fail when a non-ASCII character precedes a double underscore (#5178) + +### Pull Requests + +- [#5178](https://github.com/rollup/rollup/pull/5178): Handle special characters before double underscores (@lukastaegert) + ## 4.0.1 _2023-10-06_ diff --git a/browser/package.json b/browser/package.json index 264837f62..23f4d54c2 100644 --- a/browser/package.json +++ b/browser/package.json @@ -1,6 +1,6 @@ { "name": "@rollup/browser", - "version": "4.0.1", + "version": "4.0.2", "description": "Next-generation ES module bundler browser build", "main": "dist/rollup.browser.js", "module": "dist/es/rollup.browser.js", diff --git a/package-lock.json b/package-lock.json index 285a5bebe..fb81647de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rollup", - "version": "4.0.1", + "version": "4.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rollup", - "version": "4.0.1", + "version": "4.0.2", "license": "MIT", "bin": { "rollup": "dist/bin/rollup" diff --git a/package.json b/package.json index 72ec58bf9..327ddb2dd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rollup", - "version": "4.0.1", + "version": "4.0.2", "description": "Next-generation ES module bundler", "main": "dist/rollup.js", "module": "dist/es/rollup.js", From 8b217ce2288bd268ed50f23990cced830f2644f2 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Sat, 7 Oct 2023 07:31:31 +0200 Subject: [PATCH 24/44] Update migration guide for Rollup 4 (#5179) * Update migration guide * Update anchors --- CHANGELOG.md | 3 +- docs/.vitepress/config.ts | 2 +- .../en/slugs-and-pages-by-legacy-slugs.json | 2 +- docs/migration/index.md | 54 ++++++++++++++++--- 4 files changed, 49 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d1131c40..cbf95984b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,7 +38,6 @@ _2023-10-05_ - The minimal required Node version is now 18.0.0 (#5142) - The browser build now relies on a WASM artifact that needs to be provided as well (#5073) - The NodeJS build now relies on an optional native binary; for unsupported platforms, users can use the `@rollup/wasm-node` package that has the same interface as Rollup but relies on WASM artifacts (#5073) -- The "with" syntax for import attributes is not yet supported, awaiting support in SWC (#5073) - The `INVALID_IMPORT_ASSERTION` error code has been replaced with `INVALID_IMPORT_ATTRIBUTE` (#5073) - Rollup will now warn for `@__PURE__` and `@__NO_SIDE_EFFECTS__` annotations in invalid locations (#5165) - If an entry module starts with a shebang comment `#!...`, this comment will be prepended to the output for `es` and `cjs` formats (#5163) @@ -67,7 +66,7 @@ _2023-10-05_ - If the import of a module id is handled by the `load` hook of a plugin, `rollup.watch` no longer watches the actual file if the module id corresponds to a real path; if this is intended, then the plugin is responsible for calling `this.addWatchFile` for any dependency files (#5150) - The normalized input options provided by `buildStart` and other hooks no longer contain an `onwarn` handler; plugins should use `onLog` instead (#5147) - `this.moduleIds` has been removed from the plugin context: Use `this.getModuleIds()` instead (#5143) -- The `hasModuleSideEffects` flag has been removed from the `ModuleInfo` returned by `thi s.getModuleInfo()`: Use `moduleSideEffects` on the `ModuleInfo` instead (#5143) +- The `hasModuleSideEffects` flag has been removed from the `ModuleInfo` returned by `this.getModuleInfo()`: Use `moduleSideEffects` on the `ModuleInfo` instead (#5143) ### Features diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index dad6edde1..e3de1e959 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -102,7 +102,7 @@ export default defineConfig({ }, { link: '/migration/', - text: 'Migrating to Rollup 3' + text: 'Migrating to Rollup 4' }, { link: '/tools/', diff --git a/docs/guide/en/slugs-and-pages-by-legacy-slugs.json b/docs/guide/en/slugs-and-pages-by-legacy-slugs.json index 26b37e793..62071ac40 100644 --- a/docs/guide/en/slugs-and-pages-by-legacy-slugs.json +++ b/docs/guide/en/slugs-and-pages-by-legacy-slugs.json @@ -1 +1 @@ -{"--bundleconfigascjs":["command-line-interface","bundleconfigascjs"],"--configplugin-plugin":["command-line-interface","configplugin-plugin"],"--environment-values":["command-line-interface","environment-values"],"--failafterwarnings":["command-line-interface","failafterwarnings"],"--no-stdin":["command-line-interface","no-stdin"],"--silent":["command-line-interface","silent"],"--stdinext":["command-line-interface","stdin-ext"],"--waitforbundleinput":["command-line-interface","waitforbundleinput"],"--watchonstart-cmd---watchonbundlestart-cmd---watchonbundleend-cmd---watchonend-cmd---watchonerror-cmd":["command-line-interface","watch-onstart-cmd-watch-onbundlestart-cmd-watch-onbundleend-cmd-watch-onend-cmd-watch-onerror-cmd"],"-h--help":["command-line-interface","h-help"],"-p-plugin---plugin-plugin":["command-line-interface","p-plugin-plugin-plugin"],"-v--version":["command-line-interface","v-version"],"-w--watch":["command-line-interface","w-watch"],"a-simple-example":["plugin-development","a-simple-example"],"advanced-functionality":["configuration-options","advanced-functionality"],"augmentchunkhash":["plugin-development","augmentchunkhash"],"avoiding-eval":["troubleshooting","avoiding-eval"],"babel":["tools","babel"],"banner":["plugin-development","banner"],"big-list-of-options":["configuration-options",""],"build-hooks":["plugin-development","build-hooks"],"buildend":["plugin-development","buildend"],"buildstart":["plugin-development","buildstart"],"cache":["configuration-options","cache"],"caveats-when-using-native-node-es-modules":["command-line-interface","caveats-when-using-native-node-es-modules"],"changed-defaults":["migration","changed-defaults"],"changes-to-the-plugin-api":["migration","changes-to-the-plugin-api"],"closebundle":["plugin-development","closebundle"],"closewatcher":["plugin-development","closewatcher"],"code-splitting":["tutorial","code-splitting"],"command-line-flags":["command-line-interface","command-line-flags"],"command-line-reference":["command-line-interface",""],"compatibility":["introduction","compatibility"],"config-intellisense":["command-line-interface","config-intellisense"],"configuration-files":["command-line-interface","configuration-files"],"context":["configuration-options","context"],"conventions":["plugin-development","conventions"],"core-functionality":["configuration-options","core-functionality"],"creating-your-first-bundle":["tutorial","creating-your-first-bundle"],"custom-module-meta-data":["plugin-development","custom-module-meta-data"],"custom-resolver-options":["plugin-development","custom-resolver-options"],"danger-zone":["configuration-options","danger-zone"],"default-export":["es-module-syntax","default-export"],"default-import":["es-module-syntax","default-import"],"deno":["tools","deno"],"deprecated-options":["configuration-options","deprecated-options"],"differences-to-the-javascript-api":["command-line-interface","differences-to-the-javascript-api"],"direct-plugin-communication":["plugin-development","direct-plugin-communication"],"dynamic-import":["es-module-syntax","dynamic-import"],"dynamic-import-in-commonjs-output":["migration","dynamic-import-in-commonjs-output"],"empty-import":["es-module-syntax","empty-import"],"error-emfile-too-many-open-files":["troubleshooting","error-emfile-too-many-open-files"],"error-javascript-heap-out-of-memory":["troubleshooting","error-javascript-heap-out-of-memory"],"error-name-is-not-exported-by-module":["troubleshooting","error-name-is-not-exported-by-module"],"error-node-tried-to-load-your-configuration-file-as-commonjs-even-though-it-is-likely-an-es-module":["troubleshooting","error-node-tried-to-load-your-configuration-file-as-commonjs-even-though-it-is-likely-an-es-module"],"error-this-is-undefined":["troubleshooting","error-this-is-undefined"],"es-module-syntax":["es-module-syntax",""],"eval2--eval":["troubleshooting","eval2-eval"],"example-transformer":["plugin-development","example-transformer"],"experimental-options":["configuration-options","experimental-options"],"experimentalcacheexpiry":["configuration-options","experimentalcacheexpiry"],"exporting":["es-module-syntax","exporting"],"external":["configuration-options","external"],"faqs":["faqs",""],"file-urls":["plugin-development","file-urls"],"footer":["plugin-development","footer"],"generatebundle":["plugin-development","generatebundle"],"getting-the-current-directory":["command-line-interface","getting-the-current-directory"],"gulp":["tools","gulp"],"how-bindings-work":["es-module-syntax","how-bindings-work"],"how-do-i-add-polyfills-to-a-rollup-bundle":["faqs","how-do-i-add-polyfills-to-a-rollup-bundle"],"how-do-i-run-rollup-itself-in-a-browser":["faqs","how-do-i-run-rollup-itself-in-a-browser"],"how-do-i-use-rollup-in-nodejs-with-commonjs-modules":["faqs","how-do-i-use-rollup-in-node-js-with-commonjs-modules"],"importing":["es-module-syntax","importing"],"importing-commonjs":["introduction","importing-commonjs"],"importing-packagejson":["command-line-interface","importing-package-json"],"input":["configuration-options","input"],"inputoptions-object":["javascript-api","inputoptions-object"],"installation":["introduction","installation"],"installing-rollup-locally":["tutorial","installing-rollup-locally"],"inter-plugin-communication":["plugin-development","inter-plugin-communication"],"intro":["plugin-development","intro"],"introduction":["introduction",""],"is-rollup-meant-for-building-libraries-or-applications":["faqs","is-rollup-meant-for-building-libraries-or-applications"],"javascript-api":["javascript-api",""],"load":["plugin-development","load"],"loading-a-configuration-from-a-node-package":["command-line-interface","loading-a-configuration-from-a-node-package"],"makeabsoluteexternalsrelative":["configuration-options","makeabsoluteexternalsrelative"],"maxparallelfileops":["configuration-options","maxparallelfileops"],"migration":["migration",""],"modulecontext":["configuration-options","modulecontext"],"moduleparsed":["plugin-development","moduleparsed"],"more-changed-options":["migration","more-changed-options"],"name":["plugin-development","name"],"named-exports":["es-module-syntax","named-exports"],"named-imports":["es-module-syntax","named-imports"],"namespace-imports":["es-module-syntax","namespace-imports"],"new-function":["troubleshooting","new-function"],"onwarn":["configuration-options","onwarn"],"options":["plugin-development","options"],"output-generation-hooks":["plugin-development","output-generation-hooks"],"outputamd":["configuration-options","output-amd"],"outputassetfilenames":["configuration-options","output-assetfilenames"],"outputbanneroutputfooter":["configuration-options","output-banner-output-footer"],"outputchunkfilenames":["configuration-options","output-chunkfilenames"],"outputcompact":["configuration-options","output-compact"],"outputdir":["configuration-options","output-dir"],"outputdynamicimportincjs":["configuration-options","output-dynamicimportincjs"],"outputentryfilenames":["configuration-options","output-entryfilenames"],"outputesmodule":["configuration-options","output-esmodule"],"outputexports":["configuration-options","output-exports"],"outputextend":["configuration-options","output-extend"],"outputexternalimportassertions":["configuration-options","output-externalimportassertions"],"outputexternallivebindings":["configuration-options","output-externallivebindings"],"outputfile":["configuration-options","output-file"],"outputformat":["configuration-options","output-format"],"outputfreeze":["configuration-options","output-freeze"],"outputgeneratedcode":["configuration-options","output-generatedcode"],"outputglobals":["configuration-options","output-globals"],"outputhoisttransitiveimports":["configuration-options","output-hoisttransitiveimports"],"outputindent":["configuration-options","output-indent"],"outputinlinedynamicimports":["configuration-options","output-inlinedynamicimports"],"outputinterop":["configuration-options","output-interop"],"outputintrooutputoutro":["configuration-options","output-intro-output-outro"],"outputmanualchunks":["configuration-options","output-manualchunks"],"outputminifyinternalexports":["configuration-options","output-minifyinternalexports"],"outputname":["configuration-options","output-name"],"outputnoconflict":["configuration-options","output-noconflict"],"outputoptions":["plugin-development","outputoptions"],"outputoptions-object":["javascript-api","outputoptions-object"],"outputpaths":["configuration-options","output-paths"],"outputplugins":["configuration-options","output-plugins"],"outputpreservemodules":["configuration-options","output-preservemodules"],"outputpreservemodulesroot":["configuration-options","output-preservemodulesroot"],"outputsanitizefilename":["configuration-options","output-sanitizefilename"],"outputsourcemap":["configuration-options","output-sourcemap"],"outputsourcemapbaseurl":["configuration-options","output-sourcemapbaseurl"],"outputsourcemapexcludesources":["configuration-options","output-sourcemapexcludesources"],"outputsourcemapfile":["configuration-options","output-sourcemapfile"],"outputsourcemappathtransform":["configuration-options","output-sourcemappathtransform"],"outputstrict":["configuration-options","output-strict"],"outputsystemnullsetters":["configuration-options","output-systemnullsetters"],"outputvalidate":["configuration-options","output-validate"],"outro":["plugin-development","outro"],"overview":["introduction","overview"],"peer-dependencies":["tools","peer-dependencies"],"perf":["configuration-options","perf"],"plugin-context":["plugin-development","plugin-context"],"plugin-development":["plugin-development",""],"plugins":["configuration-options","plugins"],"plugins-overview":["plugin-development","plugins-overview"],"prerequisites":["migration","prerequisites"],"preserveentrysignatures":["configuration-options","preserveentrysignatures"],"preservesymlinks":["configuration-options","preservesymlinks"],"programmatically-loading-a-config-file":["javascript-api","programmatically-loading-a-config-file"],"properties":["plugin-development","properties"],"publishing-es-modules":["introduction","publishing-es-modules"],"quick-start":["introduction","quick-start"],"reading-a-file-from-stdin":["command-line-interface","reading-a-file-from-stdin"],"renderchunk":["plugin-development","renderchunk"],"renderdynamicimport":["plugin-development","renderdynamicimport"],"rendererror":["plugin-development","rendererror"],"renderstart":["plugin-development","renderstart"],"resolvedynamicimport":["plugin-development","resolvedynamicimport"],"resolvefileurl":["plugin-development","resolvefileurl"],"resolveid":["plugin-development","resolveid"],"resolveimportmeta":["plugin-development","resolveimportmeta"],"rollupplugin-commonjs":["tools","rollup-plugin-commonjs"],"rollupplugin-node-resolve":["tools","rollup-plugin-node-resolve"],"rolluprollup":["javascript-api","rollup-rollup"],"rollupwatch":["javascript-api","rollup-watch"],"shimmissingexports":["configuration-options","shimmissingexports"],"shouldtransformcachedmodule":["plugin-development","shouldtransformcachedmodule"],"source-code-transformations":["plugin-development","source-code-transformations"],"strictdeprecations":["configuration-options","strictdeprecations"],"synthetic-named-exports":["plugin-development","synthetic-named-exports"],"the-why":["introduction","the-why"],"thisaddwatchfile":["plugin-development","this-addwatchfile"],"thisemitfile":["plugin-development","this-emitfile"],"thiserror":["plugin-development","this-error"],"thisgetcombinedsourcemap":["plugin-development","this-getcombinedsourcemap"],"thisgetfilename":["plugin-development","this-getfilename"],"thisgetmoduleids":["plugin-development","this-getmoduleids"],"thisgetmoduleinfo":["plugin-development","this-getmoduleinfo"],"thisgetwatchfiles":["plugin-development","this-getwatchfiles"],"thisload":["plugin-development","this-load"],"thismeta":["plugin-development","this-meta"],"thisparse":["plugin-development","this-parse"],"thisresolve":["plugin-development","this-resolve"],"thissetassetsource":["plugin-development","this-setassetsource"],"thiswarn":["plugin-development","this-warn"],"tools":["tools",""],"transform":["plugin-development","transform"],"transformers":["plugin-development","transformers"],"tree-shaking":["introduction","tree-shaking"],"tree-shaking-doesnt-seem-to-be-working":["troubleshooting","tree-shaking-doesn-t-seem-to-be-working"],"treeshake":["configuration-options","treeshake"],"troubleshooting":["troubleshooting",""],"tutorial":["tutorial",""],"using-config-files":["tutorial","using-config-files"],"using-configuration-files":["migration","using-configuration-files"],"using-output-plugins":["tutorial","using-output-plugins"],"using-plugins":["tutorial","using-plugins"],"warning-sourcemap-is-likely-to-be-incorrect":["troubleshooting","warning-sourcemap-is-likely-to-be-incorrect"],"warning-treating-module-as-external-dependency":["troubleshooting","warning-treating-module-as-external-dependency"],"watch-options":["configuration-options","watch"],"watchbuilddelay":["configuration-options","watch-builddelay"],"watchchange":["plugin-development","watchchange"],"watchchokidar":["configuration-options","watch-chokidar"],"watchclearscreen":["configuration-options","watch-clearscreen"],"watchexclude":["configuration-options","watch-exclude"],"watchinclude":["configuration-options","watch-include"],"watchoptions":["javascript-api","watchoptions"],"watchskipwrite":["configuration-options","watch-skipwrite"],"what-is-tree-shaking":["faqs","what-is-tree-shaking"],"who-made-the-rollup-logo-its-lovely":["faqs","who-made-the-rollup-logo-it-s-lovely"],"why-are-es-modules-better-than-commonjs-modules":["faqs","why-are-es-modules-better-than-commonjs-modules"],"why-do-additional-imports-turn-up-in-my-entry-chunks-when-code-splitting":["faqs","why-do-additional-imports-turn-up-in-my-entry-chunks-when-code-splitting"],"why-isnt-node-resolve-a-built-in-feature":["faqs","why-isn-t-node-resolve-a-built-in-feature"],"with-npm-packages":["tools","with-npm-packages"],"writebundle":["plugin-development","writebundle"]} \ No newline at end of file +{"--bundleconfigascjs":["command-line-interface","bundleconfigascjs"],"--configplugin-plugin":["command-line-interface","configplugin-plugin"],"--environment-values":["command-line-interface","environment-values"],"--failafterwarnings":["command-line-interface","failafterwarnings"],"--no-stdin":["command-line-interface","no-stdin"],"--silent":["command-line-interface","silent"],"--stdinext":["command-line-interface","stdin-ext"],"--waitforbundleinput":["command-line-interface","waitforbundleinput"],"--watchonstart-cmd---watchonbundlestart-cmd---watchonbundleend-cmd---watchonend-cmd---watchonerror-cmd":["command-line-interface","watch-onstart-cmd-watch-onbundlestart-cmd-watch-onbundleend-cmd-watch-onend-cmd-watch-onerror-cmd"],"-h--help":["command-line-interface","h-help"],"-p-plugin---plugin-plugin":["command-line-interface","p-plugin-plugin-plugin"],"-v--version":["command-line-interface","v-version"],"-w--watch":["command-line-interface","w-watch"],"a-simple-example":["plugin-development","a-simple-example"],"advanced-functionality":["configuration-options","advanced-functionality"],"augmentchunkhash":["plugin-development","augmentchunkhash"],"avoiding-eval":["troubleshooting","avoiding-eval"],"babel":["tools","babel"],"banner":["plugin-development","banner"],"big-list-of-options":["configuration-options",""],"build-hooks":["plugin-development","build-hooks"],"buildend":["plugin-development","buildend"],"buildstart":["plugin-development","buildstart"],"cache":["configuration-options","cache"],"caveats-when-using-native-node-es-modules":["command-line-interface","caveats-when-using-native-node-es-modules"],"changed-defaults":["migration","changed-defaults"],"changes-to-the-plugin-api":["migration","changes-to-the-plugin-api-1"],"closebundle":["plugin-development","closebundle"],"closewatcher":["plugin-development","closewatcher"],"code-splitting":["tutorial","code-splitting"],"command-line-flags":["command-line-interface","command-line-flags"],"command-line-reference":["command-line-interface",""],"compatibility":["introduction","compatibility"],"config-intellisense":["command-line-interface","config-intellisense"],"configuration-files":["command-line-interface","configuration-files"],"context":["configuration-options","context"],"conventions":["plugin-development","conventions"],"core-functionality":["configuration-options","core-functionality"],"creating-your-first-bundle":["tutorial","creating-your-first-bundle"],"custom-module-meta-data":["plugin-development","custom-module-meta-data"],"custom-resolver-options":["plugin-development","custom-resolver-options"],"danger-zone":["configuration-options","danger-zone"],"default-export":["es-module-syntax","default-export"],"default-import":["es-module-syntax","default-import"],"deno":["tools","deno"],"deprecated-options":["configuration-options","deprecated-options"],"differences-to-the-javascript-api":["command-line-interface","differences-to-the-javascript-api"],"direct-plugin-communication":["plugin-development","direct-plugin-communication"],"dynamic-import":["es-module-syntax","dynamic-import"],"dynamic-import-in-commonjs-output":["migration","dynamic-import-in-commonjs-output"],"empty-import":["es-module-syntax","empty-import"],"error-emfile-too-many-open-files":["troubleshooting","error-emfile-too-many-open-files"],"error-javascript-heap-out-of-memory":["troubleshooting","error-javascript-heap-out-of-memory"],"error-name-is-not-exported-by-module":["troubleshooting","error-name-is-not-exported-by-module"],"error-node-tried-to-load-your-configuration-file-as-commonjs-even-though-it-is-likely-an-es-module":["troubleshooting","error-node-tried-to-load-your-configuration-file-as-commonjs-even-though-it-is-likely-an-es-module"],"error-this-is-undefined":["troubleshooting","error-this-is-undefined"],"es-module-syntax":["es-module-syntax",""],"eval2--eval":["troubleshooting","eval2-eval"],"example-transformer":["plugin-development","example-transformer"],"experimental-options":["configuration-options","experimental-options"],"experimentalcacheexpiry":["configuration-options","experimentalcacheexpiry"],"exporting":["es-module-syntax","exporting"],"external":["configuration-options","external"],"faqs":["faqs",""],"file-urls":["plugin-development","file-urls"],"footer":["plugin-development","footer"],"generatebundle":["plugin-development","generatebundle"],"getting-the-current-directory":["command-line-interface","getting-the-current-directory"],"gulp":["tools","gulp"],"how-bindings-work":["es-module-syntax","how-bindings-work"],"how-do-i-add-polyfills-to-a-rollup-bundle":["faqs","how-do-i-add-polyfills-to-a-rollup-bundle"],"how-do-i-run-rollup-itself-in-a-browser":["faqs","how-do-i-run-rollup-itself-in-a-browser"],"how-do-i-use-rollup-in-nodejs-with-commonjs-modules":["faqs","how-do-i-use-rollup-in-node-js-with-commonjs-modules"],"importing":["es-module-syntax","importing"],"importing-commonjs":["introduction","importing-commonjs"],"importing-packagejson":["command-line-interface","importing-package-json"],"input":["configuration-options","input"],"inputoptions-object":["javascript-api","inputoptions-object"],"installation":["introduction","installation"],"installing-rollup-locally":["tutorial","installing-rollup-locally"],"inter-plugin-communication":["plugin-development","inter-plugin-communication"],"intro":["plugin-development","intro"],"introduction":["introduction",""],"is-rollup-meant-for-building-libraries-or-applications":["faqs","is-rollup-meant-for-building-libraries-or-applications"],"javascript-api":["javascript-api",""],"load":["plugin-development","load"],"loading-a-configuration-from-a-node-package":["command-line-interface","loading-a-configuration-from-a-node-package"],"makeabsoluteexternalsrelative":["configuration-options","makeabsoluteexternalsrelative"],"maxparallelfileops":["configuration-options","maxparallelfileops"],"migration":["migration",""],"modulecontext":["configuration-options","modulecontext"],"moduleparsed":["plugin-development","moduleparsed"],"more-changed-options":["migration","more-changed-options"],"name":["plugin-development","name"],"named-exports":["es-module-syntax","named-exports"],"named-imports":["es-module-syntax","named-imports"],"namespace-imports":["es-module-syntax","namespace-imports"],"new-function":["troubleshooting","new-function"],"onwarn":["configuration-options","onwarn"],"options":["plugin-development","options"],"output-generation-hooks":["plugin-development","output-generation-hooks"],"outputamd":["configuration-options","output-amd"],"outputassetfilenames":["configuration-options","output-assetfilenames"],"outputbanneroutputfooter":["configuration-options","output-banner-output-footer"],"outputchunkfilenames":["configuration-options","output-chunkfilenames"],"outputcompact":["configuration-options","output-compact"],"outputdir":["configuration-options","output-dir"],"outputdynamicimportincjs":["configuration-options","output-dynamicimportincjs"],"outputentryfilenames":["configuration-options","output-entryfilenames"],"outputesmodule":["configuration-options","output-esmodule"],"outputexports":["configuration-options","output-exports"],"outputextend":["configuration-options","output-extend"],"outputexternalimportassertions":["configuration-options","output-externalimportassertions"],"outputexternallivebindings":["configuration-options","output-externallivebindings"],"outputfile":["configuration-options","output-file"],"outputformat":["configuration-options","output-format"],"outputfreeze":["configuration-options","output-freeze"],"outputgeneratedcode":["configuration-options","output-generatedcode"],"outputglobals":["configuration-options","output-globals"],"outputhoisttransitiveimports":["configuration-options","output-hoisttransitiveimports"],"outputindent":["configuration-options","output-indent"],"outputinlinedynamicimports":["configuration-options","output-inlinedynamicimports"],"outputinterop":["configuration-options","output-interop"],"outputintrooutputoutro":["configuration-options","output-intro-output-outro"],"outputmanualchunks":["configuration-options","output-manualchunks"],"outputminifyinternalexports":["configuration-options","output-minifyinternalexports"],"outputname":["configuration-options","output-name"],"outputnoconflict":["configuration-options","output-noconflict"],"outputoptions":["plugin-development","outputoptions"],"outputoptions-object":["javascript-api","outputoptions-object"],"outputpaths":["configuration-options","output-paths"],"outputplugins":["configuration-options","output-plugins"],"outputpreservemodules":["configuration-options","output-preservemodules"],"outputpreservemodulesroot":["configuration-options","output-preservemodulesroot"],"outputsanitizefilename":["configuration-options","output-sanitizefilename"],"outputsourcemap":["configuration-options","output-sourcemap"],"outputsourcemapbaseurl":["configuration-options","output-sourcemapbaseurl"],"outputsourcemapexcludesources":["configuration-options","output-sourcemapexcludesources"],"outputsourcemapfile":["configuration-options","output-sourcemapfile"],"outputsourcemappathtransform":["configuration-options","output-sourcemappathtransform"],"outputstrict":["configuration-options","output-strict"],"outputsystemnullsetters":["configuration-options","output-systemnullsetters"],"outputvalidate":["configuration-options","output-validate"],"outro":["plugin-development","outro"],"overview":["introduction","overview"],"peer-dependencies":["tools","peer-dependencies"],"perf":["configuration-options","perf"],"plugin-context":["plugin-development","plugin-context"],"plugin-development":["plugin-development",""],"plugins":["configuration-options","plugins"],"plugins-overview":["plugin-development","plugins-overview"],"prerequisites":["migration","prerequisites-1"],"preserveentrysignatures":["configuration-options","preserveentrysignatures"],"preservesymlinks":["configuration-options","preservesymlinks"],"programmatically-loading-a-config-file":["javascript-api","programmatically-loading-a-config-file"],"properties":["plugin-development","properties"],"publishing-es-modules":["introduction","publishing-es-modules"],"quick-start":["introduction","quick-start"],"reading-a-file-from-stdin":["command-line-interface","reading-a-file-from-stdin"],"renderchunk":["plugin-development","renderchunk"],"renderdynamicimport":["plugin-development","renderdynamicimport"],"rendererror":["plugin-development","rendererror"],"renderstart":["plugin-development","renderstart"],"resolvedynamicimport":["plugin-development","resolvedynamicimport"],"resolvefileurl":["plugin-development","resolvefileurl"],"resolveid":["plugin-development","resolveid"],"resolveimportmeta":["plugin-development","resolveimportmeta"],"rollupplugin-commonjs":["tools","rollup-plugin-commonjs"],"rollupplugin-node-resolve":["tools","rollup-plugin-node-resolve"],"rolluprollup":["javascript-api","rollup-rollup"],"rollupwatch":["javascript-api","rollup-watch"],"shimmissingexports":["configuration-options","shimmissingexports"],"shouldtransformcachedmodule":["plugin-development","shouldtransformcachedmodule"],"source-code-transformations":["plugin-development","source-code-transformations"],"strictdeprecations":["configuration-options","strictdeprecations"],"synthetic-named-exports":["plugin-development","synthetic-named-exports"],"the-why":["introduction","the-why"],"thisaddwatchfile":["plugin-development","this-addwatchfile"],"thisemitfile":["plugin-development","this-emitfile"],"thiserror":["plugin-development","this-error"],"thisgetcombinedsourcemap":["plugin-development","this-getcombinedsourcemap"],"thisgetfilename":["plugin-development","this-getfilename"],"thisgetmoduleids":["plugin-development","this-getmoduleids"],"thisgetmoduleinfo":["plugin-development","this-getmoduleinfo"],"thisgetwatchfiles":["plugin-development","this-getwatchfiles"],"thisload":["plugin-development","this-load"],"thismeta":["plugin-development","this-meta"],"thisparse":["plugin-development","this-parse"],"thisresolve":["plugin-development","this-resolve"],"thissetassetsource":["plugin-development","this-setassetsource"],"thiswarn":["plugin-development","this-warn"],"tools":["tools",""],"transform":["plugin-development","transform"],"transformers":["plugin-development","transformers"],"tree-shaking":["introduction","tree-shaking"],"tree-shaking-doesnt-seem-to-be-working":["troubleshooting","tree-shaking-doesn-t-seem-to-be-working"],"treeshake":["configuration-options","treeshake"],"troubleshooting":["troubleshooting",""],"tutorial":["tutorial",""],"using-config-files":["tutorial","using-config-files"],"using-configuration-files":["migration","using-configuration-files"],"using-output-plugins":["tutorial","using-output-plugins"],"using-plugins":["tutorial","using-plugins"],"warning-sourcemap-is-likely-to-be-incorrect":["troubleshooting","warning-sourcemap-is-likely-to-be-incorrect"],"warning-treating-module-as-external-dependency":["troubleshooting","warning-treating-module-as-external-dependency"],"watch-options":["configuration-options","watch"],"watchbuilddelay":["configuration-options","watch-builddelay"],"watchchange":["plugin-development","watchchange"],"watchchokidar":["configuration-options","watch-chokidar"],"watchclearscreen":["configuration-options","watch-clearscreen"],"watchexclude":["configuration-options","watch-exclude"],"watchinclude":["configuration-options","watch-include"],"watchoptions":["javascript-api","watchoptions"],"watchskipwrite":["configuration-options","watch-skipwrite"],"what-is-tree-shaking":["faqs","what-is-tree-shaking"],"who-made-the-rollup-logo-its-lovely":["faqs","who-made-the-rollup-logo-it-s-lovely"],"why-are-es-modules-better-than-commonjs-modules":["faqs","why-are-es-modules-better-than-commonjs-modules"],"why-do-additional-imports-turn-up-in-my-entry-chunks-when-code-splitting":["faqs","why-do-additional-imports-turn-up-in-my-entry-chunks-when-code-splitting"],"why-isnt-node-resolve-a-built-in-feature":["faqs","why-isn-t-node-resolve-a-built-in-feature"],"with-npm-packages":["tools","with-npm-packages"],"writebundle":["plugin-development","writebundle"]} \ No newline at end of file diff --git a/docs/migration/index.md b/docs/migration/index.md index 1afa3b544..aaf9d2b4f 100644 --- a/docs/migration/index.md +++ b/docs/migration/index.md @@ -1,12 +1,50 @@ --- -title: Migrating to Rollup 3 +title: Migrating to Rollup 4 --- # {{ $frontmatter.title }} [[toc]] -This is a list of the most important topics you may encounter when migrating to Rollup 3. For a full list of breaking changes, we advise you to consult the +This is a list of the most important topics you may encounter when migrating from Rollup 3 to Rollup 4. For a full list of breaking changes, we advise you to consult the + +- [Rollup 4 changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md#400) + +For how to migrate from earlier versions, [see below](#migrating-to-rollup-3). + +## Prerequisites + +Make sure you run at least Node 18.0.0 and update all your Rollup plugins to their latest versions. + +For larger configs, it can make sense to update to `rollup@3.29.4` first, add the [`strictDeprecations`](../configuration-options/index.md#strictdeprecations) option to your config and resolve any errors that pop up. That way you can make sure you do not rely on features that may have been removed in Rollup 4. If you have errors in your plugins, please contact the plugin author. + +## General Changes + +Rollup now relies on some native code. For most users, this code should automatically be installed as an optional dependency depending on your platform and architecture. If your system is not supported, you can instead use `@rollup/wasm-node` as a platform-independent drop-in replacement. + +Otherwise, an obvious change is that Rollup now uses url-safe base64 hashes in file names instead of the older base16 hashes. This provides more hash safety but means that hash length is now limited to at most 22 characters for technical reasons. + +When bundling CLI apps, Rollup will now automatically preserve shebang comments in entry files if the output [`format`](../configuration-options/index.md#output-format) is `es` or `cjs`. Previously, you would have needed to add the comment via a plugin. + +Last, you may see some new warnings about invalid annotation positions. Rollup will now warn if it finds a [`@__PURE__`](../configuration-options/index.md#pure) or [`@__NO_SIDE_EFFECTS__`](../configuration-options/index.md#no-side-effects) comment that it cannot interpret as it is in an invalid location. These warnings are meant to help debugging. To silence them, the [`--filter-logs`](../command-line-interface/index.md#filterlogs-filter) CLI option can help you. + +## Configuration Changes + +While some options that were already deprecated in Rollup 3 have been removed, the only major change here is that we no longer have the `acorn` and `acornInjectPlugin` options available. This means, unfortunately, that you can no longer add plugins for unsupported syntax. Depending on demand, we consider supporting JSX syntax again as the SWC parser would support that. + +## Changes to the Plugin API + +An important change is that [`this.resolve()`](../plugin-development/index.md#this-resolve) will now by default add `skipSelf: true`. That means when calling `this.resolve()` from a [`resolveId`](../plugin-development/index.md#resolveid) hook, this hook will not be called again by this or further nested `this.resolve()` calls from other plugins unless they use a different `source` or `importer`. We found that this is a reasonable default for most plugins that prevents unintended infinite loops. To get the old behaviour, you can manually add `skipSelf: false`. + +Another important change is that Rollup watch mode will no longer watch ids of files that have been loaded via a plugin [`load`](../plugin-development/index.md#load) hook. So this mainly affects "virtual" files, where it really does not make sense to watch a hard drive location for changes. Instead, it is now up to plugins that use a `load` hook to manually call [`this.addWatchFile()`](../plugin-development/index.md#this-addwatchfile) for all the files they depend on to handle the `load` hook. + +If your plugin handles import assertions, note that in the [`resolveId`](../plugin-development/index.md#resolveid) hook and other places, `assertions` have been replaced with `attributes` as the JavaScript feature was also renamed. Also, the abstract syntax tree representation of import attributes now follows the [ESTree spec](https://github.com/estree/estree/blob/7a0c8fb02a33a69fa16dbe3ca35beeaa8f58f1e3/experimental/import-attributes.md) again. + +If you want to emit warnings from your plugin, you can no longer call `options.onwarn()` in the [`buildStart`](../plugin-development/index.md#buildstart) hook. Instead, either use [`this.warn()`](../plugin-development/index.md#load) or [`options.onLog()`](../configuration-options/index.md#onlog). + +## Migrating to Rollup 3 + +This is a list of the most important topics you may encounter when migrating from Rollup 2 to Rollup 3. For a full list of breaking changes, we advise you to consult the - [Rollup 3 changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md#300) @@ -15,13 +53,13 @@ When migrating from Rollup 1 or earlier, see also - [Rollup 2 changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md#200) - [Rollup 1 changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md#100) -## Prerequisites +### Prerequisites Make sure you run at least Node 14.18.0 and update all your Rollup plugins to their latest versions. For larger configs, it can make sense to update to `rollup@2.79.1` first, add the [`strictDeprecations`](../configuration-options/index.md#strictdeprecations) option to your config and resolve any errors that pop up. That way you can make sure you do not rely on features that may have been removed in Rollup 3. If you have errors in your plugins, please contact the plugin author. -## Using Configuration Files +### Using Configuration Files If you are using an ES module as configuration file, i.e. `import` and `export` syntax, you need to make sure Node will be loading your configuration as an ES module. @@ -38,7 +76,7 @@ Alternatively you can pass the [`--bundleConfigAsCjs`](../command-line-interface If you use the [`--configPlugin`](../command-line-interface/index.md#configplugin-plugin) option, Rollup will now bundle your configuration as an ES module instead of CommonJS before running it. This allows you to easily import ES modules from your configuration but has the same caveats as using a native ES module, e.g. `__dirname` will no longer work. Again, you can pass the [`--bundleConfigAsCjs`](../command-line-interface/index.md#bundleconfigascjs) option to force the old loading behavior. -## Changed Defaults +### Changed Defaults Some options now have different default values. If you think you experience any issues, try adding the following to your configuration: @@ -59,17 +97,17 @@ Some options now have different default values. If you think you experience any In general, though, the new default values are our recommended settings. Refer to the documentation of each setting for more details. -## More Changed Options +### More Changed Options - [`output.banner/footer`](../configuration-options/index.md#output-banner-output-footer)[`/intro/outro`](../configuration-options/index.md#output-intro-output-outro) are now called per chunk and thus should not do any performance-heavy operations. - [`entryFileNames`](../configuration-options/index.md#output-entryfilenames) and [`chunkFileNames`](../configuration-options/index.md#output-chunkfilenames) functions no longer have access to the rendered module information via `modules`, but only to a list of included `moduleIds`. - When using [`output.preserveModules`](../configuration-options/index.md#output-preservemodules) and `entryFileNames`, you can no longer use the `[ext]`, `[extName]` and `[assetExtName]` file name placeholders. Also, the path of a module is no longer prepended to the file name automatically but is included in the `[name]` placeholder. -## Dynamic Import in CommonJS Output +### Dynamic Import in CommonJS Output By default, when generating `cjs` output, Rollup will now keep any external, i.e. non-bundled, dynamic imports as `import(…)` expressions in the output. This is supported in all Node versions starting with Node 14 and allows to load both CommonJS and ES modules from generated CommonJS output. If you need to support older Node versions, you can pass [`output.dynamicImportInCjs: false`](../configuration-options/index.md#output-dynamicimportincjs). -## Changes to the Plugin API +### Changes to the Plugin API Then general output generation flow has been reworked, see the [Output Generation Hooks](../plugin-development/index.md#output-generation-hooks) graph for the new plugin hook order. Probably the most obvious change is that the [`banner`](../plugin-development/index.md#banner)/[`footer`](../plugin-development/index.md#footer)/[`intro`](../plugin-development/index.md#intro)/[`outro`](../plugin-development/index.md#outro) are no longer invoked once at the beginning but rather per chunk. On the other hand, [`augmentChunkHash`](../plugin-development/index.md#augmentchunkhash) is now evaluated after [`renderChunk`](../plugin-development/index.md#renderchunk) when the hash is created. From 15d321bf7da5d48ed9a8ed9f87d7f88736ce837d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E8=89=AF=E4=BB=94?= <32487868+cijiugechu@users.noreply.github.com> Date: Sat, 7 Oct 2023 14:01:27 +0800 Subject: [PATCH 25/44] chore: explicitly set rust toolchain channel (#5177) * chore: explicitly set the toolchain channel * set `profile` to default * add target in ci * nightly specifier * Update build-and-tests.yml * specify default toolchain for docker builds --------- Co-authored-by: Lukas Taegert-Atkinson --- .github/workflows/build-and-tests.yml | 55 +++++++++++++++++---------- rust/rust-toolchain.toml | 5 +++ 2 files changed, 39 insertions(+), 21 deletions(-) create mode 100644 rust/rust-toolchain.toml diff --git a/.github/workflows/build-and-tests.yml b/.github/workflows/build-and-tests.yml index 874dc6f64..661462e1d 100644 --- a/.github/workflows/build-and-tests.yml +++ b/.github/workflows/build-and-tests.yml @@ -59,7 +59,10 @@ jobs: target: x86_64-pc-windows-msvc name: wasm is-wasm-build: true - build: npm run build:wasm + build: >- + set -e && + rustup target add wasm32-unknown-unknown && + npm run build:wasm path: | wasm/ .empty @@ -67,49 +70,56 @@ jobs: target: x86_64-pc-windows-msvc name: wasm-node is-wasm-build: true - build: npm run build:wasm:node + build: >- + set -e && + rustup target add wasm32-unknown-unknown && + npm run build:wasm:node path: | wasm-node/ .empty - host: macos-latest target: x86_64-apple-darwin - build: | - npm run build:napi -- --release + build: >- + set -e && + npm run build:napi -- --release && strip -x *.node - host: windows-latest build: npm run build:napi -- --release target: x86_64-pc-windows-msvc - host: windows-latest - build: | + build: >- + set -e && + rustup target add i686-pc-windows-msvc && npm run build:napi -- --release --target i686-pc-windows-msvc target: i686-pc-windows-msvc - host: ubuntu-latest target: x86_64-unknown-linux-gnu docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian - build: |- + build: >- set -e && - rustup default nightly && + rustup target add x86_64-unknown-linux-gnu && npm run build:napi -- --release --target x86_64-unknown-linux-gnu && strip *.node - host: ubuntu-latest target: x86_64-unknown-linux-musl docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine - build: |- + build: >- set -e && - rustup default nightly && npm run build:napi -- --release && strip *.node - host: macos-latest target: aarch64-apple-darwin - build: | - npm run build:napi -- --release --target aarch64-apple-darwin + build: >- + set -e && + rustup target add aarch64-apple-darwin && + npm run build:napi -- --release --target aarch64-apple-darwin && strip -x *.node - host: ubuntu-latest target: aarch64-unknown-linux-gnu docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64 - build: |- + build: >- set -e && export JEMALLOC_SYS_WITH_LG_PAGE=16 && - rustup default nightly && + rustup default nightly-2023-10-05 && rustup target add aarch64-unknown-linux-gnu && npm run build:napi -- --release --target aarch64-unknown-linux-gnu && aarch64-unknown-linux-gnu-strip *.node @@ -119,18 +129,21 @@ jobs: setup: | sudo apt-get update sudo apt-get install gcc-arm-linux-gnueabihf -y - build: | - npm run build:napi -- --release --target armv7-unknown-linux-gnueabihf + build: >- + set -e && + npm run build:napi -- --release --target armv7-unknown-linux-gnueabihf && arm-linux-gnueabihf-strip *.node - host: ubuntu-latest target: aarch64-linux-android - build: | - npm run build:napi -- --release --target aarch64-linux-android + build: >- + set -e && + npm run build:napi -- --release --target aarch64-linux-android && ${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip *.node - host: ubuntu-latest target: armv7-linux-androideabi - build: | - npm run build:napi -- --release --target armv7-linux-androideabi + build: >- + set -e && + npm run build:napi -- --release --target armv7-linux-androideabi && ${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip *.node - host: ubuntu-latest target: aarch64-unknown-linux-musl @@ -138,7 +151,7 @@ jobs: build: >- set -e && export JEMALLOC_SYS_WITH_LG_PAGE=16 && - rustup default nightly && + rustup default nightly-2023-10-05 && rustup target add aarch64-unknown-linux-musl && RUSTFLAGS='-C target-feature=-crt-static -C linker=aarch64-linux-musl-gcc' npm run build:napi -- --release --target aarch64-unknown-linux-musl && /aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node @@ -160,7 +173,7 @@ jobs: uses: dtolnay/rust-toolchain@stable if: ${{ !matrix.settings.docker }} with: - toolchain: nightly + toolchain: nightly-2023-10-05 targets: ${{ matrix.settings.target }} - name: Cache cargo uses: actions/cache@v3 diff --git a/rust/rust-toolchain.toml b/rust/rust-toolchain.toml new file mode 100644 index 000000000..4e3afc318 --- /dev/null +++ b/rust/rust-toolchain.toml @@ -0,0 +1,5 @@ +[toolchain] +profile = "default" +# Use nightly for better access to the latest Rust features. +# This date is aligned to stable release dates. +channel = "nightly-2023-10-05" \ No newline at end of file From 2a86412433bd4e1a2a344db75ad180ade62a856e Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Mon, 9 Oct 2023 06:44:06 +0200 Subject: [PATCH 26/44] Fix toolchain for REPL workflow --- .github/workflows/repl-artefacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/repl-artefacts.yml b/.github/workflows/repl-artefacts.yml index d6403878a..6c7c03a50 100644 --- a/.github/workflows/repl-artefacts.yml +++ b/.github/workflows/repl-artefacts.yml @@ -26,7 +26,7 @@ jobs: - name: Install Toolchain uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly + toolchain: nightly-2023-10-05 targets: x86_64-unknown-linux-gnu - name: Cache cargo uses: actions/cache@v3 From e99ff72b3a60a4f5483a401b0423704675537ca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E8=89=AF=E4=BB=94?= <32487868+cijiugechu@users.noreply.github.com> Date: Mon, 9 Oct 2023 12:38:52 +0800 Subject: [PATCH 27/44] Resolve clippy errors (#5180) * resolve clippy errors * remove import in `bindings_wasm` --- rust/bindings_napi/src/lib.rs | 3 +-- rust/bindings_wasm/src/lib.rs | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/rust/bindings_napi/src/lib.rs b/rust/bindings_napi/src/lib.rs index ee4b8657c..fdb7a65fd 100644 --- a/rust/bindings_napi/src/lib.rs +++ b/rust/bindings_napi/src/lib.rs @@ -3,7 +3,6 @@ use napi::bindgen_prelude::*; use napi_derive::napi; use parse_ast::parse_ast; -use xxhash; #[napi] pub fn parse(code: String, allow_return_outside_function: bool) -> Buffer { @@ -12,5 +11,5 @@ pub fn parse(code: String, allow_return_outside_function: bool) -> Buffer { #[napi] pub fn xxhash_base64_url(input: Uint8Array) -> String { - xxhash::xxhash_base64_url(&input.to_vec()) + xxhash::xxhash_base64_url(&input) } diff --git a/rust/bindings_wasm/src/lib.rs b/rust/bindings_wasm/src/lib.rs index 5f7bec443..500176068 100644 --- a/rust/bindings_wasm/src/lib.rs +++ b/rust/bindings_wasm/src/lib.rs @@ -1,7 +1,6 @@ use js_sys::Uint8Array; use parse_ast::parse_ast; use wasm_bindgen::prelude::*; -use xxhash; #[wasm_bindgen] pub fn parse(code: String, allow_return_outside_function: bool) -> Vec { From c45366402e1841b6a2fd1f1bd0a4319571acd09f Mon Sep 17 00:00:00 2001 From: Tom Jenkinson Date: Mon, 9 Oct 2023 07:33:18 +0100 Subject: [PATCH 28/44] docs: fix code example for `onLog` (#5184) --- docs/configuration-options/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/configuration-options/index.md b/docs/configuration-options/index.md index ec73cac2a..cfa37140c 100755 --- a/docs/configuration-options/index.md +++ b/docs/configuration-options/index.md @@ -492,7 +492,7 @@ export default { if (level === 'warn') { handler('error', log); // turn other warnings into errors } else { - handler(level, info); // otherwise, just print the log + handler(level, log); // otherwise, just print the log } } }; From 080d2245ab6b6298229ebe7258c2b96816e7c52d Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Mon, 9 Oct 2023 09:07:48 +0200 Subject: [PATCH 29/44] Add clippy to pipeline and fix remaining issues (#5183) * Fix all clippy lints * Add clippy to pipeline * Fix toolchain for REPL --- package.json | 4 +- rust/bindings_napi/src/lib.rs | 2 - rust/parse_ast/src/convert_ast/annotations.rs | 5 +- rust/parse_ast/src/convert_ast/converter.rs | 286 ++++++++---------- .../convert_ast/converter/utf16_positions.rs | 6 +- rust/parse_ast/src/error_emit.rs | 4 +- rust/parse_ast/src/lib.rs | 3 +- rust/xxhash/src/lib.rs | 2 +- 8 files changed, 138 insertions(+), 174 deletions(-) diff --git a/package.json b/package.json index 327ddb2dd..0f793d993 100644 --- a/package.json +++ b/package.json @@ -58,8 +58,8 @@ "lint:js:nofix": "eslint . --cache", "lint:markdown": "prettier --write \"**/*.md\"", "lint:markdown:nofix": "prettier --check \"**/*.md\"", - "lint:rust": "cd rust && cargo fmt", - "lint:rust:nofix": "cd rust && cargo fmt --check", + "lint:rust": "cd rust && cargo fmt && cargo clippy --fix --allow-dirty", + "lint:rust:nofix": "cd rust && cargo fmt --check && cargo clippy", "perf": "npm run build:cjs && node --expose-gc scripts/perf.js", "perf:init": "node scripts/perf-init.js", "prepare": "husky install && node scripts/check-release.js || npm run build:prepare", diff --git a/rust/bindings_napi/src/lib.rs b/rust/bindings_napi/src/lib.rs index fdb7a65fd..261e82242 100644 --- a/rust/bindings_napi/src/lib.rs +++ b/rust/bindings_napi/src/lib.rs @@ -1,5 +1,3 @@ -#![deny(clippy::all)] - use napi::bindgen_prelude::*; use napi_derive::napi; use parse_ast::parse_ast; diff --git a/rust/parse_ast/src/convert_ast/annotations.rs b/rust/parse_ast/src/convert_ast/annotations.rs index 05ff58800..f5b8b78f4 100644 --- a/rust/parse_ast/src/convert_ast/annotations.rs +++ b/rust/parse_ast/src/convert_ast/annotations.rs @@ -8,9 +8,6 @@ pub struct SequentialComments { annotations: RefCell>, } -const ASCII_AT: u8 = '@' as u8; -const ASCII_HASH: u8 = '#' as u8; - impl SequentialComments { pub fn add_comment(&self, comment: Comment) { if comment.text.starts_with('#') && comment.text.contains("sourceMappingURL=") { @@ -31,7 +28,7 @@ impl SequentialComments { search_position += match_position; // Using a byte reference avoids UTF8 character boundary checks match &comment.text.as_bytes()[search_position - 1] { - &ASCII_AT | &ASCII_HASH => { + b'@' | b'#' => { let annotation_slice = &comment.text[search_position..]; if annotation_slice.starts_with("__PURE__") { self.annotations.borrow_mut().push(AnnotationWithType { diff --git a/rust/parse_ast/src/convert_ast/converter.rs b/rust/parse_ast/src/convert_ast/converter.rs index 07acfba41..fa183cca2 100644 --- a/rust/parse_ast/src/convert_ast/converter.rs +++ b/rust/parse_ast/src/convert_ast/converter.rs @@ -311,7 +311,7 @@ impl<'a> AstConverter<'a> { Some(self.convert_parenthesized_expression(parenthesized_expression)) } Expr::PrivateName(private_name) => { - self.convert_private_name(&private_name); + self.convert_private_name(private_name); None } Expr::Seq(sequence_expression) => { @@ -565,7 +565,7 @@ impl<'a> AstConverter<'a> { fn convert_property_or_spread(&mut self, property_or_spread: &PropOrSpread) { match property_or_spread { - PropOrSpread::Prop(property) => self.convert_property(&**property), + PropOrSpread::Prop(property) => self.convert_property(property), PropOrSpread::Spread(spread_element) => self.convert_spread_element(spread_element), } } @@ -598,10 +598,10 @@ impl<'a> AstConverter<'a> { ) -> (u32, u32) { let start = self.index_converter.convert( parenthesized_expression.span.lo.0 - 1, - match &*parenthesized_expression.expr { - Expr::Call(_) | Expr::New(_) | Expr::Paren(_) => true, - _ => false, - }, + matches!( + &*parenthesized_expression.expr, + Expr::Call(_) | Expr::New(_) | Expr::Paren(_) + ), ); self.convert_expression(&parenthesized_expression.expr); let end = self @@ -613,7 +613,7 @@ impl<'a> AstConverter<'a> { fn convert_optional_chain_base(&mut self, optional_chain_base: &OptChainBase, is_optional: bool) { match optional_chain_base { OptChainBase::Member(member_expression) => { - self.convert_member_expression(&member_expression, is_optional, true) + self.convert_member_expression(member_expression, is_optional, true) } OptChainBase::Call(optional_call) => { self.convert_optional_call(optional_call, is_optional, true) @@ -634,14 +634,14 @@ impl<'a> AstConverter<'a> { Callee::Expr(callee_expression) => self.store_call_expression( &call_expression.span, is_optional, - &StoredCallee::Expression(&callee_expression), + &StoredCallee::Expression(callee_expression), &call_expression.args, is_chained, ), Callee::Super(callee_super) => self.store_call_expression( &call_expression.span, is_optional, - &StoredCallee::Super(&callee_super), + &StoredCallee::Super(callee_super), &call_expression.args, is_chained, ), @@ -666,7 +666,7 @@ impl<'a> AstConverter<'a> { fn convert_export_declaration(&mut self, export_declaration: &ExportDecl) { self.store_export_named_declaration( &export_declaration.span, - &vec![], + &[], None, Some(&export_declaration.decl), &None, @@ -685,10 +685,7 @@ impl<'a> AstConverter<'a> { None | Some(ExportSpecifier::Named(_)) => self.store_export_named_declaration( &export_named_declaration.span, &export_named_declaration.specifiers, - export_named_declaration - .src - .as_ref() - .map(|source| &**source), + export_named_declaration.src.as_deref(), None, &export_named_declaration.with, ), @@ -748,7 +745,7 @@ impl<'a> AstConverter<'a> { &mut keep_checking_directives, |ast_converter, module_item, can_be_directive| { if *can_be_directive { - if let ModuleItem::Stmt(Stmt::Expr(expression)) = &*module_item { + if let ModuleItem::Stmt(Stmt::Expr(expression)) = module_item { if let Expr::Lit(Lit::Str(string)) = &*expression.expr { ast_converter.convert_expression_statement(expression, Some(&string.value)); return true; @@ -767,7 +764,7 @@ impl<'a> AstConverter<'a> { &mut keep_checking_directives, |ast_converter, statement, can_be_directive| { if *can_be_directive { - if let Stmt::Expr(expression) = &*statement { + if let Stmt::Expr(expression) = statement { if let Expr::Lit(Lit::Str(string)) = &*expression.expr { ast_converter.convert_expression_statement(expression, Some(&string.value)); return true; @@ -805,10 +802,10 @@ impl<'a> AstConverter<'a> { // expression self.convert_expression(&expression_statement.expr); // directive - directive.map(|directive| { + if let Some(directive) = directive { self.update_reference_position(reference_position); self.convert_string(directive); - }); + } // end self.add_end(end_position, &expression_statement.span); } @@ -816,7 +813,7 @@ impl<'a> AstConverter<'a> { fn store_export_named_declaration( &mut self, span: &Span, - specifiers: &Vec, + specifiers: &[ExportSpecifier], src: Option<&Str>, declaration: Option<&Decl>, with: &Option>, @@ -838,15 +835,15 @@ impl<'a> AstConverter<'a> { true }); // declaration - declaration.map(|declaration| { + if let Some(declaration) = declaration { self.update_reference_position(reference_position); - self.convert_declaration(declaration) - }); + self.convert_declaration(declaration); + } // src - src.map(|src| { + if let Some(src) = src { self.update_reference_position(reference_position + 4); - self.convert_literal_string(src) - }); + self.convert_literal_string(src); + } // attributes self.update_reference_position(reference_position + 8); self.store_import_attributes(with); @@ -861,10 +858,10 @@ impl<'a> AstConverter<'a> { // value, needs to be little endian as we are reading via a DataView self.buffer.extend_from_slice(&literal.value.to_le_bytes()); // raw - literal.raw.as_ref().map(|raw| { + if let Some(raw) = literal.raw.as_ref() { self.update_reference_position(reference_position); - self.convert_string(&*raw); - }); + self.convert_string(raw); + } } fn convert_literal_string(&mut self, literal: &Str) { @@ -874,20 +871,17 @@ impl<'a> AstConverter<'a> { // value self.convert_string(&literal.value); // raw - literal.raw.as_ref().map(|raw| { + if let Some(raw) = literal.raw.as_ref() { self.update_reference_position(reference_position); - self.convert_string(&*raw); - }); + self.convert_string(raw); + } } fn convert_variable_declaration(&mut self, variable_declaration: &VarDecl) { let end_position = self.add_type_and_start_and_handle_annotations( &TYPE_VARIABLE_DECLARATION, &variable_declaration.span, - match variable_declaration.kind { - VarDeclKind::Const => true, - _ => false, - }, + matches!(variable_declaration.kind, VarDeclKind::Const), ); self .buffer @@ -927,13 +921,13 @@ impl<'a> AstConverter<'a> { // id self.convert_pattern(&variable_declarator.name); // init - forwarded_annotations.map(|annotations| { + if let Some(annotations) = forwarded_annotations { self.index_converter.add_collected_annotations(annotations); - }); - variable_declarator.init.as_ref().map(|init| { + } + if let Some(init) = variable_declarator.init.as_ref() { self.update_reference_position(reference_position); - self.convert_expression(&init); - }); + self.convert_expression(init); + } // end self.add_end(end_position, &variable_declarator.span); } @@ -954,10 +948,10 @@ impl<'a> AstConverter<'a> { // local self.convert_module_export_name(&export_named_specifier.orig); // exported - export_named_specifier.exported.as_ref().map(|exported| { + if let Some(exported) = export_named_specifier.exported.as_ref() { self.update_reference_position(reference_position); - self.convert_module_export_name(&exported); - }); + self.convert_module_export_name(exported); + } // end self.add_end(end_position, &export_named_specifier.span); } @@ -976,7 +970,7 @@ impl<'a> AstConverter<'a> { ); // src self.update_reference_position(reference_position); - self.convert_literal_string(&*import_declaration.src); + self.convert_literal_string(&import_declaration.src); // attributes self.update_reference_position(reference_position + 4); self.store_import_attributes(&import_declaration.with); @@ -1002,17 +996,17 @@ impl<'a> AstConverter<'a> { } } - fn store_import_expression(&mut self, span: &Span, arguments: &Vec) { + fn store_import_expression(&mut self, span: &Span, arguments: &[ExprOrSpread]) { let end_position = self.add_type_and_start(&TYPE_IMPORT_EXPRESSION, span); // reserve for options let reference_position = self.reserve_reference_positions(1); // source - self.convert_expression(&*arguments.first().unwrap().expr); + self.convert_expression(&arguments.first().unwrap().expr); // options - arguments.get(1).map(|argument| { + if let Some(argument) = arguments.get(1) { self.update_reference_position(reference_position); self.convert_expression_or_spread(argument); - }); + } // end self.add_end(end_position, span); } @@ -1071,10 +1065,10 @@ impl<'a> AstConverter<'a> { // reserve for imported, local let reference_position = self.reserve_reference_positions(2); // imported - import_named_specifier.imported.as_ref().map(|imported| { + if let Some(imported) = import_named_specifier.imported.as_ref() { self.update_reference_position(reference_position); - self.convert_module_export_name(&imported); - }); + self.convert_module_export_name(imported); + } // local self.update_reference_position(reference_position + 4); self.convert_identifier(&import_named_specifier.local); @@ -1133,7 +1127,7 @@ impl<'a> AstConverter<'a> { &mut keep_checking_directives, |ast_converter, statement, can_be_directive| { if *can_be_directive { - if let Stmt::Expr(expression) = &*statement { + if let Stmt::Expr(expression) = statement { if let Expr::Lit(Lit::Str(string)) = &*expression.expr { ast_converter.convert_expression_statement(expression, Some(&string.value)); return true; @@ -1186,10 +1180,7 @@ impl<'a> AstConverter<'a> { // optional self.convert_boolean(is_optional); // computed - self.convert_boolean(match property { - MemberOrSuperProp::Computed(_) => true, - _ => false, - }); + self.convert_boolean(matches!(property, MemberOrSuperProp::Computed(_))); // reserve property let reference_position = self.reserve_reference_positions(1); // object @@ -1206,16 +1197,16 @@ impl<'a> AstConverter<'a> { ExpressionOrSuper::Expression(expression) => { self.convert_expression(expression); } - ExpressionOrSuper::Super(super_token) => self.convert_super(&super_token), + ExpressionOrSuper::Super(super_token) => self.convert_super(super_token), } // property self.update_reference_position(reference_position); match property { - MemberOrSuperProp::Identifier(ident) => self.convert_identifier(&ident), + MemberOrSuperProp::Identifier(ident) => self.convert_identifier(ident), MemberOrSuperProp::Computed(computed) => { self.convert_expression(&computed.expr); } - MemberOrSuperProp::PrivateName(private_name) => self.convert_private_name(&private_name), + MemberOrSuperProp::PrivateName(private_name) => self.convert_private_name(private_name), } // end self.add_end(end_position, span); @@ -1278,10 +1269,10 @@ impl<'a> AstConverter<'a> { &export_default_declaration.span, match &export_default_declaration.decl { DefaultDecl::Class(class_expression) => { - StoredDefaultExportExpression::Class(&class_expression) + StoredDefaultExportExpression::Class(class_expression) } DefaultDecl::Fn(function_expression) => { - StoredDefaultExportExpression::Function(&function_expression) + StoredDefaultExportExpression::Function(function_expression) } DefaultDecl::TsInterfaceDecl(_) => { unimplemented!("Cannot convert ExportDefaultDeclaration with TsInterfaceDecl") @@ -1298,19 +1289,19 @@ impl<'a> AstConverter<'a> { let end_position = self.add_type_and_start_and_handle_annotations( &TYPE_EXPORT_DEFAULT_DECLARATION, span, - match expression { + matches!( + expression, StoredDefaultExportExpression::Expression(Expr::Fn(_) | Expr::Arrow(_)) - | StoredDefaultExportExpression::Function(_) => true, - _ => false, - }, + | StoredDefaultExportExpression::Function(_) + ), ); // expression match expression { StoredDefaultExportExpression::Expression(expression) => { - self.convert_expression(&expression); + self.convert_expression(expression); } StoredDefaultExportExpression::Class(class_expression) => { - self.convert_class_expression(&class_expression, &TYPE_CLASS_DECLARATION) + self.convert_class_expression(class_expression, &TYPE_CLASS_DECLARATION) } StoredDefaultExportExpression::Function(function_expression) => self.convert_function( &function_expression.function, @@ -1351,10 +1342,10 @@ impl<'a> AstConverter<'a> { // reserve exported, source, attributes let reference_position = self.reserve_reference_positions(3); // exported - exported.map(|exported| { + if let Some(exported) = exported { self.update_reference_position(reference_position); self.convert_module_export_name(exported); - }); + } // source self.update_reference_position(reference_position + 4); self.convert_literal_string(source); @@ -1485,6 +1476,7 @@ impl<'a> AstConverter<'a> { node_type: &[u8; 4], identifier: Option<&Ident>, ) { + let parameters: Vec<&Pat> = function.params.iter().map(|param| ¶m.pat).collect(); self.store_function_node( node_type, function.span.lo.0 - 1, @@ -1492,7 +1484,7 @@ impl<'a> AstConverter<'a> { function.is_async, function.is_generator, identifier, - &function.params.iter().map(|param| ¶m.pat).collect(), + ¶meters, function.body.as_ref().unwrap(), true, ); @@ -1520,17 +1512,17 @@ impl<'a> AstConverter<'a> { let reference_position = self.reserve_reference_positions(3); let mut body_start_search = class.span.lo.0 - 1; // id - identifier.map(|identifier| { + if let Some(identifier) = identifier { self.update_reference_position(reference_position); self.convert_identifier(identifier); body_start_search = identifier.span.hi.0 - 1; - }); + } // super_class - class.super_class.as_ref().map(|super_class| { + if let Some(super_class) = class.super_class.as_ref() { self.update_reference_position(reference_position + 4); self.convert_expression(super_class); body_start_search = self.get_expression_span(super_class).hi.0 - 1; - }); + } // body self.update_reference_position(reference_position + 8); let class_body_start = @@ -1540,14 +1532,11 @@ impl<'a> AstConverter<'a> { self.add_end(end_position, &class.span); } - fn convert_class_body(&mut self, class_members: &Vec, start: u32, end: u32) { + fn convert_class_body(&mut self, class_members: &[ClassMember], start: u32, end: u32) { let end_position = self.add_type_and_explicit_start(&TYPE_CLASS_BODY, start); let class_members_filtered: Vec<&ClassMember> = class_members .iter() - .filter(|class_member| match class_member { - ClassMember::Empty(_) => false, - _ => true, - }) + .filter(|class_member| !matches!(class_member, ClassMember::Empty(_))) .collect(); // body self.convert_item_list(&class_members_filtered, |ast_converter, class_member| { @@ -1629,15 +1618,15 @@ impl<'a> AstConverter<'a> { None } PropName::Str(string) => { - self.convert_literal_string(&string); + self.convert_literal_string(string); None } PropName::Num(number) => { - self.convert_literal_number(&number); + self.convert_literal_number(number); None } PropName::BigInt(bigint) => { - self.convert_literal_bigint(&bigint); + self.convert_literal_bigint(bigint); None } } @@ -1664,10 +1653,7 @@ impl<'a> AstConverter<'a> { // method self.convert_boolean(false); // computed - self.convert_boolean(match property_name { - PropName::Computed(_) => true, - _ => false, - }); + self.convert_boolean(matches!(property_name, PropName::Computed(_))); // shorthand self.convert_boolean(false); // reserve key, value @@ -1725,10 +1711,7 @@ impl<'a> AstConverter<'a> { // method self.convert_boolean(false); // computed - self.convert_boolean(match &key { - PropName::Computed(_) => true, - _ => false, - }); + self.convert_boolean(matches!(key, PropName::Computed(_))); // shorthand self.convert_boolean(false); // reserve key, value @@ -1736,7 +1719,7 @@ impl<'a> AstConverter<'a> { // key self.update_reference_position(reference_position); self.convert_property_name(key); - let key_end = self.get_property_name_span(&key).hi.0 - 1; + let key_end = self.get_property_name_span(key).hi.0 - 1; // value let block_statement = body.as_ref().expect("Getter/setter property without body"); self.update_reference_position(reference_position + 4); @@ -1786,10 +1769,7 @@ impl<'a> AstConverter<'a> { // method self.convert_boolean(true); // computed - self.convert_boolean(match &method_property.key { - PropName::Computed(_) => true, - _ => false, - }); + self.convert_boolean(matches!(&method_property.key, PropName::Computed(_))); // shorthand self.convert_boolean(false); // reserve key, value @@ -1802,6 +1782,7 @@ impl<'a> AstConverter<'a> { // value self.update_reference_position(reference_position + 4); let function = &method_property.function; + let parameters: Vec<&Pat> = function.params.iter().map(|param| ¶m.pat).collect(); self.store_function_node( &TYPE_FUNCTION_EXPRESSION, function_start, @@ -1809,7 +1790,7 @@ impl<'a> AstConverter<'a> { function.is_async, function.is_generator, None, - &function.params.iter().map(|param| ¶m.pat).collect(), + ¶meters, function.body.as_ref().unwrap(), false, ); @@ -1924,7 +1905,7 @@ impl<'a> AstConverter<'a> { if let Some(expressions_or_spread) = &new_expression.args { self.update_reference_position(reference_position + 4); self.convert_item_list( - &expressions_or_spread, + expressions_or_spread, |ast_converter, expression_or_spread| { ast_converter.convert_expression_or_spread(expression_or_spread); true @@ -1935,6 +1916,7 @@ impl<'a> AstConverter<'a> { self.add_end(end_position, &new_expression.span); } + #[allow(clippy::too_many_arguments)] fn store_function_node( &mut self, node_type: &[u8; 4], @@ -1943,7 +1925,7 @@ impl<'a> AstConverter<'a> { is_async: bool, is_generator: bool, identifier: Option<&Ident>, - parameters: &Vec<&Pat>, + parameters: &[&Pat], body: &BlockStmt, observe_annotations: bool, ) { @@ -1967,14 +1949,14 @@ impl<'a> AstConverter<'a> { self.buffer.extend_from_slice(&0u32.to_ne_bytes()); } // id - identifier.map(|ident| { + if let Some(ident) = identifier { self.update_reference_position(reference_position); self.convert_identifier(ident); - }); + } // params self.update_reference_position(reference_position + 4); self.convert_item_list(parameters, |ast_converter, param| { - ast_converter.convert_pattern(¶m); + ast_converter.convert_pattern(param); true }); // body @@ -2013,9 +1995,9 @@ impl<'a> AstConverter<'a> { let left_position = (self.buffer.len() >> 2) as u32; match left { PatternOrIdentifier::Pattern(pattern) => { - self.convert_pattern(&pattern); + self.convert_pattern(pattern); } - PatternOrIdentifier::Identifier(identifier) => self.convert_identifier(&identifier), + PatternOrIdentifier::Identifier(identifier) => self.convert_identifier(identifier), } // right self.update_reference_position(reference_position); @@ -2051,10 +2033,10 @@ impl<'a> AstConverter<'a> { // reserve label let reference_position = self.reserve_reference_positions(1); // label - break_statement.label.as_ref().map(|label| { + if let Some(label) = break_statement.label.as_ref() { self.update_reference_position(reference_position); self.convert_identifier(label); - }); + } // end self.add_end(end_position, &break_statement.span); } @@ -2066,15 +2048,15 @@ impl<'a> AstConverter<'a> { // block self.convert_block_statement(&try_statement.block, false); // handler - try_statement.handler.as_ref().map(|catch_clause| { + if let Some(catch_clause) = try_statement.handler.as_ref() { self.update_reference_position(reference_position); self.convert_catch_clause(catch_clause); - }); + } // finalizer - try_statement.finalizer.as_ref().map(|block_statement| { + if let Some(block_statement) = try_statement.finalizer.as_ref() { self.update_reference_position(reference_position + 4); self.convert_block_statement(block_statement, false); - }); + } // end self.add_end(end_position, &try_statement.span); } @@ -2084,10 +2066,10 @@ impl<'a> AstConverter<'a> { // reserve param, body let reference_position = self.reserve_reference_positions(2); // param - catch_clause.param.as_ref().map(|pattern| { + if let Some(pattern) = catch_clause.param.as_ref() { self.update_reference_position(reference_position); self.convert_pattern(pattern); - }); + } // body self.update_reference_position(reference_position + 4); self.convert_block_statement(&catch_clause.body, false); @@ -2136,10 +2118,10 @@ impl<'a> AstConverter<'a> { // reserve label let reference_position = self.reserve_reference_positions(1); // label - continue_statement.label.as_ref().map(|label| { + if let Some(label) = continue_statement.label.as_ref() { self.update_reference_position(reference_position); self.convert_identifier(label); - }); + } // end self.add_end(end_position, &continue_statement.span); } @@ -2204,20 +2186,20 @@ impl<'a> AstConverter<'a> { // reserve init, test, update, body let reference_position = self.reserve_reference_positions(4); // init - for_statement.init.as_ref().map(|init| { + if let Some(init) = for_statement.init.as_ref() { self.update_reference_position(reference_position); self.convert_variable_declaration_or_expression(init); - }); + } // test - for_statement.test.as_ref().map(|test| { + if let Some(test) = for_statement.test.as_ref() { self.update_reference_position(reference_position + 4); self.convert_expression(test); - }); + } // update - for_statement.update.as_ref().map(|update| { + if let Some(update) = for_statement.update.as_ref() { self.update_reference_position(reference_position + 8); self.convert_expression(update); - }); + } // body self.update_reference_position(reference_position + 12); self.convert_statement(&for_statement.body); @@ -2235,10 +2217,10 @@ impl<'a> AstConverter<'a> { self.update_reference_position(reference_position); self.convert_statement(&if_statement.cons); // alternate - if_statement.alt.as_ref().map(|alt| { + if let Some(alt) = if_statement.alt.as_ref() { self.update_reference_position(reference_position + 4); self.convert_statement(alt); - }); + } // end self.add_end(end_position, &if_statement.span); } @@ -2323,6 +2305,14 @@ impl<'a> AstConverter<'a> { self.update_reference_position(reference_position); let key_end = self.get_property_name_span(&constructor.key).hi.0 - 1; let function_start = find_first_occurrence_outside_comment(self.code, b'(', key_end); + let parameters: Vec<&Pat> = constructor + .params + .iter() + .map(|param| match param { + ParamOrTsParamProp::Param(param) => ¶m.pat, + ParamOrTsParamProp::TsParamProp(_) => panic!("TsParamProp in constructor"), + }) + .collect(); self.store_function_node( &TYPE_FUNCTION_EXPRESSION, function_start, @@ -2330,14 +2320,7 @@ impl<'a> AstConverter<'a> { false, false, None, - &constructor - .params - .iter() - .map(|param| match param { - ParamOrTsParamProp::Param(param) => ¶m.pat, - ParamOrTsParamProp::TsParamProp(_) => panic!("TsParamProp in constructor"), - }) - .collect(), + ¶meters, block_statement, false, ); @@ -2356,10 +2339,7 @@ impl<'a> AstConverter<'a> { &method.kind, method.is_static, PropOrPrivateName::PropName(&method.key), - match method.key { - PropName::Computed(_) => true, - _ => false, - }, + matches!(method.key, PropName::Computed(_)), &method.function, ); } @@ -2400,17 +2380,18 @@ impl<'a> AstConverter<'a> { // key let key_end = match key { PropOrPrivateName::PropName(prop_name) => { - self.convert_property_name(&prop_name); - self.get_property_name_span(&prop_name).hi.0 - 1 + self.convert_property_name(prop_name); + self.get_property_name_span(prop_name).hi.0 - 1 } PropOrPrivateName::PrivateName(private_name) => { - self.convert_private_name(&private_name); + self.convert_private_name(private_name); private_name.id.span.hi.0 - 1 } }; let function_start = find_first_occurrence_outside_comment(self.code, b'(', key_end); // value self.update_reference_position(reference_position); + let parameters: Vec<&Pat> = function.params.iter().map(|param| ¶m.pat).collect(); self.store_function_node( &TYPE_FUNCTION_EXPRESSION, function_start, @@ -2418,7 +2399,7 @@ impl<'a> AstConverter<'a> { function.is_async, function.is_generator, None, - &function.params.iter().map(|param| ¶m.pat).collect(), + ¶meters, function.body.as_ref().unwrap(), false, ); @@ -2444,9 +2425,9 @@ impl<'a> AstConverter<'a> { // key match key { PropOrPrivateName::PropName(prop_name) => { - self.convert_property_name(&prop_name); + self.convert_property_name(prop_name); } - PropOrPrivateName::PrivateName(private_name) => self.convert_private_name(&private_name), + PropOrPrivateName::PrivateName(private_name) => self.convert_private_name(private_name), } // value value.map(|expression| { @@ -2460,16 +2441,10 @@ impl<'a> AstConverter<'a> { fn convert_class_property(&mut self, class_property: &ClassProp) { self.store_property_definition( &class_property.span, - match &class_property.key { - PropName::Computed(_) => true, - _ => false, - }, + matches!(&class_property.key, PropName::Computed(_)), class_property.is_static, PropOrPrivateName::PropName(&class_property.key), - &class_property - .value - .as_ref() - .map(|expression| &**expression), + &class_property.value.as_deref(), ); } @@ -2479,10 +2454,7 @@ impl<'a> AstConverter<'a> { false, private_property.is_static, PropOrPrivateName::PrivateName(&private_property.key), - &private_property - .value - .as_ref() - .map(|expression| &**expression), + &private_property.value.as_deref(), ); } @@ -2507,9 +2479,9 @@ impl<'a> AstConverter<'a> { false, &ExpressionOrSuper::Super(&super_property.obj), match &super_property.prop { - SuperProp::Ident(identifier) => MemberOrSuperProp::Identifier(&identifier), + SuperProp::Ident(identifier) => MemberOrSuperProp::Identifier(identifier), SuperProp::Computed(computed_property_name) => { - MemberOrSuperProp::Computed(&computed_property_name) + MemberOrSuperProp::Computed(computed_property_name) } }, false, @@ -2624,7 +2596,7 @@ impl<'a> AstConverter<'a> { for expression in template_literal.exprs.as_slice() { // convert expression let insert_position = (self.buffer.len() as u32) >> 2; - self.convert_expression(&expression); + self.convert_expression(expression); self.buffer[next_expression_position..next_expression_position + 4] .copy_from_slice(&insert_position.to_ne_bytes()); next_expression_position += 4; @@ -2649,10 +2621,10 @@ impl<'a> AstConverter<'a> { // raw self.convert_string(&template_element.raw); // cooked - template_element.cooked.as_ref().map(|cooked| { + if let Some(cooked) = template_element.cooked.as_ref() { self.update_reference_position(reference_position); - self.convert_string(cooked) - }); + self.convert_string(cooked); + } } fn convert_unary_expression(&mut self, unary_expression: &UnaryExpr) { diff --git a/rust/parse_ast/src/convert_ast/converter/utf16_positions.rs b/rust/parse_ast/src/convert_ast/converter/utf16_positions.rs index 73a930066..e52700aca 100644 --- a/rust/parse_ast/src/convert_ast/converter/utf16_positions.rs +++ b/rust/parse_ast/src/convert_ast/converter/utf16_positions.rs @@ -1,4 +1,3 @@ -use std::mem; use std::slice::Iter; use std::str::Chars; @@ -126,12 +125,11 @@ impl<'a> Utf8ToUtf16ByteIndexConverterAndAnnotationHandler<'a> { pub fn invalidate_collected_annotations(&mut self) { self .invalid_annotations - .extend(self.collected_annotations.drain(..)); + .append(&mut self.collected_annotations); } pub fn take_invalid_annotations(&mut self) -> Vec { - let invalid_annotations = mem::replace(&mut self.invalid_annotations, Vec::new()); - invalid_annotations + std::mem::take(&mut self.invalid_annotations) } } diff --git a/rust/parse_ast/src/error_emit.rs b/rust/parse_ast/src/error_emit.rs index f444ca859..428c5211f 100644 --- a/rust/parse_ast/src/error_emit.rs +++ b/rust/parse_ast/src/error_emit.rs @@ -42,7 +42,7 @@ impl Emitter for ErrorEmitter { pos = span.lo.0 - 1; }; let message = &db.message[0].0; - buffer.extend_from_slice(&(pos as u32).to_ne_bytes()); + buffer.extend_from_slice(&pos.to_ne_bytes()); convert_string(&mut buffer, message); let _ = self.wr.write(&buffer); } @@ -111,7 +111,7 @@ where } } -fn create_error_buffer(wr: &Box, code: &str) -> Vec { +fn create_error_buffer(wr: &Writer, code: &str) -> Vec { let mut buffer = TYPE_PARSE_ERROR.to_vec(); let mut lock = wr.0.lock(); let mut error_buffer = take(&mut *lock); diff --git a/rust/parse_ast/src/lib.rs b/rust/parse_ast/src/lib.rs index 992344420..21b6effeb 100644 --- a/rust/parse_ast/src/lib.rs +++ b/rust/parse_ast/src/lib.rs @@ -60,8 +60,7 @@ pub fn parse_ast(code: String, allow_return_outside_function: bool) -> Vec { Ok(program) => { let annotations = comments.take_annotations(); let converter = AstConverter::new(&code_reference, &annotations); - let buffer = converter.convert_ast_to_buffer(&program); - buffer + converter.convert_ast_to_buffer(&program) } } }) diff --git a/rust/xxhash/src/lib.rs b/rust/xxhash/src/lib.rs index cc43619e5..82f85e8ba 100644 --- a/rust/xxhash/src/lib.rs +++ b/rust/xxhash/src/lib.rs @@ -3,5 +3,5 @@ use xxhash_rust::xxh3::xxh3_128; pub fn xxhash_base64_url(input: &[u8]) -> String { let hash = xxh3_128(input).to_le_bytes(); - general_purpose::URL_SAFE_NO_PAD.encode(&hash) + general_purpose::URL_SAFE_NO_PAD.encode(hash) } From f52a2ebfdcd568b0876af3fadf9e85f7c4af6e5d Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Tue, 10 Oct 2023 06:44:42 +0200 Subject: [PATCH 30/44] Improve wording for native artifacts in migration guide (#5186) Improve wording for antive artifacts in migration guide --- docs/migration/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/migration/index.md b/docs/migration/index.md index aaf9d2b4f..f680cc3f4 100644 --- a/docs/migration/index.md +++ b/docs/migration/index.md @@ -20,7 +20,7 @@ For larger configs, it can make sense to update to `rollup@3.29.4` first, add th ## General Changes -Rollup now relies on some native code. For most users, this code should automatically be installed as an optional dependency depending on your platform and architecture. If your system is not supported, you can instead use `@rollup/wasm-node` as a platform-independent drop-in replacement. +Rollup now includes native code that is automatically installed (and removed) as an [optional npm dependency](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#optionaldependencies) if your platform and architecture is supported. More precisely, Rollup has a list of `optionalDependencies`, each of which only install on a specific [`os`](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#os) and [`cpu`](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#cpu). If your system is not supported, you will receive an error message when starting Rollup that will tell you about your platform and architecture and gives you a list of supported ones. In that case, you can instead use `@rollup/wasm-node` as a platform-independent drop-in replacement. Otherwise, an obvious change is that Rollup now uses url-safe base64 hashes in file names instead of the older base16 hashes. This provides more hash safety but means that hash length is now limited to at most 22 characters for technical reasons. From d90f274832b28429bd593ad0e34791ca7c2888ba Mon Sep 17 00:00:00 2001 From: XiaoPi <530257315@qq.com> Date: Wed, 11 Oct 2023 12:36:18 +0800 Subject: [PATCH 31/44] test: add verifyAst type (#5190) --- test/types.d.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/types.d.ts b/test/types.d.ts index f99a15b45..ff98ca6fa 100644 --- a/test/types.d.ts +++ b/test/types.d.ts @@ -169,6 +169,11 @@ export interface TestConfigForm extends TestConfigBase { * Rollup options for bundling. */ options?: RollupOptions; + /** + * Verify that the AST returned by SWC is the same as the one returned by Acorn. + * The default behavior is to verify. + */ + verifyAst?: boolean; } export interface TestConfigFunction extends TestConfigBase { @@ -224,6 +229,11 @@ export interface TestConfigFunction extends TestConfigBase { * Make assertions on the expected warnings. */ warnings?: RollupError[] | ((warnings: RollupError[]) => boolean | void); + /** + * Verify that the AST returned by SWC is the same as the one returned by Acorn. + * The default behavior is to verify. + */ + verifyAst?: boolean; } export interface TestConfigSourcemap extends TestConfigBase { From 97bffa81987b72a9fe6168962bc1fe38cb948048 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Fri, 13 Oct 2023 06:47:57 +0200 Subject: [PATCH 32/44] Enable Renovate automerge --- renovate.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/renovate.json b/renovate.json index 31bea8626..53a497781 100644 --- a/renovate.json +++ b/renovate.json @@ -20,6 +20,8 @@ } ], "automerge": true, + "automergeType": "pr", + "platformAutomerge": true, "internalChecksFilter": "strict", "lockFileMaintenance": { "enabled": true, From dddf626a77e15d4e0baa5f1689fd233634a29a9a Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Fri, 13 Oct 2023 07:58:35 +0200 Subject: [PATCH 33/44] Reduce workflow concurrency --- .github/workflows/build-and-tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-and-tests.yml b/.github/workflows/build-and-tests.yml index 661462e1d..93fa90e69 100644 --- a/.github/workflows/build-and-tests.yml +++ b/.github/workflows/build-and-tests.yml @@ -17,6 +17,10 @@ on: - reopened merge_group: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + permissions: contents: read From 4bcf4e124b534c5fe39cee12f683028f0895a635 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 13 Oct 2023 06:26:09 +0000 Subject: [PATCH 34/44] chore(deps): lock file maintenance minor/patch updates (#5197) * chore(deps): lock file maintenance minor/patch updates * Fix types --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Lukas Taegert-Atkinson Co-authored-by: Lukas Taegert-Atkinson --- package-lock.json | 926 +++++++++++++++++--------------- package.json | 24 +- rust/Cargo.lock | 362 ++++++++++--- rust/parse_ast/Cargo.toml | 16 +- src/rollup/types.d.ts | 6 +- src/utils/collapseSourcemaps.ts | 8 +- 6 files changed, 796 insertions(+), 546 deletions(-) diff --git a/package-lock.json b/package-lock.json index fb81647de..30bf44778 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,25 +17,25 @@ "@codemirror/language": "^6.9.1", "@codemirror/search": "^6.5.4", "@codemirror/state": "^6.2.1", - "@codemirror/view": "^6.21.2", + "@codemirror/view": "^6.21.3", "@jridgewell/sourcemap-codec": "^1.4.15", "@mermaid-js/mermaid-cli": "^10.4.0", "@napi-rs/cli": "^2.16.3", - "@rollup/plugin-alias": "^5.0.0", - "@rollup/plugin-buble": "^1.0.2", - "@rollup/plugin-commonjs": "^25.0.4", - "@rollup/plugin-json": "^6.0.0", - "@rollup/plugin-node-resolve": "^15.2.1", - "@rollup/plugin-replace": "^5.0.2", - "@rollup/plugin-terser": "^0.4.3", + "@rollup/plugin-alias": "^5.0.1", + "@rollup/plugin-buble": "^1.0.3", + "@rollup/plugin-commonjs": "^25.0.5", + "@rollup/plugin-json": "^6.0.1", + "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-replace": "^5.0.3", + "@rollup/plugin-terser": "^0.4.4", "@rollup/plugin-typescript": "11.1.4", - "@rollup/pluginutils": "^5.0.4", + "@rollup/pluginutils": "^5.0.5", "@types/estree": "1.0.2", "@types/mocha": "^10.0.2", "@types/node": "18.0.0", "@types/yargs-parser": "^21.0.1", - "@typescript-eslint/eslint-plugin": "^6.7.4", - "@typescript-eslint/parser": "^6.7.4", + "@typescript-eslint/eslint-plugin": "^6.7.5", + "@typescript-eslint/parser": "^6.7.5", "@vue/eslint-config-prettier": "^8.0.0", "@vue/eslint-config-typescript": "^12.0.0", "acorn": "^8.10.0", @@ -49,7 +49,7 @@ "date-time": "^4.0.0", "es5-shim": "^4.6.7", "es6-shim": "^0.35.8", - "eslint": "^8.50.0", + "eslint": "^8.51.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-import": "^2.28.1", "eslint-plugin-prettier": "^5.0.0", @@ -156,132 +156,132 @@ } }, "node_modules/@algolia/cache-browser-local-storage": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.19.1.tgz", - "integrity": "sha512-FYAZWcGsFTTaSAwj9Std8UML3Bu8dyWDncM7Ls8g+58UOe4XYdlgzXWbrIgjaguP63pCCbMoExKr61B+ztK3tw==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.20.0.tgz", + "integrity": "sha512-uujahcBt4DxduBTvYdwO3sBfHuJvJokiC3BP1+O70fglmE1ShkH8lpXqZBac1rrU3FnNYSUs4pL9lBdTKeRPOQ==", "dev": true, "dependencies": { - "@algolia/cache-common": "4.19.1" + "@algolia/cache-common": "4.20.0" } }, "node_modules/@algolia/cache-common": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/cache-common/-/cache-common-4.19.1.tgz", - "integrity": "sha512-XGghi3l0qA38HiqdoUY+wvGyBsGvKZ6U3vTiMBT4hArhP3fOGLXpIINgMiiGjTe4FVlTa5a/7Zf2bwlIHfRqqg==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/cache-common/-/cache-common-4.20.0.tgz", + "integrity": "sha512-vCfxauaZutL3NImzB2G9LjLt36vKAckc6DhMp05An14kVo8F1Yofb6SIl6U3SaEz8pG2QOB9ptwM5c+zGevwIQ==", "dev": true }, "node_modules/@algolia/cache-in-memory": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/cache-in-memory/-/cache-in-memory-4.19.1.tgz", - "integrity": "sha512-+PDWL+XALGvIginigzu8oU6eWw+o76Z8zHbBovWYcrtWOEtinbl7a7UTt3x3lthv+wNuFr/YD1Gf+B+A9V8n5w==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/cache-in-memory/-/cache-in-memory-4.20.0.tgz", + "integrity": "sha512-Wm9ak/IaacAZXS4mB3+qF/KCoVSBV6aLgIGFEtQtJwjv64g4ePMapORGmCyulCFwfePaRAtcaTbMcJF+voc/bg==", "dev": true, "dependencies": { - "@algolia/cache-common": "4.19.1" + "@algolia/cache-common": "4.20.0" } }, "node_modules/@algolia/client-account": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/client-account/-/client-account-4.19.1.tgz", - "integrity": "sha512-Oy0ritA2k7AMxQ2JwNpfaEcgXEDgeyKu0V7E7xt/ZJRdXfEpZcwp9TOg4TJHC7Ia62gIeT2Y/ynzsxccPw92GA==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/client-account/-/client-account-4.20.0.tgz", + "integrity": "sha512-GGToLQvrwo7am4zVkZTnKa72pheQeez/16sURDWm7Seyz+HUxKi3BM6fthVVPUEBhtJ0reyVtuK9ArmnaKl10Q==", "dev": true, "dependencies": { - "@algolia/client-common": "4.19.1", - "@algolia/client-search": "4.19.1", - "@algolia/transporter": "4.19.1" + "@algolia/client-common": "4.20.0", + "@algolia/client-search": "4.20.0", + "@algolia/transporter": "4.20.0" } }, "node_modules/@algolia/client-analytics": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-4.19.1.tgz", - "integrity": "sha512-5QCq2zmgdZLIQhHqwl55ZvKVpLM3DNWjFI4T+bHr3rGu23ew2bLO4YtyxaZeChmDb85jUdPDouDlCumGfk6wOg==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-4.20.0.tgz", + "integrity": "sha512-EIr+PdFMOallRdBTHHdKI3CstslgLORQG7844Mq84ib5oVFRVASuuPmG4bXBgiDbcsMLUeOC6zRVJhv1KWI0ug==", "dev": true, "dependencies": { - "@algolia/client-common": "4.19.1", - "@algolia/client-search": "4.19.1", - "@algolia/requester-common": "4.19.1", - "@algolia/transporter": "4.19.1" + "@algolia/client-common": "4.20.0", + "@algolia/client-search": "4.20.0", + "@algolia/requester-common": "4.20.0", + "@algolia/transporter": "4.20.0" } }, "node_modules/@algolia/client-common": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-4.19.1.tgz", - "integrity": "sha512-3kAIVqTcPrjfS389KQvKzliC559x+BDRxtWamVJt8IVp7LGnjq+aVAXg4Xogkur1MUrScTZ59/AaUd5EdpyXgA==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-4.20.0.tgz", + "integrity": "sha512-P3WgMdEss915p+knMMSd/fwiHRHKvDu4DYRrCRaBrsfFw7EQHon+EbRSm4QisS9NYdxbS04kcvNoavVGthyfqQ==", "dev": true, "dependencies": { - "@algolia/requester-common": "4.19.1", - "@algolia/transporter": "4.19.1" + "@algolia/requester-common": "4.20.0", + "@algolia/transporter": "4.20.0" } }, "node_modules/@algolia/client-personalization": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-4.19.1.tgz", - "integrity": "sha512-8CWz4/H5FA+krm9HMw2HUQenizC/DxUtsI5oYC0Jxxyce1vsr8cb1aEiSJArQT6IzMynrERif1RVWLac1m36xw==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-4.20.0.tgz", + "integrity": "sha512-N9+zx0tWOQsLc3K4PVRDV8GUeOLAY0i445En79Pr3zWB+m67V+n/8w4Kw1C5LlbHDDJcyhMMIlqezh6BEk7xAQ==", "dev": true, "dependencies": { - "@algolia/client-common": "4.19.1", - "@algolia/requester-common": "4.19.1", - "@algolia/transporter": "4.19.1" + "@algolia/client-common": "4.20.0", + "@algolia/requester-common": "4.20.0", + "@algolia/transporter": "4.20.0" } }, "node_modules/@algolia/client-search": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-4.19.1.tgz", - "integrity": "sha512-mBecfMFS4N+yK/p0ZbK53vrZbL6OtWMk8YmnOv1i0LXx4pelY8TFhqKoTit3NPVPwoSNN0vdSN9dTu1xr1XOVw==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-4.20.0.tgz", + "integrity": "sha512-zgwqnMvhWLdpzKTpd3sGmMlr4c+iS7eyyLGiaO51zDZWGMkpgoNVmltkzdBwxOVXz0RsFMznIxB9zuarUv4TZg==", "dev": true, "dependencies": { - "@algolia/client-common": "4.19.1", - "@algolia/requester-common": "4.19.1", - "@algolia/transporter": "4.19.1" + "@algolia/client-common": "4.20.0", + "@algolia/requester-common": "4.20.0", + "@algolia/transporter": "4.20.0" } }, "node_modules/@algolia/logger-common": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/logger-common/-/logger-common-4.19.1.tgz", - "integrity": "sha512-i6pLPZW/+/YXKis8gpmSiNk1lOmYCmRI6+x6d2Qk1OdfvX051nRVdalRbEcVTpSQX6FQAoyeaui0cUfLYW5Elw==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/logger-common/-/logger-common-4.20.0.tgz", + "integrity": "sha512-xouigCMB5WJYEwvoWW5XDv7Z9f0A8VoXJc3VKwlHJw/je+3p2RcDXfksLI4G4lIVncFUYMZx30tP/rsdlvvzHQ==", "dev": true }, "node_modules/@algolia/logger-console": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/logger-console/-/logger-console-4.19.1.tgz", - "integrity": "sha512-jj72k9GKb9W0c7TyC3cuZtTr0CngLBLmc8trzZlXdfvQiigpUdvTi1KoWIb2ZMcRBG7Tl8hSb81zEY3zI2RlXg==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/logger-console/-/logger-console-4.20.0.tgz", + "integrity": "sha512-THlIGG1g/FS63z0StQqDhT6bprUczBI8wnLT3JWvfAQDZX5P6fCg7dG+pIrUBpDIHGszgkqYEqECaKKsdNKOUA==", "dev": true, "dependencies": { - "@algolia/logger-common": "4.19.1" + "@algolia/logger-common": "4.20.0" } }, "node_modules/@algolia/requester-browser-xhr": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.19.1.tgz", - "integrity": "sha512-09K/+t7lptsweRTueHnSnmPqIxbHMowejAkn9XIcJMLdseS3zl8ObnS5GWea86mu3vy4+8H+ZBKkUN82Zsq/zg==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.20.0.tgz", + "integrity": "sha512-HbzoSjcjuUmYOkcHECkVTwAelmvTlgs48N6Owt4FnTOQdwn0b8pdht9eMgishvk8+F8bal354nhx/xOoTfwiAw==", "dev": true, "dependencies": { - "@algolia/requester-common": "4.19.1" + "@algolia/requester-common": "4.20.0" } }, "node_modules/@algolia/requester-common": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/requester-common/-/requester-common-4.19.1.tgz", - "integrity": "sha512-BisRkcWVxrDzF1YPhAckmi2CFYK+jdMT60q10d7z3PX+w6fPPukxHRnZwooiTUrzFe50UBmLItGizWHP5bDzVQ==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/requester-common/-/requester-common-4.20.0.tgz", + "integrity": "sha512-9h6ye6RY/BkfmeJp7Z8gyyeMrmmWsMOCRBXQDs4mZKKsyVlfIVICpcSibbeYcuUdurLhIlrOUkH3rQEgZzonng==", "dev": true }, "node_modules/@algolia/requester-node-http": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-4.19.1.tgz", - "integrity": "sha512-6DK52DHviBHTG2BK/Vv2GIlEw7i+vxm7ypZW0Z7vybGCNDeWzADx+/TmxjkES2h15+FZOqVf/Ja677gePsVItA==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-4.20.0.tgz", + "integrity": "sha512-ocJ66L60ABSSTRFnCHIEZpNHv6qTxsBwJEPfYaSBsLQodm0F9ptvalFkHMpvj5DfE22oZrcrLbOYM2bdPJRHng==", "dev": true, "dependencies": { - "@algolia/requester-common": "4.19.1" + "@algolia/requester-common": "4.20.0" } }, "node_modules/@algolia/transporter": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@algolia/transporter/-/transporter-4.19.1.tgz", - "integrity": "sha512-nkpvPWbpuzxo1flEYqNIbGz7xhfhGOKGAZS7tzC+TELgEmi7z99qRyTfNSUlW7LZmB3ACdnqAo+9A9KFBENviQ==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@algolia/transporter/-/transporter-4.20.0.tgz", + "integrity": "sha512-Lsii1pGWOAISbzeyuf+r/GPhvHMPHSPrTDWNcIzOE1SG1inlJHICaVe2ikuoRjcpgxZNU54Jl+if15SUCsaTUg==", "dev": true, "dependencies": { - "@algolia/cache-common": "4.19.1", - "@algolia/logger-common": "4.19.1", - "@algolia/requester-common": "4.19.1" + "@algolia/cache-common": "4.20.0", + "@algolia/logger-common": "4.20.0", + "@algolia/requester-common": "4.20.0" } }, "node_modules/@ampproject/remapping": { @@ -367,18 +367,18 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.20.tgz", - "integrity": "sha512-BQYjKbpXjoXwFW5jGqiizJQQT/aC7pFm9Ok1OWssonuguICi264lbgMzRp2ZMmRSlfkX6DsWDDcsrctK8Rwfiw==", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.2.tgz", + "integrity": "sha512-0S9TQMmDHlqAZ2ITT95irXKfxN9bncq8ZCoJhun3nHL/lLUxd2NKBJYoNGWH7S0hz6fRQwWlAWn/ILM0C70KZQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.0.tgz", - "integrity": "sha512-97z/ju/Jy1rZmDxybphrBuI+jtJjFVoz7Mr9yUQVVVi+DNZE333uFQeMOqcCIy1x3WYBIbWftUSLmbNXNT7qFQ==", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.2.tgz", + "integrity": "sha512-n7s51eWdaWZ3vGT2tD4T7J6eJs3QoBXydv7vkUM06Bf1cbVD2Kc2UrkzhiQwobfV7NwOnQXYL7UBJ5VPU+RGoQ==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.0", @@ -386,10 +386,10 @@ "@babel/generator": "^7.23.0", "@babel/helper-compilation-targets": "^7.22.15", "@babel/helper-module-transforms": "^7.23.0", - "@babel/helpers": "^7.23.0", + "@babel/helpers": "^7.23.2", "@babel/parser": "^7.23.0", "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.0", + "@babel/traverse": "^7.23.2", "@babel/types": "^7.23.0", "convert-source-map": "^2.0.0", "debug": "^4.1.0", @@ -489,12 +489,12 @@ } }, "node_modules/@babel/helper-module-imports": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz", - "integrity": "sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", + "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.22.15" }, "engines": { "node": ">=6.9.0" @@ -507,7 +507,7 @@ "dev": true, "dependencies": { "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-module-imports": "^7.22.5", + "@babel/helper-module-imports": "^7.22.15", "@babel/helper-simple-access": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", "@babel/helper-validator-identifier": "^7.22.20" @@ -571,13 +571,13 @@ } }, "node_modules/@babel/helpers": { - "version": "7.23.1", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.1.tgz", - "integrity": "sha512-chNpneuK18yW5Oxsr+t553UZzzAs3aZnFm4bxhebsNTeshrC95yA7l5yl7GBAG+JG1rF0F7zzD2EixK9mWSDoA==", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.2.tgz", + "integrity": "sha512-lzchcp8SjTSVe/fPmLwtWVBFC7+Tbn8LGHDVfDp9JGxpAY5opSaEFgt8UQvrnECWOTdji2mOWMz1rOhkHscmGQ==", "dev": true, "dependencies": { "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.0", + "@babel/traverse": "^7.23.2", "@babel/types": "^7.23.0" }, "engines": { @@ -667,9 +667,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.23.1", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.1.tgz", - "integrity": "sha512-hC2v6p8ZSI/W0HUzh3V8C5g+NwSKzKPtJwSpTjwl0o297GP9+ZLQSkdvHz46CM3LqyoXxq+5G9komY+eSqSO0g==", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.2.tgz", + "integrity": "sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg==", "dev": true, "dependencies": { "regenerator-runtime": "^0.14.0" @@ -693,9 +693,9 @@ } }, "node_modules/@babel/traverse": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.0.tgz", - "integrity": "sha512-t/QaEvyIoIkwzpiZ7aoSKK8kObQYeF7T2v+dazAYCb8SXtp58zEVkWW7zAnju8FNKNdr4ScAOEDmMItbyOmEYw==", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", "dev": true, "dependencies": { "@babel/code-frame": "^7.22.13", @@ -737,14 +737,14 @@ } }, "node_modules/@codemirror/autocomplete": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.9.0.tgz", - "integrity": "sha512-Fbwm0V/Wn3BkEJZRhr0hi5BhCo5a7eBL6LYaliPjOSwCyfOpnjXY59HruSxOUNV+1OYer0Tgx1zRNQttjXyDog==", + "version": "6.10.1", + "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.10.1.tgz", + "integrity": "sha512-wKfeYuf4Dsz0r/jvhIoN9k9KrFAhK8x+YZ0E9HfbgJ0ZJ+AmoNbmjSDv6HQ/tBSjgb3H00wn1XrdmhRkOQxsew==", "dev": true, "dependencies": { "@codemirror/language": "^6.0.0", "@codemirror/state": "^6.0.0", - "@codemirror/view": "^6.6.0", + "@codemirror/view": "^6.17.0", "@lezer/common": "^1.0.0" }, "peerDependencies": { @@ -796,9 +796,9 @@ } }, "node_modules/@codemirror/lint": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.4.0.tgz", - "integrity": "sha512-6VZ44Ysh/Zn07xrGkdtNfmHCbGSHZzFBdzWi0pbd7chAQ/iUcpLGX99NYRZTa7Ugqg4kEHCqiHhcZnH0gLIgSg==", + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.4.2.tgz", + "integrity": "sha512-wzRkluWb1ptPKdzlsrbwwjYCPLgzU6N88YBAmlZi8WFyuiEduSd05MnJYNogzyc8rPK7pj6m95ptUApc8sHKVA==", "dev": true, "dependencies": { "@codemirror/state": "^6.0.0", @@ -818,15 +818,15 @@ } }, "node_modules/@codemirror/state": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.2.1.tgz", - "integrity": "sha512-RupHSZ8+OjNT38zU9fKH2sv+Dnlr8Eb8sl4NOnnqz95mCFTZUaiRP8Xv5MeeaG0px2b8Bnfe7YGwCV3nsBhbuw==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.3.0.tgz", + "integrity": "sha512-5fIS19U46PEqczbBL6gBAtju9MFDT9TjIC/q2MYblHCEKiU8jhV3cRFhvQu5tQvbtxc5KLWxSnzMNh3ZqeaXVg==", "dev": true }, "node_modules/@codemirror/view": { - "version": "6.21.2", - "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.21.2.tgz", - "integrity": "sha512-EZ/Q1WeMWVarWiZHcy4E2aOjjDySeipVkPawOIu2iViZ1YNaZXPBqJBd9/2zLJtN/MrXKm0V1mHB8Cxn50t91A==", + "version": "6.21.3", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.21.3.tgz", + "integrity": "sha512-8l1aSQ6MygzL4Nx7GVYhucSXvW4jQd0F6Zm3v9Dg+6nZEfwzJVqi4C2zHfDljID+73gsQrWp9TgHc81xU15O4A==", "dev": true, "dependencies": { "@codemirror/state": "^6.1.4", @@ -1250,9 +1250,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.9.0.tgz", - "integrity": "sha512-zJmuCWj2VLBt4c25CfBIbMZLGLyhkvs7LznyVX5HfpzeocThgIj5XQK4L+g3U36mMcx8bPMhGyPpwCATamC4jQ==", + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.9.1.tgz", + "integrity": "sha512-Y27x+MBLjXa+0JWDhykM3+JE+il3kHKAEqabfEWq3SDhZjLYb6/BHL/JKFnH3fe207JaXkyDo685Oc2Glt6ifA==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -1282,9 +1282,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.50.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.50.0.tgz", - "integrity": "sha512-NCC3zz2+nvYd+Ckfh87rA47zfu2QsQpvc6k1yzTk+b9KzRj0wkGa8LSoGOXN6Zv4lRf/EIoZ80biDh9HOI+RNQ==", + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.51.0.tgz", + "integrity": "sha512-HxjQ8Qn+4SI3/AFv6sOrDB+g6PpUTDwSJiQqOrnneEk8L71161srI9gjzzZvYVbzHiVg/BvcH95+cK/zfIt4pg==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1505,9 +1505,9 @@ } }, "node_modules/@lezer/javascript": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.4.7.tgz", - "integrity": "sha512-OVWlK0YEi7HM+9JRWtRkir8qvcg0/kVYg2TAMHlVtl6DU1C9yK1waEOLBMztZsV/axRJxsqfJKhzYz+bxZme5g==", + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.4.8.tgz", + "integrity": "sha512-QRmw/5xrcyRLyWr3JT3KCzn2XZr5NYNqQMGsqnYy+FghbQn9DZPuj6JDkE6uSXvfMLpdapu8KBIaeoJFaR4QVw==", "dev": true, "dependencies": { "@lezer/highlight": "^1.1.3", @@ -1515,27 +1515,30 @@ } }, "node_modules/@lezer/lr": { - "version": "1.3.12", - "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.3.12.tgz", - "integrity": "sha512-5nwY1JzCueUdRtlMBnlf1SUi69iGCq2ABq7WQFQMkn/kxPvoACAEnTp4P17CtXxYr7WCwtYPLL2AEvxKPuF1OQ==", + "version": "1.3.13", + "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.3.13.tgz", + "integrity": "sha512-RLAbau/4uSzKgIKj96mI5WUtG1qtiR0Frn0Ei9zhPj8YOkHM+1Bb8SgdVvmR/aWJCFIzjo2KFnDiRZ75Xf5NdQ==", "dev": true, "dependencies": { "@lezer/common": "^1.0.0" } }, "node_modules/@ljharb/through": { - "version": "2.3.9", - "resolved": "https://registry.npmjs.org/@ljharb/through/-/through-2.3.9.tgz", - "integrity": "sha512-yN599ZBuMPPK4tdoToLlvgJB4CLK8fGl7ntfy0Wn7U6ttNvHYurd81bfUiK/6sMkiIwm65R6ck4L6+Y3DfVbNQ==", + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/@ljharb/through/-/through-2.3.11.tgz", + "integrity": "sha512-ccfcIDlogiXNq5KcbAwbaO7lMh3Tm1i3khMPYpxlK8hH/W53zN81KM9coerRLOnTGu3nfXIniAmQbRI9OxbC0w==", "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, "engines": { "node": ">= 0.4" } }, "node_modules/@mermaid-js/mermaid-cli": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/@mermaid-js/mermaid-cli/-/mermaid-cli-10.4.0.tgz", - "integrity": "sha512-sXohfGD6xgR8VEKvLdvSCndFaFNVTlyXjgZlJ3x8U3/J0V2VTfLIZO94Gt8KUPUccFWci8dRYDGG0fQerB+aIA==", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/@mermaid-js/mermaid-cli/-/mermaid-cli-10.5.0.tgz", + "integrity": "sha512-sZ8ec+zK0tBpyyIZ1QbWsvlecIMxHL9MQAxJCwxmp5nB3PN9m4uFeVpAV86Eec0Ivuu3kiyijNkK2zdZnWXXFA==", "dev": true, "dependencies": { "chalk": "^5.0.1", @@ -1669,9 +1672,9 @@ } }, "node_modules/@rollup/plugin-alias": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-alias/-/plugin-alias-5.0.0.tgz", - "integrity": "sha512-l9hY5chSCjuFRPsnRm16twWBiSApl2uYFLsepQYwtBuAxNMQ/1dJqADld40P0Jkqm65GRTLy/AC6hnpVebtLsA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-alias/-/plugin-alias-5.0.1.tgz", + "integrity": "sha512-JObvbWdOHoMy9W7SU0lvGhDtWq9PllP5mjpAy+TUslZG/WzOId9u80Hsqq1vCUn9pFJ0cxpdcnAv+QzU2zFH3Q==", "dev": true, "dependencies": { "slash": "^4.0.0" @@ -1680,7 +1683,7 @@ "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0" + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" }, "peerDependenciesMeta": { "rollup": { @@ -1689,9 +1692,9 @@ } }, "node_modules/@rollup/plugin-buble": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@rollup/plugin-buble/-/plugin-buble-1.0.2.tgz", - "integrity": "sha512-Hz9+AigRWwS93vmorrVrhyG9SdSCZAkBDx614w09iFQYFUAP2HmdUrQyZsb1WO2n+iDvPFznrTE16la+eGNcEQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-buble/-/plugin-buble-1.0.3.tgz", + "integrity": "sha512-QYD9BKkJoof0FdCFeSYYhF6/Y8e0Mnf+098xGgmWOFJ4UPHlWujjqOYeVwEm2hJPOmlR5k7HPUdAjqtOWhN64Q==", "dev": true, "dependencies": { "@rollup/pluginutils": "^5.0.1", @@ -1702,7 +1705,7 @@ "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0" + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" }, "peerDependenciesMeta": { "rollup": { @@ -1711,9 +1714,9 @@ } }, "node_modules/@rollup/plugin-commonjs": { - "version": "25.0.4", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-25.0.4.tgz", - "integrity": "sha512-L92Vz9WUZXDnlQQl3EwbypJR4+DM2EbsO+/KOcEkP4Mc6Ct453EeDB2uH9lgRwj4w5yflgNpq9pHOiY8aoUXBQ==", + "version": "25.0.5", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-25.0.5.tgz", + "integrity": "sha512-xY8r/A9oisSeSuLCTfhssyDjo9Vp/eDiRLXkg1MXCcEEgEjPmLU+ZyDB20OOD0NlyDa/8SGbK5uIggF5XTx77w==", "dev": true, "dependencies": { "@rollup/pluginutils": "^5.0.1", @@ -1727,7 +1730,7 @@ "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^2.68.0||^3.0.0" + "rollup": "^2.68.0||^3.0.0||^4.0.0" }, "peerDependenciesMeta": { "rollup": { @@ -1757,9 +1760,9 @@ } }, "node_modules/@rollup/plugin-json": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-6.0.0.tgz", - "integrity": "sha512-i/4C5Jrdr1XUarRhVu27EEwjt4GObltD7c+MkCIpO2QIbojw8MUs+CCTqOphQi3Qtg1FLmYt+l+6YeoIf51J7w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-6.0.1.tgz", + "integrity": "sha512-RgVfl5hWMkxN1h/uZj8FVESvPuBJ/uf6ly6GTj0GONnkfoBN5KC0MSz+PN2OLDgYXMhtG0mWpTrkiOjoxAIevw==", "dev": true, "dependencies": { "@rollup/pluginutils": "^5.0.1" @@ -1768,7 +1771,7 @@ "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0" + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" }, "peerDependenciesMeta": { "rollup": { @@ -1777,9 +1780,9 @@ } }, "node_modules/@rollup/plugin-node-resolve": { - "version": "15.2.1", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.2.1.tgz", - "integrity": "sha512-nsbUg588+GDSu8/NS8T4UAshO6xeaOfINNuXeVHcKV02LJtoRaM1SiOacClw4kws1SFiNhdLGxlbMY9ga/zs/w==", + "version": "15.2.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.2.3.tgz", + "integrity": "sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ==", "dev": true, "dependencies": { "@rollup/pluginutils": "^5.0.1", @@ -1793,7 +1796,7 @@ "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^2.78.0||^3.0.0" + "rollup": "^2.78.0||^3.0.0||^4.0.0" }, "peerDependenciesMeta": { "rollup": { @@ -1802,9 +1805,9 @@ } }, "node_modules/@rollup/plugin-replace": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-5.0.2.tgz", - "integrity": "sha512-M9YXNekv/C/iHHK+cvORzfRYfPbq0RDD8r0G+bMiTXjNGKulPnCT9O3Ss46WfhI6ZOCgApOP7xAdmCQJ+U2LAA==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-5.0.3.tgz", + "integrity": "sha512-je7fu05B800IrMlWjb2wzJcdXzHYW46iTipfChnBDbIbDXhASZs27W1B58T2Yf45jZtJUONegpbce+9Ut2Ti/Q==", "dev": true, "dependencies": { "@rollup/pluginutils": "^5.0.1", @@ -1814,7 +1817,7 @@ "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0" + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" }, "peerDependenciesMeta": { "rollup": { @@ -1835,9 +1838,9 @@ } }, "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==", + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.4.tgz", + "integrity": "sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==", "dev": true, "dependencies": { "serialize-javascript": "^6.0.1", @@ -1848,7 +1851,7 @@ "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^2.x || ^3.x" + "rollup": "^2.0.0||^3.0.0||^4.0.0" }, "peerDependenciesMeta": { "rollup": { @@ -1883,9 +1886,9 @@ } }, "node_modules/@rollup/pluginutils": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.4.tgz", - "integrity": "sha512-0KJnIoRI8A+a1dqOYLxH8vBf8bphDmty5QvIm2hqm7oFCFYKCAZWWd2hXgMibaPsNDhI0AtpYfQZJG47pt/k4g==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.5.tgz", + "integrity": "sha512-6aEYR910NyP73oHiJglti74iRyOwgFU4x3meH/H8OJx6Ry0j6cOVZ5X/wTvub7G7Ao6qaHBEaNsV3GLJkSsF+Q==", "dev": true, "dependencies": { "@types/estree": "^1.0.0", @@ -1896,7 +1899,7 @@ "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0" + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" }, "peerDependenciesMeta": { "rollup": { @@ -2034,9 +2037,9 @@ "dev": true }, "node_modules/@types/web-bluetooth": { - "version": "0.0.17", - "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.17.tgz", - "integrity": "sha512-4p9vcSmxAayx72yn70joFoL44c9MO/0+iVEBIQXe3v2h2SiAsEIo/G5v6ObFWvNKRFjbrVadNf9LqEEZeQPzdA==", + "version": "0.0.18", + "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.18.tgz", + "integrity": "sha512-v/ZHEj9xh82usl8LMR3GarzFY1IrbXJw5L4QfQhokjRV91q+SelFqxQWSep1ucXEZ22+dSTwLFkXeur25sPIbw==", "dev": true }, "node_modules/@types/yargs-parser": { @@ -2056,16 +2059,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.7.4", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.4.tgz", - "integrity": "sha512-DAbgDXwtX+pDkAHwiGhqP3zWUGpW49B7eqmgpPtg+BKJXwdct79ut9+ifqOFPJGClGKSHXn2PTBatCnldJRUoA==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.5.tgz", + "integrity": "sha512-JhtAwTRhOUcP96D0Y6KYnwig/MRQbOoLGXTON2+LlyB/N35SP9j1boai2zzwXb7ypKELXMx3DVk9UTaEq1vHEw==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.7.4", - "@typescript-eslint/type-utils": "6.7.4", - "@typescript-eslint/utils": "6.7.4", - "@typescript-eslint/visitor-keys": "6.7.4", + "@typescript-eslint/scope-manager": "6.7.5", + "@typescript-eslint/type-utils": "6.7.5", + "@typescript-eslint/utils": "6.7.5", + "@typescript-eslint/visitor-keys": "6.7.5", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -2091,15 +2094,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.7.4", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.7.4.tgz", - "integrity": "sha512-I5zVZFY+cw4IMZUeNCU7Sh2PO5O57F7Lr0uyhgCJmhN/BuTlnc55KxPonR4+EM3GBdfiCyGZye6DgMjtubQkmA==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.7.5.tgz", + "integrity": "sha512-bIZVSGx2UME/lmhLcjdVc7ePBwn7CLqKarUBL4me1C5feOd663liTGjMBGVcGr+BhnSLeP4SgwdvNnnkbIdkCw==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.7.4", - "@typescript-eslint/types": "6.7.4", - "@typescript-eslint/typescript-estree": "6.7.4", - "@typescript-eslint/visitor-keys": "6.7.4", + "@typescript-eslint/scope-manager": "6.7.5", + "@typescript-eslint/types": "6.7.5", + "@typescript-eslint/typescript-estree": "6.7.5", + "@typescript-eslint/visitor-keys": "6.7.5", "debug": "^4.3.4" }, "engines": { @@ -2119,13 +2122,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.7.4", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.7.4.tgz", - "integrity": "sha512-SdGqSLUPTXAXi7c3Ob7peAGVnmMoGzZ361VswK2Mqf8UOYcODiYvs8rs5ILqEdfvX1lE7wEZbLyELCW+Yrql1A==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.7.5.tgz", + "integrity": "sha512-GAlk3eQIwWOJeb9F7MKQ6Jbah/vx1zETSDw8likab/eFcqkjSD7BI75SDAeC5N2L0MmConMoPvTsmkrg71+B1A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.7.4", - "@typescript-eslint/visitor-keys": "6.7.4" + "@typescript-eslint/types": "6.7.5", + "@typescript-eslint/visitor-keys": "6.7.5" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -2136,13 +2139,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.7.4", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.7.4.tgz", - "integrity": "sha512-n+g3zi1QzpcAdHFP9KQF+rEFxMb2KxtnJGID3teA/nxKHOVi3ylKovaqEzGBbVY2pBttU6z85gp0D00ufLzViQ==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.7.5.tgz", + "integrity": "sha512-Gs0qos5wqxnQrvpYv+pf3XfcRXW6jiAn9zE/K+DlmYf6FcpxeNYN0AIETaPR7rHO4K2UY+D0CIbDP9Ut0U4m1g==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.7.4", - "@typescript-eslint/utils": "6.7.4", + "@typescript-eslint/typescript-estree": "6.7.5", + "@typescript-eslint/utils": "6.7.5", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -2163,9 +2166,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.7.4", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.7.4.tgz", - "integrity": "sha512-o9XWK2FLW6eSS/0r/tgjAGsYasLAnOWg7hvZ/dGYSSNjCh+49k5ocPN8OmG5aZcSJ8pclSOyVKP2x03Sj+RrCA==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.7.5.tgz", + "integrity": "sha512-WboQBlOXtdj1tDFPyIthpKrUb+kZf2VroLZhxKa/VlwLlLyqv/PwUNgL30BlTVZV1Wu4Asu2mMYPqarSO4L5ZQ==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -2176,13 +2179,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.7.4", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.4.tgz", - "integrity": "sha512-ty8b5qHKatlNYd9vmpHooQz3Vki3gG+3PchmtsA4TgrZBKWHNjWfkQid7K7xQogBqqc7/BhGazxMD5vr6Ha+iQ==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.5.tgz", + "integrity": "sha512-NhJiJ4KdtwBIxrKl0BqG1Ur+uw7FiOnOThcYx9DpOGJ/Abc9z2xNzLeirCG02Ig3vkvrc2qFLmYSSsaITbKjlg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.7.4", - "@typescript-eslint/visitor-keys": "6.7.4", + "@typescript-eslint/types": "6.7.5", + "@typescript-eslint/visitor-keys": "6.7.5", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -2203,17 +2206,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.7.4", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.7.4.tgz", - "integrity": "sha512-PRQAs+HUn85Qdk+khAxsVV+oULy3VkbH3hQ8hxLRJXWBEd7iI+GbQxH5SEUSH7kbEoTp6oT1bOwyga24ELALTA==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.7.5.tgz", + "integrity": "sha512-pfRRrH20thJbzPPlPc4j0UNGvH1PjPlhlCMq4Yx7EGjV7lvEeGX0U6MJYe8+SyFutWgSHsdbJ3BXzZccYggezA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.7.4", - "@typescript-eslint/types": "6.7.4", - "@typescript-eslint/typescript-estree": "6.7.4", + "@typescript-eslint/scope-manager": "6.7.5", + "@typescript-eslint/types": "6.7.5", + "@typescript-eslint/typescript-estree": "6.7.5", "semver": "^7.5.4" }, "engines": { @@ -2228,12 +2231,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.7.4", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.4.tgz", - "integrity": "sha512-pOW37DUhlTZbvph50x5zZCkFn3xzwkGtNoJHzIM3svpiSkJzwOYr/kVBaXmf+RAQiUDs1AHEZVNPg6UJCJpwRA==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.5.tgz", + "integrity": "sha512-3MaWdDZtLlsexZzDSdQWsFQ9l9nL8B80Z4fImSpyllFC/KLqWQRdEcB+gGGO+N3Q2uL40EsG66wZLsohPxNXvg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.7.4", + "@typescript-eslint/types": "6.7.5", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -2295,9 +2298,9 @@ } }, "node_modules/@vue/devtools-api": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.5.0.tgz", - "integrity": "sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==", + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.5.1.tgz", + "integrity": "sha512-+KpckaAQyfbvshdDW5xQylLni1asvNSGme1JFs8I1+/H5pHEhqUKMEQD/qn3Nx5+/nycBq11qAEi8lk+LXI2dA==", "dev": true }, "node_modules/@vue/eslint-config-prettier": { @@ -2413,15 +2416,15 @@ "dev": true }, "node_modules/@vueuse/core": { - "version": "10.4.1", - "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-10.4.1.tgz", - "integrity": "sha512-DkHIfMIoSIBjMgRRvdIvxsyboRZQmImofLyOHADqiVbQVilP8VVHDhBX2ZqoItOgu7dWa8oXiNnScOdPLhdEXg==", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-10.5.0.tgz", + "integrity": "sha512-z/tI2eSvxwLRjOhDm0h/SXAjNm8N5ld6/SC/JQs6o6kpJ6Ya50LnEL8g5hoYu005i28L0zqB5L5yAl8Jl26K3A==", "dev": true, "dependencies": { - "@types/web-bluetooth": "^0.0.17", - "@vueuse/metadata": "10.4.1", - "@vueuse/shared": "10.4.1", - "vue-demi": ">=0.14.5" + "@types/web-bluetooth": "^0.0.18", + "@vueuse/metadata": "10.5.0", + "@vueuse/shared": "10.5.0", + "vue-demi": ">=0.14.6" }, "funding": { "url": "https://github.com/sponsors/antfu" @@ -2454,14 +2457,14 @@ } }, "node_modules/@vueuse/integrations": { - "version": "10.4.1", - "resolved": "https://registry.npmjs.org/@vueuse/integrations/-/integrations-10.4.1.tgz", - "integrity": "sha512-uRBPyG5Lxoh1A/J+boiioPT3ELEAPEo4t8W6Mr4yTKIQBeW/FcbsotZNPr4k9uz+3QEksMmflWloS9wCnypM7g==", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/@vueuse/integrations/-/integrations-10.5.0.tgz", + "integrity": "sha512-fm5sXLCK0Ww3rRnzqnCQRmfjDURaI4xMsx+T+cec0ngQqHx/JgUtm8G0vRjwtonIeTBsH1Q8L3SucE+7K7upJQ==", "dev": true, "dependencies": { - "@vueuse/core": "10.4.1", - "@vueuse/shared": "10.4.1", - "vue-demi": ">=0.14.5" + "@vueuse/core": "10.5.0", + "@vueuse/shared": "10.5.0", + "vue-demi": ">=0.14.6" }, "funding": { "url": "https://github.com/sponsors/antfu" @@ -2546,21 +2549,21 @@ } }, "node_modules/@vueuse/metadata": { - "version": "10.4.1", - "resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-10.4.1.tgz", - "integrity": "sha512-2Sc8X+iVzeuMGHr6O2j4gv/zxvQGGOYETYXEc41h0iZXIRnRbJZGmY/QP8dvzqUelf8vg0p/yEA5VpCEu+WpZg==", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-10.5.0.tgz", + "integrity": "sha512-fEbElR+MaIYyCkeM0SzWkdoMtOpIwO72x8WsZHRE7IggiOlILttqttM69AS13nrDxosnDBYdyy3C5mR1LCxHsw==", "dev": true, "funding": { "url": "https://github.com/sponsors/antfu" } }, "node_modules/@vueuse/shared": { - "version": "10.4.1", - "resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-10.4.1.tgz", - "integrity": "sha512-vz5hbAM4qA0lDKmcr2y3pPdU+2EVw/yzfRsBdu+6+USGa4PxqSQRYIUC9/NcT06y+ZgaTsyURw2I9qOFaaXHAg==", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-10.5.0.tgz", + "integrity": "sha512-18iyxbbHYLst9MqU1X1QNdMHIjks6wC7XTVf0KNOv5es/Ms6gjVFCAAWTVP2JStuGqydg3DT+ExpFORUEi9yhg==", "dev": true, "dependencies": { - "vue-demi": ">=0.14.5" + "vue-demi": ">=0.14.6" }, "funding": { "url": "https://github.com/sponsors/antfu" @@ -2664,25 +2667,25 @@ } }, "node_modules/algoliasearch": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.19.1.tgz", - "integrity": "sha512-IJF5b93b2MgAzcE/tuzW0yOPnuUyRgGAtaPv5UUywXM8kzqfdwZTO4sPJBzoGz1eOy6H9uEchsJsBFTELZSu+g==", - "dev": true, - "dependencies": { - "@algolia/cache-browser-local-storage": "4.19.1", - "@algolia/cache-common": "4.19.1", - "@algolia/cache-in-memory": "4.19.1", - "@algolia/client-account": "4.19.1", - "@algolia/client-analytics": "4.19.1", - "@algolia/client-common": "4.19.1", - "@algolia/client-personalization": "4.19.1", - "@algolia/client-search": "4.19.1", - "@algolia/logger-common": "4.19.1", - "@algolia/logger-console": "4.19.1", - "@algolia/requester-browser-xhr": "4.19.1", - "@algolia/requester-common": "4.19.1", - "@algolia/requester-node-http": "4.19.1", - "@algolia/transporter": "4.19.1" + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.20.0.tgz", + "integrity": "sha512-y+UHEjnOItoNy0bYO+WWmLWBlPwDjKHW6mNHrPi0NkuhpQOOEbrkwQH/wgKFDLh7qlKjzoKeiRtlpewDPDG23g==", + "dev": true, + "dependencies": { + "@algolia/cache-browser-local-storage": "4.20.0", + "@algolia/cache-common": "4.20.0", + "@algolia/cache-in-memory": "4.20.0", + "@algolia/client-account": "4.20.0", + "@algolia/client-analytics": "4.20.0", + "@algolia/client-common": "4.20.0", + "@algolia/client-personalization": "4.20.0", + "@algolia/client-search": "4.20.0", + "@algolia/logger-common": "4.20.0", + "@algolia/logger-console": "4.20.0", + "@algolia/requester-browser-xhr": "4.20.0", + "@algolia/requester-common": "4.20.0", + "@algolia/requester-node-http": "4.20.0", + "@algolia/transporter": "4.20.0" } }, "node_modules/ansi-colors": { @@ -2808,15 +2811,15 @@ } }, "node_modules/array-includes": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz", - "integrity": "sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==", + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.7.tgz", + "integrity": "sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", - "get-intrinsic": "^1.1.3", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", "is-string": "^1.0.7" }, "engines": { @@ -2836,16 +2839,16 @@ } }, "node_modules/array.prototype.findlastindex": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.2.tgz", - "integrity": "sha512-tb5thFFlUcp7NdNF6/MpDk/1r/4awWG1FIz3YqDf+/zJSTezBb+/5WViH41obXULHVpDzoiCLpJ/ZO9YbJMsdw==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.3.tgz", + "integrity": "sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", "es-shim-unscopables": "^1.0.0", - "get-intrinsic": "^1.1.3" + "get-intrinsic": "^1.2.1" }, "engines": { "node": ">= 0.4" @@ -2855,14 +2858,14 @@ } }, "node_modules/array.prototype.flat": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz", - "integrity": "sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", + "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", "es-shim-unscopables": "^1.0.0" }, "engines": { @@ -2873,14 +2876,14 @@ } }, "node_modules/array.prototype.flatmap": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz", - "integrity": "sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", + "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", "es-shim-unscopables": "^1.0.0" }, "engines": { @@ -2891,14 +2894,15 @@ } }, "node_modules/arraybuffer.prototype.slice": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.1.tgz", - "integrity": "sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz", + "integrity": "sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==", "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.0", "call-bind": "^1.0.2", "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", "get-intrinsic": "^1.2.1", "is-array-buffer": "^3.0.2", "is-shared-array-buffer": "^1.0.2" @@ -3305,9 +3309,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001541", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001541.tgz", - "integrity": "sha512-bLOsqxDgTqUBkzxbNlSBt8annkDpQB9NdzdTbO2ooJ+eC/IQcvDspDc058g84ejCelF7vHUx57KIOjEecOHXaw==", + "version": "1.0.30001547", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001547.tgz", + "integrity": "sha512-W7CrtIModMAxobGhz8iXmDfuJiiKg1WADMO/9x7/CLNin5cpSbuBjooyoIUVB5eyCc36QuTVlkVa1iB2S5+/eA==", "dev": true, "funding": [ { @@ -3388,9 +3392,9 @@ } }, "node_modules/ci-info": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", - "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", "dev": true, "funding": [ { @@ -3445,9 +3449,9 @@ } }, "node_modules/cli-spinners": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.0.tgz", - "integrity": "sha512-4/aL9X3Wh0yiMQlE+eeRhWP6vclO3QRtw1JHKIT0FFUs5FjpFmESqtMvYZ0+lbzBw900b95mS0hohy+qn2VK/g==", + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.1.tgz", + "integrity": "sha512-jHgecW0pxkonBJdrKsqxgRX9AcG+u/5k0Q7WPDfi8AogLAdwxEkyYYNWwZ5GvVFoFx2uiY1eNcSK00fh+1+FyQ==", "dev": true, "engines": { "node": ">=6" @@ -3955,6 +3959,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/define-data-property": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", + "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/define-lazy-prop": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", @@ -3968,11 +3986,12 @@ } }, "node_modules/define-properties": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", - "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dev": true, "dependencies": { + "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" }, @@ -4029,9 +4048,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.536", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.536.tgz", - "integrity": "sha512-L4VgC/76m6y8WVCgnw5kJy/xs7hXrViCFdNKVG8Y7B2isfwrFryFyJzumh3ugxhd/oB1uEaEEvRdmeLrnd7OFA==", + "version": "1.4.553", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.553.tgz", + "integrity": "sha512-HiRdtyKS2+VhiXvjhMvvxiMC33FJJqTA5EB2YHgFZW6v7HkK4Q9Ahv2V7O2ZPgAjw+MyCJVMQvigj13H8t+wvA==", "dev": true }, "node_modules/emoji-regex": { @@ -4065,18 +4084,18 @@ } }, "node_modules/es-abstract": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.1.tgz", - "integrity": "sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw==", + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.2.tgz", + "integrity": "sha512-YoxfFcDmhjOgWPWsV13+2RNjq1F6UQnfs+8TftwNqtzlmFzEXvlUwdrNrYeaizfjQzRMxkZ6ElWMOJIFKdVqwA==", "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.0", - "arraybuffer.prototype.slice": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.2", "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", "es-set-tostringtag": "^2.0.1", "es-to-primitive": "^1.2.1", - "function.prototype.name": "^1.1.5", + "function.prototype.name": "^1.1.6", "get-intrinsic": "^1.2.1", "get-symbol-description": "^1.0.0", "globalthis": "^1.0.3", @@ -4092,23 +4111,23 @@ "is-regex": "^1.1.4", "is-shared-array-buffer": "^1.0.2", "is-string": "^1.0.7", - "is-typed-array": "^1.1.10", + "is-typed-array": "^1.1.12", "is-weakref": "^1.0.2", "object-inspect": "^1.12.3", "object-keys": "^1.1.1", "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.5.0", - "safe-array-concat": "^1.0.0", + "regexp.prototype.flags": "^1.5.1", + "safe-array-concat": "^1.0.1", "safe-regex-test": "^1.0.0", - "string.prototype.trim": "^1.2.7", - "string.prototype.trimend": "^1.0.6", - "string.prototype.trimstart": "^1.0.6", + "string.prototype.trim": "^1.2.8", + "string.prototype.trimend": "^1.0.7", + "string.prototype.trimstart": "^1.0.7", "typed-array-buffer": "^1.0.0", "typed-array-byte-length": "^1.0.0", "typed-array-byte-offset": "^1.0.0", "typed-array-length": "^1.0.4", "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.10" + "which-typed-array": "^1.1.11" }, "engines": { "node": ">= 0.4" @@ -4237,15 +4256,15 @@ } }, "node_modules/eslint": { - "version": "8.50.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.50.0.tgz", - "integrity": "sha512-FOnOGSuFuFLv/Sa+FDVRZl4GGVAAFFi8LecRsI5a1tMO5HIE8nCm4ivAlzt4dT3ol/PaaGC0rJEEXQmHJBGoOg==", + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.51.0.tgz", + "integrity": "sha512-2WuxRZBrlwnXi+/vFSJyjMqrNjtJqiasMzehF0shoLaW7DzS3/9Yvrmq5JiT66+pNjiX4UBnLDiKHcWAr/OInA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "8.50.0", + "@eslint/js": "8.51.0", "@humanwhocodes/config-array": "^0.11.11", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -4401,9 +4420,9 @@ } }, "node_modules/eslint-plugin-prettier": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.0.0.tgz", - "integrity": "sha512-AgaZCVuYDXHUGxj/ZGu1u8H8CYgDY3iG6w5kUFw4AzMVXzB7VvbKgYR4nATIN+OvUrghMbiDLeimVjVY5ilq3w==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.0.1.tgz", + "integrity": "sha512-m3u5RnR56asrwV/lDC4GHorlW75DsFfmUcjfCYylTUs85dBRnB7VM6xG8eCMJdeDRnppzmxZVf1GEPJvl1JmNg==", "dev": true, "dependencies": { "prettier-linter-helpers": "^1.0.0", @@ -4929,16 +4948,17 @@ } }, "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.1.tgz", + "integrity": "sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q==", "dev": true, "dependencies": { - "flatted": "^3.1.0", + "flatted": "^3.2.9", + "keyv": "^4.5.3", "rimraf": "^3.0.2" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=12.0.0" } }, "node_modules/flatted": { @@ -4957,9 +4977,9 @@ } }, "node_modules/focus-trap": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/focus-trap/-/focus-trap-7.5.3.tgz", - "integrity": "sha512-7UsT/eSJcTPF0aZp73u7hBRTABz26knRRTJfoTGFCQD5mUImLIIOwWWCrtoQdmWa7dykBi6H+Cp5i3S/kvsMeA==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/focus-trap/-/focus-trap-7.5.4.tgz", + "integrity": "sha512-N7kHdlgsO/v+iD/dMoJKtsSqs5Dz/dXZVebRgJw23LDk+jMi/974zyiOYDziY2JPp8xivq9BmUGwIJMiuSBi7w==", "dev": true, "dependencies": { "tabbable": "^6.2.0" @@ -5103,21 +5123,24 @@ } }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/function.prototype.name": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", - "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0", - "functions-have-names": "^1.2.2" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" }, "engines": { "node": ">= 0.4" @@ -5300,9 +5323,9 @@ } }, "node_modules/globals": { - "version": "13.22.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.22.0.tgz", - "integrity": "sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw==", + "version": "13.23.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", + "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -5383,13 +5406,10 @@ "dev": true }, "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", + "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, "engines": { "node": ">= 0.4.0" } @@ -6295,6 +6315,12 @@ "node": ">=6" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -6343,6 +6369,15 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -6811,9 +6846,9 @@ } }, "node_modules/magic-string": { - "version": "0.30.4", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.4.tgz", - "integrity": "sha512-Q/TKtsC5BPm0kGqgBIF9oXAs/xEf2vRKiIB4wCRQTJOQIByZ1d+NnUOotvJOvNpi5RNIgVOMC3pOuaP1ZTDlVg==", + "version": "0.30.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.5.tgz", + "integrity": "sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==", "dev": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" @@ -6985,15 +7020,18 @@ "dev": true }, "node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", "dev": true, "bin": { - "mkdirp": "bin/cmd.js" + "mkdirp": "dist/cjs/src/bin.js" }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/mkdirp-classic": { @@ -7267,9 +7305,9 @@ } }, "node_modules/node-gyp-build": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", - "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.1.tgz", + "integrity": "sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ==", "dev": true, "bin": { "node-gyp-build": "bin.js", @@ -7572,14 +7610,14 @@ } }, "node_modules/object.fromentries": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.6.tgz", - "integrity": "sha512-VciD13dswC4j1Xt5394WR4MzmAQmlgN72phd/riNp9vtD7tp4QQWJ0R4wvclXcafgcYK8veHRed2W6XeGBvcfg==", + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.7.tgz", + "integrity": "sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" }, "engines": { "node": ">= 0.4" @@ -7589,26 +7627,26 @@ } }, "node_modules/object.groupby": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.0.tgz", - "integrity": "sha512-70MWG6NfRH9GnbZOikuhPPYzpUpof9iW2J9E4dW7FXTqPNb6rllE6u39SKwwiNh8lCwX3DDb5OgcKGiEBrTTyw==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.1.tgz", + "integrity": "sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", - "es-abstract": "^1.21.2", + "es-abstract": "^1.22.1", "get-intrinsic": "^1.2.1" } }, "node_modules/object.values": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", - "integrity": "sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.7.tgz", + "integrity": "sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" }, "engines": { "node": ">= 0.4" @@ -8006,9 +8044,9 @@ } }, "node_modules/pinia/node_modules/vue-demi": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.5.tgz", - "integrity": "sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==", + "version": "0.14.6", + "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.6.tgz", + "integrity": "sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==", "dev": true, "hasInstallScript": true, "bin": { @@ -8164,9 +8202,9 @@ } }, "node_modules/preact": { - "version": "10.18.0", - "resolved": "https://registry.npmjs.org/preact/-/preact-10.18.0.tgz", - "integrity": "sha512-O4dGFmErPd3RNVDvXmCbOW6hetnve6vYtjx5qf51mCUmBS96s66MrNQkEII5UThDGoNF7953ptA+aNupiDxVeg==", + "version": "10.18.1", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.18.1.tgz", + "integrity": "sha512-mKUD7RRkQQM6s7Rkmi7IFkoEHjuFqRQUaXamO61E6Nn7vqF/bo7EZCmSyrUnp2UWHw0O7XjZ2eeXis+m7tf4lg==", "dev": true, "funding": { "type": "opencollective", @@ -8530,14 +8568,14 @@ } }, "node_modules/regexp.prototype.flags": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", - "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz", + "integrity": "sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", - "functions-have-names": "^1.2.3" + "set-function-name": "^2.0.0" }, "engines": { "node": ">= 0.4" @@ -8652,9 +8690,9 @@ } }, "node_modules/resolve": { - "version": "1.22.6", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.6.tgz", - "integrity": "sha512-njhxM7mV12JfufShqGy3Rz8j11RPdLy4xi15UurGJeoHLfJpVXKdh3ueuOqbYUcDZnffr6X739JBo5LzyahEsw==", + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, "dependencies": { "is-core-module": "^2.13.0", @@ -8830,21 +8868,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/rollup-plugin-license/node_modules/mkdirp": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", - "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", - "dev": true, - "bin": { - "mkdirp": "dist/cjs/src/bin.js" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/rollup-plugin-string": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/rollup-plugin-string/-/rollup-plugin-string-3.0.0.tgz", @@ -9030,13 +9053,13 @@ } }, "node_modules/safe-array-concat": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.0.tgz", - "integrity": "sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.1.tgz", + "integrity": "sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.0", + "get-intrinsic": "^1.2.1", "has-symbols": "^1.0.3", "isarray": "^2.0.5" }, @@ -9088,14 +9111,11 @@ "dev": true }, "node_modules/search-insights": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/search-insights/-/search-insights-2.8.3.tgz", - "integrity": "sha512-W9rZfQ9XEfF0O6ntgQOTI7Txc8nkZrO4eJ/pTHK0Br6wWND2sPGPoWg+yGhdIW7wMbLqk8dc23IyEtLlNGpeNw==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/search-insights/-/search-insights-2.9.0.tgz", + "integrity": "sha512-bkWW9nIHOFkLwjQ1xqVaMbjjO5vhP26ERsH9Y3pKr8imthofEFIxlnOabkmGcw6ksRj9jWidcI65vvjJH/nTGg==", "dev": true, - "peer": true, - "engines": { - "node": ">=8.16.0" - } + "peer": true }, "node_modules/semver": { "version": "7.5.4", @@ -9145,6 +9165,20 @@ "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", "dev": true }, + "node_modules/set-function-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", + "integrity": "sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/setimmediate-napi": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/setimmediate-napi/-/setimmediate-napi-1.0.6.tgz", @@ -9223,9 +9257,9 @@ } }, "node_modules/shiki": { - "version": "0.14.4", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.4.tgz", - "integrity": "sha512-IXCRip2IQzKwxArNNq1S+On4KPML3Yyn8Zzs/xRgcgOWIr8ntIK3IKzjFPfjy/7kt9ZMjc+FItfqHRBg8b6tNQ==", + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.5.tgz", + "integrity": "sha512-1gCAYOcmCFONmErGTrS1fjzJLA7MGZmKzrBNX7apqSwhyITJg2O102uFzXUeBxNnEkDA9vHIKLyeKq0V083vIw==", "dev": true, "dependencies": { "ansi-sequence-parser": "^1.1.0", @@ -9430,9 +9464,9 @@ } }, "node_modules/spdx-license-ids": { - "version": "3.0.15", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.15.tgz", - "integrity": "sha512-lpT8hSQp9jAKp9mhtBU4Xjon8LPGBvLIuBiSVhMEtmLecTh2mO0tlqrAMp47tBXzMr13NJMQ2lf7RpQGLJ3HsQ==", + "version": "3.0.16", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.16.tgz", + "integrity": "sha512-eWN+LnM3GR6gPu35WxNgbGl8rmY1AEmoMDvL/QD6zYmPWgywxWqJWNdLGT+ke8dKNWrcYgYjPpG5gbTfghP8rw==", "dev": true }, "node_modules/spdx-ranges": { @@ -9500,14 +9534,14 @@ } }, "node_modules/string.prototype.trim": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", - "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", + "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" }, "engines": { "node": ">= 0.4" @@ -9517,28 +9551,28 @@ } }, "node_modules/string.prototype.trimend": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", - "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", + "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", - "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", + "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -9663,9 +9697,9 @@ "dev": true }, "node_modules/tar": { - "version": "6.1.15", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.15.tgz", - "integrity": "sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz", + "integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==", "dev": true, "dependencies": { "chownr": "^2.0.0", @@ -9716,6 +9750,18 @@ "node": ">=10" } }, + "node_modules/tar/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/tar/node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", @@ -9865,9 +9911,9 @@ } }, "node_modules/ts-api-utils": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.2.tgz", - "integrity": "sha512-Cbu4nIqnEdd+THNEsBdkolnOXhg0I8XteoHaEKgvsxpsbWda4IsUut2c187HxywQCvveojow0Dgw/amxtSKVkQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", + "integrity": "sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==", "dev": true, "engines": { "node": ">=16.13.0" @@ -10235,22 +10281,22 @@ } }, "node_modules/vitepress": { - "version": "1.0.0-rc.20", - "resolved": "https://registry.npmjs.org/vitepress/-/vitepress-1.0.0-rc.20.tgz", - "integrity": "sha512-CykMUJ8JLxLcGWek0ew3wln4RYbsOd1+0YzXITTpajggpynm2S331TNkJVOkHrMRc6GYe3y4pS40GfgcW0ZwAw==", + "version": "1.0.0-rc.21", + "resolved": "https://registry.npmjs.org/vitepress/-/vitepress-1.0.0-rc.21.tgz", + "integrity": "sha512-eHX057NgAqmrj6FIqh7Sqsbk/kftrFMBUpCKjuQIZ+c+bYTbmzXsXrHSbT5b4WWy4vLx1993a+H3wIRy2dHi8g==", "dev": true, "dependencies": { "@docsearch/css": "^3.5.2", "@docsearch/js": "^3.5.2", - "@types/markdown-it": "^13.0.1", - "@vue/devtools-api": "^6.5.0", - "@vueuse/core": "^10.4.1", - "@vueuse/integrations": "^10.4.1", - "focus-trap": "^7.5.2", + "@types/markdown-it": "^13.0.2", + "@vue/devtools-api": "^6.5.1", + "@vueuse/core": "^10.5.0", + "@vueuse/integrations": "^10.5.0", + "focus-trap": "^7.5.3", "mark.js": "8.11.1", "minisearch": "^6.1.0", - "shiki": "^0.14.4", - "vite": "^4.4.9", + "shiki": "^0.14.5", + "vite": "^4.4.11", "vue": "^3.3.4" }, "bin": { @@ -10258,7 +10304,7 @@ }, "peerDependencies": { "markdown-it-mathjax3": "^4.3.2", - "postcss": "^8.4.30" + "postcss": "^8.4.31" }, "peerDependenciesMeta": { "markdown-it-mathjax3": { @@ -10295,9 +10341,9 @@ } }, "node_modules/vue-eslint-parser": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-9.3.1.tgz", - "integrity": "sha512-Clr85iD2XFZ3lJ52/ppmUDG/spxQu6+MAeHXjjyI4I1NUYZ9xmenQp4N0oaHJhrA8OOxltCVxMRfANGa70vU0g==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-9.3.2.tgz", + "integrity": "sha512-q7tWyCVaV9f8iQyIA5Mkj/S6AoJ9KBN8IeUSf3XEmBrOtxOZnfTg5s4KClbZBCK3GtnT/+RyCLZyDHuZwTuBjg==", "dev": true, "dependencies": { "debug": "^4.3.4", diff --git a/package.json b/package.json index 0f793d993..cb862547c 100644 --- a/package.json +++ b/package.json @@ -109,25 +109,25 @@ "@codemirror/language": "^6.9.1", "@codemirror/search": "^6.5.4", "@codemirror/state": "^6.2.1", - "@codemirror/view": "^6.21.2", + "@codemirror/view": "^6.21.3", "@jridgewell/sourcemap-codec": "^1.4.15", "@mermaid-js/mermaid-cli": "^10.4.0", "@napi-rs/cli": "^2.16.3", - "@rollup/plugin-alias": "^5.0.0", - "@rollup/plugin-buble": "^1.0.2", - "@rollup/plugin-commonjs": "^25.0.4", - "@rollup/plugin-json": "^6.0.0", - "@rollup/plugin-node-resolve": "^15.2.1", - "@rollup/plugin-replace": "^5.0.2", - "@rollup/plugin-terser": "^0.4.3", + "@rollup/plugin-alias": "^5.0.1", + "@rollup/plugin-buble": "^1.0.3", + "@rollup/plugin-commonjs": "^25.0.5", + "@rollup/plugin-json": "^6.0.1", + "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-replace": "^5.0.3", + "@rollup/plugin-terser": "^0.4.4", "@rollup/plugin-typescript": "11.1.4", - "@rollup/pluginutils": "^5.0.4", + "@rollup/pluginutils": "^5.0.5", "@types/estree": "1.0.2", "@types/mocha": "^10.0.2", "@types/node": "18.0.0", "@types/yargs-parser": "^21.0.1", - "@typescript-eslint/eslint-plugin": "^6.7.4", - "@typescript-eslint/parser": "^6.7.4", + "@typescript-eslint/eslint-plugin": "^6.7.5", + "@typescript-eslint/parser": "^6.7.5", "@vue/eslint-config-prettier": "^8.0.0", "@vue/eslint-config-typescript": "^12.0.0", "acorn": "^8.10.0", @@ -141,7 +141,7 @@ "date-time": "^4.0.0", "es5-shim": "^4.6.7", "es6-shim": "^0.35.8", - "eslint": "^8.50.0", + "eslint": "^8.51.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-import": "^2.28.1", "eslint-plugin-prettier": "^5.0.0", diff --git a/rust/Cargo.lock b/rust/Cargo.lock index d15a427c1..b3b07ca14 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -42,9 +42,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -596,9 +596,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.148" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "libloading" @@ -740,7 +740,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "semver 1.0.19", + "semver 1.0.20", "syn 1.0.109", ] @@ -802,9 +802,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] @@ -992,7 +992,7 @@ dependencies = [ "dashmap", "from_variant", "once_cell", - "semver 1.0.19", + "semver 1.0.20", "serde", "st-map", "tracing", @@ -1030,9 +1030,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.68" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b1106fec09662ec6dd98ccac0f81cef56984d0b49f75c92d8cbad76e20c005c" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -1122,9 +1122,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.6" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" +checksum = "d119d7c7ca818f8a53c300863d4f87566aac09943aef5b355bb83969dae75d87" dependencies = [ "aho-corasick", "memchr", @@ -1134,9 +1134,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.9" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" +checksum = "465c6fc0621e4abc4187a2bda0937bfd4f722c2730b29562e19689ea796c9a4b" dependencies = [ "aho-corasick", "memchr", @@ -1145,9 +1145,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "56d84fdd47036b038fc80dd333d10b6aab10d5d31f4a366e20014def75328d33" [[package]] name = "rustc-demangle" @@ -1205,9 +1205,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" dependencies = [ "serde", ] @@ -1220,9 +1220,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.188" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" dependencies = [ "serde_derive", ] @@ -1240,9 +1240,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" dependencies = [ "proc-macro2", "quote", @@ -1432,9 +1432,9 @@ dependencies = [ [[package]] name = "swc" -version = "0.266.37" +version = "0.268.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4d460e7778c38dca5ffbc0a41487ef179d89768e690e499f72ce786f90a726b" +checksum = "5c0f38e760a7427682f38ee4b3a1454e7fffefb8bf899feea00d993fd80c3ac6" dependencies = [ "anyhow", "base64 0.13.1", @@ -1480,9 +1480,9 @@ dependencies = [ [[package]] name = "swc_atoms" -version = "0.5.9" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f54563d7dcba626d4acfe14ed12def7ecc28e004debe3ecd2c3ee07cc47e449" +checksum = "ebf7a12229f0c0efb654a6a0f8cbfd94fbd320a57c764857a82d8abe9342b450" dependencies = [ "once_cell", "rustc-hash", @@ -1508,9 +1508,9 @@ dependencies = [ [[package]] name = "swc_common" -version = "0.32.2" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eef62cc9409135ad6770ca4d52aa443ee8367d5322a5c7cab4c0eb96644a6ee" +checksum = "490e199e25d2aa3fbef675524fa81408651f4e7178b51110470ddd1b3e3bbe75" dependencies = [ "ahash", "ast_node", @@ -1537,9 +1537,9 @@ dependencies = [ [[package]] name = "swc_compiler_base" -version = "0.1.9" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b912871245c50114f2796710f29f7af45695f5bfcaf339c874654128d5cfb974" +checksum = "6d6a44aa824c4c572bef137ee61009d7c90565f52bd3165e3a8d6db519f8b80e" dependencies = [ "anyhow", "base64 0.13.1", @@ -1584,9 +1584,9 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "0.109.2" +version = "0.110.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df3fdd0752abca14a106322b4db96f954274adfb1fbef387866691ea4bc6fe4" +checksum = "5cbbf9918976a7e7fbdb4f76fe659d08e291a8b56b524b424183fc67d1189679" dependencies = [ "bitflags 2.4.0", "is-macro", @@ -1601,9 +1601,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "0.145.6" +version = "0.146.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0824227db6b9c78acb557c2ce5d03c83e71ff2a3891a74b6adb044f1e51c8f4f" +checksum = "1fba119c76654599b71099a0150094f5790f00db63aab6cda1790e731f42c98f" dependencies = [ "memchr", "num-bigint", @@ -1631,11 +1631,204 @@ dependencies = [ "syn 2.0.38", ] +[[package]] +name = "swc_ecma_compat_bugfixes" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8492fecb7c39e7c03e85adb39c1493dbe59127b148c68d88d58a56a986edb9d" +dependencies = [ + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_compat_es2015", + "swc_ecma_transforms_base", + "swc_ecma_utils", + "swc_ecma_visit", + "swc_trace_macro", + "tracing", +] + +[[package]] +name = "swc_ecma_compat_common" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50245762634ec219fb233f15763d95e875be18ee144637b1fb8287ff8047a672" +dependencies = [ + "swc_common", + "swc_ecma_ast", + "swc_ecma_utils", + "swc_ecma_visit", + "swc_trace_macro", +] + +[[package]] +name = "swc_ecma_compat_es2015" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aee936ff031706c11c3314aa47f1e408b979f2cb8eb657d133e5cc5359595eb" +dependencies = [ + "arrayvec", + "indexmap 1.9.3", + "is-macro", + "serde", + "serde_derive", + "smallvec", + "swc_atoms", + "swc_common", + "swc_config", + "swc_ecma_ast", + "swc_ecma_compat_common", + "swc_ecma_transforms_base", + "swc_ecma_transforms_classes", + "swc_ecma_transforms_macros", + "swc_ecma_utils", + "swc_ecma_visit", + "swc_trace_macro", + "tracing", +] + +[[package]] +name = "swc_ecma_compat_es2016" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd059dbf29c7be2258a1c5ed4b66d62cd5742b7eb3ccb3c87be124d7ff95e4f" +dependencies = [ + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms_base", + "swc_ecma_transforms_macros", + "swc_ecma_utils", + "swc_ecma_visit", + "swc_trace_macro", + "tracing", +] + +[[package]] +name = "swc_ecma_compat_es2017" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29e6fd80a8afbe78b250a57d824238f3b94def9a2951e58ea802fa1670d70b00" +dependencies = [ + "serde", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms_base", + "swc_ecma_transforms_macros", + "swc_ecma_utils", + "swc_ecma_visit", + "swc_trace_macro", + "tracing", +] + +[[package]] +name = "swc_ecma_compat_es2018" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e48750104863e93ba82487f18513f677bcd6b14fcc6e56bccc98c66f64eb275" +dependencies = [ + "serde", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_compat_common", + "swc_ecma_transforms_base", + "swc_ecma_transforms_macros", + "swc_ecma_utils", + "swc_ecma_visit", + "swc_trace_macro", + "tracing", +] + +[[package]] +name = "swc_ecma_compat_es2019" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "607de96545c73c5d1bab3dee0954e706dedcf36ff90882cd3168731eb1a49924" +dependencies = [ + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms_base", + "swc_ecma_utils", + "swc_ecma_visit", + "swc_trace_macro", + "tracing", +] + +[[package]] +name = "swc_ecma_compat_es2020" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760ff522431fb9124fbe7d499171044df8375354fcd856779fdc8473df7f8d2b" +dependencies = [ + "serde", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms_base", + "swc_ecma_utils", + "swc_ecma_visit", + "swc_trace_macro", + "tracing", +] + +[[package]] +name = "swc_ecma_compat_es2021" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f2d1251f0e309a61f0e8bedb6e2554c822e5091584e538f65a850a4aa1a52ba" +dependencies = [ + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms_base", + "swc_ecma_utils", + "swc_ecma_visit", + "swc_trace_macro", + "tracing", +] + +[[package]] +name = "swc_ecma_compat_es2022" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3c1b75b0cb6e1f41a0872831c56543790366dcb3868299bb39f9696c194825" +dependencies = [ + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_compat_common", + "swc_ecma_transforms_base", + "swc_ecma_transforms_classes", + "swc_ecma_transforms_macros", + "swc_ecma_utils", + "swc_ecma_visit", + "swc_trace_macro", + "tracing", +] + +[[package]] +name = "swc_ecma_compat_es3" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3627d26b77f3fe1496d7910cc8acbdc840c7a16eac0de2e99102673112bc8f97" +dependencies = [ + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms_base", + "swc_ecma_utils", + "swc_ecma_visit", + "swc_trace_macro", + "tracing", +] + [[package]] name = "swc_ecma_ext_transforms" -version = "0.109.3" +version = "0.110.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f60582664a950ef5175b9b58376b2a498495cce674f66a3244756097b210ffce" +checksum = "ba15f88295428c69e3fd2cf80306432c87476abba09c8fe2e4880afa931a01e0" dependencies = [ "phf", "swc_atoms", @@ -1647,9 +1840,9 @@ dependencies = [ [[package]] name = "swc_ecma_lints" -version = "0.88.9" +version = "0.89.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97f1265c5c86952370864421411b2cce3651b3972200ab31e2ae799f6aac703e" +checksum = "93a2678e9fbc05f984eb7eba63e1e447fc87fac962689a650c440be9cf684a56" dependencies = [ "auto_impl", "dashmap", @@ -1667,9 +1860,9 @@ dependencies = [ [[package]] name = "swc_ecma_loader" -version = "0.44.5" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fde105c1234030b4e02b363bcb3bfeedc057cb40707e0695f6f84b99706307ff" +checksum = "a7fe06d942fe20a5a81cc14f4a53e64a5efdc851fa895a869224b2d41df73276" dependencies = [ "anyhow", "dashmap", @@ -1688,9 +1881,9 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "0.187.30" +version = "0.188.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735941d928a141c7e46e7d0a65afdcdef12204b08ba6be69cbb7b7aedb7b4fb7" +checksum = "f6058566588988a7463bab250215e6205d258184a0c23e38da96ce92d88079ee" dependencies = [ "arrayvec", "indexmap 1.9.3", @@ -1722,9 +1915,9 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "0.140.1" +version = "0.141.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "316c11593fc4f52a81446fae0e1f1d32836c00f546eb80405024c04cd5f8bec6" +checksum = "a26e535c623db7beb04ba8ebfa821c287b72a23f9fb523990b54db6c1355c990" dependencies = [ "either", "num-bigint", @@ -1742,9 +1935,9 @@ dependencies = [ [[package]] name = "swc_ecma_preset_env" -version = "0.201.29" +version = "0.202.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d55cf2967058b01ad8be678f2683657e2ff93d5fd2a4e3b0f19e9b145be9f9ba" +checksum = "f3d86d2220a18c9c274ba992283e2de283c9c74a0fb8c666376d2bf8f7737fd4" dependencies = [ "anyhow", "dashmap", @@ -1752,7 +1945,7 @@ dependencies = [ "once_cell", "preset_env_base", "rustc-hash", - "semver 1.0.19", + "semver 1.0.20", "serde", "serde_json", "st-map", @@ -1767,9 +1960,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "0.224.27" +version = "0.225.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ec5a80bb7603141a9a4e1df1a1036f54ae1b6ae8df807fec076bda196d84026" +checksum = "c0518045c2961b20428f05167bc8e6337e856fd028a2dedb2e707f42d4187c8f" dependencies = [ "swc_atoms", "swc_common", @@ -1787,9 +1980,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "0.133.8" +version = "0.134.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5228db1f98c4027ded35c6e1c30bbf13f248c0321367ee5fa5fb3f55fa9f485f" +checksum = "353b6ee945d843018c16f65f0d44c844c7fa5fa42ae36b4adef50ec4404acdbe" dependencies = [ "better_scoped_tls", "bitflags 2.4.0", @@ -1810,9 +2003,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_classes" -version = "0.122.8" +version = "0.123.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04783748e4401ea2f7ad1e5ba66cea89687c163ed612ba042266ababb784e9f4" +checksum = "6f69f5ef8b7fe7660f201d32058e82011747c25f57ee3a2012d23a06cf88df65" dependencies = [ "swc_atoms", "swc_common", @@ -1824,9 +2017,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_compat" -version = "0.159.16" +version = "0.160.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0be21b678c1bec2e24bf807187461bde2d8e08b991173cce1b1c2ca2fcf1d307" +checksum = "fab79951f3198d10dfe88483403eac05e72776716fa789bd1de5162305ff0a9d" dependencies = [ "arrayvec", "indexmap 1.9.3", @@ -1838,6 +2031,17 @@ dependencies = [ "swc_common", "swc_config", "swc_ecma_ast", + "swc_ecma_compat_bugfixes", + "swc_ecma_compat_common", + "swc_ecma_compat_es2015", + "swc_ecma_compat_es2016", + "swc_ecma_compat_es2017", + "swc_ecma_compat_es2018", + "swc_ecma_compat_es2019", + "swc_ecma_compat_es2020", + "swc_ecma_compat_es2021", + "swc_ecma_compat_es2022", + "swc_ecma_compat_es3", "swc_ecma_transforms_base", "swc_ecma_transforms_classes", "swc_ecma_transforms_macros", @@ -1862,9 +2066,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_module" -version = "0.176.20" +version = "0.177.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "814598ac1079bba87c69ae1b191857dd3f9da2080885967fd50f785fe4775f62" +checksum = "a5c5e796333fb4a7c4e066e0402685d3d1ac008802e012f51d8579935fe03f4b" dependencies = [ "Inflector", "anyhow", @@ -1889,9 +2093,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "0.193.27" +version = "0.194.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7061fc7578140c458652b281f3a6d8bd293a1adb3ad1a6bdf4b34bddc114be1" +checksum = "cd49e80cff89cb41bae51e225a30883f5bd8cf013c62f198c598f0a39a3eeae2" dependencies = [ "dashmap", "indexmap 1.9.3", @@ -1913,9 +2117,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_proposal" -version = "0.167.20" +version = "0.168.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c1b2c1d36416ac5b03b804d38bb455205b6540c531748fdd30b584f7d1916d0" +checksum = "333698d903d15fb4689d38dff2bd5b42323b9649b549cfa8da9fd778a4c202f1" dependencies = [ "either", "rustc-hash", @@ -1933,9 +2137,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "0.179.20" +version = "0.180.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63f846ebbf26d88538a4fcbb30e4f721d4ebcb8d2cf2f30dba555a11c00cc864" +checksum = "6a2c78d2983bfe9fef24011ca84e043f21fa0062eb456313709e08336818c4cb" dependencies = [ "base64 0.13.1", "dashmap", @@ -1957,9 +2161,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "0.183.26" +version = "0.184.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6260277312ebd99a207114edac5721724a1b2e5b2aed9c604ae98c11de347f5e" +checksum = "c96270280171c483bb4ba07c86d632fdad972e166218b8bf7d318e973a0b8d7e" dependencies = [ "ryu-js", "serde", @@ -1974,9 +2178,9 @@ dependencies = [ [[package]] name = "swc_ecma_usage_analyzer" -version = "0.19.3" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91afe4cab139c51dfe8bcb1401cb6e53e900cc88fcfc65e370aa1b96fff842d0" +checksum = "cbcc74133a02ae615f16daaac24c58e6194e6da000252e9469216838231f24af" dependencies = [ "indexmap 1.9.3", "rustc-hash", @@ -1991,9 +2195,9 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "0.123.3" +version = "0.124.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46a1ead96a2422d0b4a9ff42cde3e529dfc8dafac26a310fbcfb28ba6f158571" +checksum = "3b291111880425c55b0b4e0033aed30950a945fee788850054d1039c0e039ea7" dependencies = [ "indexmap 1.9.3", "num_cpus", @@ -2009,9 +2213,9 @@ dependencies = [ [[package]] name = "swc_ecma_visit" -version = "0.95.2" +version = "0.96.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2decba8d98d8ecb241e3a75df568bb3818c657adeef7bc2025335a1efbd92d60" +checksum = "47081acd84cdb2d49d6340ed3204e17738b444da10a3e1dd1eb3d7c8e4d47091" dependencies = [ "num-bigint", "swc_atoms", @@ -2035,9 +2239,9 @@ dependencies = [ [[package]] name = "swc_error_reporters" -version = "0.16.2" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4af16b3941d6ca7b16a6ef882c8b1b179158ddb588d77ba9cc6da8170f192540" +checksum = "015cbdf2b13ccc76eb12d1702a90fb9aae7b3cddacaf2c56a1b1a4a02f9fcd81" dependencies = [ "anyhow", "miette", @@ -2048,9 +2252,9 @@ dependencies = [ [[package]] name = "swc_fast_graph" -version = "0.20.2" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cb088cba15977a1c7959d9f319c72705ab0e8bbb352cdbe068de1749bf846e0" +checksum = "b97e69e9617913611e39284cf724a412ab7fc6081708d0ef2820855774da5357" dependencies = [ "indexmap 1.9.3", "petgraph", @@ -2072,9 +2276,9 @@ dependencies = [ [[package]] name = "swc_node_comments" -version = "0.19.2" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7020412829d83fa3a8ac787ba7c2b7c9bd2359b33e93dce4e8663d23e973fc7b" +checksum = "cf250afa389a40c4856a250d63f5b1f8d46b513446299b72166c870c7641c365" dependencies = [ "dashmap", "swc_atoms", @@ -2083,9 +2287,9 @@ dependencies = [ [[package]] name = "swc_timer" -version = "0.20.2" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1841a4bd92674f684a3e27b8e162d4eac912af87b34ecd4b6dc126fe4fd230fe" +checksum = "77a6e150f91760ccaca6f6b797b95ffb00bbc245a71311c483b84a7bc700e9c4" dependencies = [ "tracing", ] diff --git a/rust/parse_ast/Cargo.toml b/rust/parse_ast/Cargo.toml index 1c5f421a8..14435b5db 100644 --- a/rust/parse_ast/Cargo.toml +++ b/rust/parse_ast/Cargo.toml @@ -7,12 +7,12 @@ edition = "2021" [dependencies] anyhow = "1.0.75" -swc = "0.266.37" -swc_common = "0.32.2" -swc_ecma_ast = "0.109.2" -swc_ecma_parser = "0.140.1" -swc_error_reporters = "0.16.2" +swc = "0.268.7" +swc_common = "0.33.0" +swc_ecma_ast = "0.110.0" +swc_ecma_parser = "0.141.1" +swc_error_reporters = "0.17.0" parking_lot = "0.12.1" -swc_ecma_lints = "0.88.9" -swc_ecma_transforms_base = "0.133.8" -swc_ecma_visit = "0.95.2" +swc_ecma_lints = "0.89.3" +swc_ecma_transforms_base = "0.134.3" +swc_ecma_visit = "0.96.0" diff --git a/src/rollup/types.d.ts b/src/rollup/types.d.ts index d99306cd5..ac02d07a8 100644 --- a/src/rollup/types.d.ts +++ b/src/rollup/types.d.ts @@ -54,7 +54,7 @@ export interface ExistingDecodedSourceMap { names: string[]; sourceRoot?: string; sources: string[]; - sourcesContent?: (string | null)[]; + sourcesContent?: string[]; version: number; x_google_ignoreList?: number[]; } @@ -65,7 +65,7 @@ export interface ExistingRawSourceMap { names: string[]; sourceRoot?: string; sources: string[]; - sourcesContent?: (string | null)[]; + sourcesContent?: string[]; version: number; x_google_ignoreList?: number[]; } @@ -82,7 +82,7 @@ export interface SourceMap { mappings: string; names: string[]; sources: string[]; - sourcesContent: (string | null)[]; + sourcesContent?: string[]; version: number; toString(): string; toUrl(): string; diff --git a/src/utils/collapseSourcemaps.ts b/src/utils/collapseSourcemaps.ts index 2dccee8d8..86417cadb 100644 --- a/src/utils/collapseSourcemaps.ts +++ b/src/utils/collapseSourcemaps.ts @@ -12,11 +12,11 @@ import { error, logConflictingSourcemapSources, logSourcemapBroken } from './log import { basename, dirname, relative, resolve } from './path'; class Source { - readonly content: string | null; + readonly content: string; readonly filename: string; isOriginal = true; - constructor(filename: string, content: string | null) { + constructor(filename: string, content: string) { this.filename = filename; this.content = content; } @@ -50,7 +50,7 @@ class Link { traceMappings() { const sources: string[] = []; const sourceIndexMap = new Map(); - const sourcesContent: (string | null)[] = []; + const sourcesContent: string[] = []; const names: string[] = []; const nameIndexMap = new Map(); @@ -194,7 +194,7 @@ function getCollapsedSourcemap( export function collapseSourcemaps( file: string, - map: DecodedSourceMap, + map: Omit & { sourcesContent: Array }, modules: readonly Module[], bundleSourcemapChain: readonly DecodedSourceMapOrMissing[], excludeContent: boolean | undefined, From e2f947f28ef921568ae03af9b9e868b9e7c712fa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 13 Oct 2023 10:28:20 +0000 Subject: [PATCH 35/44] chore(deps): update dependency rollup to v4 (#5196) * chore(deps): update dependency rollup to v4 * Update plugins --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Lukas Taegert-Atkinson --- build-plugins/replace-browser-modules.ts | 5 +- package-lock.json | 214 +++++++++++++++++++++-- package.json | 8 +- 3 files changed, 206 insertions(+), 21 deletions(-) diff --git a/build-plugins/replace-browser-modules.ts b/build-plugins/replace-browser-modules.ts index ff6a3c730..da9195671 100644 --- a/build-plugins/replace-browser-modules.ts +++ b/build-plugins/replace-browser-modules.ts @@ -1,5 +1,6 @@ import { dirname, join } from 'node:path'; import { fileURLToPath } from 'node:url'; +import type { Plugin as RollupPlugin } from 'rollup'; import type { Plugin } from 'vite'; const resolve = (path: string) => fileURLToPath(new URL(`../${path}`, import.meta.url)); @@ -29,12 +30,12 @@ const wasmModulesMap: ModulesMap = [[resolve('native'), resolve('browser/src/was const resolutions: ReadonlyMap = new Map([...jsModulesMap, ...wasmModulesMap]); -export default function replaceBrowserModules(): Plugin { +export default function replaceBrowserModules(): Plugin & RollupPlugin { return { apply: 'serve', enforce: 'pre', name: 'replace-browser-modules', - resolveId(source, importer) { + resolveId(source: string, importer: string | undefined) { if (importer && source[0] === '.') { return resolutions.get(join(dirname(importer), source)); } diff --git a/package-lock.json b/package-lock.json index 30bf44778..f2588972e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ "@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-replace": "^5.0.3", "@rollup/plugin-terser": "^0.4.4", - "@rollup/plugin-typescript": "11.1.4", + "@rollup/plugin-typescript": "11.1.5", "@rollup/pluginutils": "^5.0.5", "@types/estree": "1.0.2", "@types/mocha": "^10.0.2", @@ -65,7 +65,7 @@ "is-reference": "^3.0.2", "lint-staged": "^14.0.1", "locate-character": "^3.0.0", - "magic-string": "^0.30.4", + "magic-string": "^0.30.5", "mocha": "^10.2.0", "nyc": "^15.1.0", "pinia": "^2.1.6", @@ -73,8 +73,8 @@ "pretty-bytes": "^6.1.1", "pretty-ms": "^8.0.0", "requirejs": "^2.3.6", - "rollup": "^3.29.4", - "rollup-plugin-license": "^3.1.0", + "rollup": "^4.0.2", + "rollup-plugin-license": "github:lukastaegert/rollup-plugin-license", "rollup-plugin-string": "^3.0.0", "rollup-plugin-thatworks": "^1.0.4", "semver": "^7.5.4", @@ -1860,9 +1860,9 @@ } }, "node_modules/@rollup/plugin-typescript": { - "version": "11.1.4", - "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-11.1.4.tgz", - "integrity": "sha512-WZRh5LBVLQXdKFICUId5J3eIpmjGURaBqntfg3GSZACgeOAFS+lOSMGTwfzDkELTaZVp/lWdMVNU3UkwCUBg/Q==", + "version": "11.1.5", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-11.1.5.tgz", + "integrity": "sha512-rnMHrGBB0IUEv69Q8/JGRD/n4/n6b3nfpufUu26axhUcboUzv/twfZU8fIBbTOphRAe0v8EyxzeDpKXqGHfyDA==", "dev": true, "dependencies": { "@rollup/pluginutils": "^5.0.1", @@ -1872,7 +1872,7 @@ "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^2.14.0||^3.0.0", + "rollup": "^2.14.0||^3.0.0||^4.0.0", "tslib": "*", "typescript": ">=3.7.0" }, @@ -1907,6 +1907,162 @@ } } }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.0.2.tgz", + "integrity": "sha512-xDvk1pT4vaPU2BOLy0MqHMdYZyntqpaBf8RhBiezlqG9OjY8F50TyctHo8znigYKd+QCFhCmlmXHOL/LoaOl3w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.0.2.tgz", + "integrity": "sha512-lqCglytY3E6raze27DD9VQJWohbwCxzqs9aSHcj5X/8hJpzZfNdbsr4Ja9Hqp6iPyF53+5PtPx0pKRlkSvlHZg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.0.2.tgz", + "integrity": "sha512-nkBKItS6E6CCzvRwgiKad+j+1ibmL7SIInj7oqMWmdkCjiSX6VeVZw2mLlRKIUL+JjsBgpATTfo7BiAXc1v0jA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.0.2.tgz", + "integrity": "sha512-vX2C8xvWPIbpEgQht95+dY6BReKAvtDgPDGi0XN0kWJKkm4WdNmq5dnwscv/zxvi+n6jUTBhs6GtpkkWT4q8Gg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.0.2.tgz", + "integrity": "sha512-DVFIfcHOjgmeHOAqji4xNz2wczt1Bmzy9MwBZKBa83SjBVO/i38VHDR+9ixo8QpBOiEagmNw12DucG+v55tCrg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.0.2.tgz", + "integrity": "sha512-GCK/a9ItUxPI0V5hQEJjH4JtOJO90GF2Hja7TO+EZ8rmkGvEi8/ZDMhXmcuDpQT7/PWrTT9RvnG8snMd5SrhBQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.0.2.tgz", + "integrity": "sha512-cLuBp7rOjIB1R2j/VazjCmHC7liWUur2e9mFflLJBAWCkrZ+X0+QwHLvOQakIwDymungzAKv6W9kHZnTp/Mqrg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.0.2.tgz", + "integrity": "sha512-Zqw4iVnJr2naoyQus0yLy7sLtisCQcpdMKUCeXPBjkJtpiflRime/TMojbnl8O3oxUAj92mxr+t7im/RbgA20w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.0.2.tgz", + "integrity": "sha512-jJRU9TyUD/iMqjf8aLAp7XiN3pIj5v6Qcu+cdzBfVTKDD0Fvua4oUoK8eVJ9ZuKBEQKt3WdlcwJXFkpmMLk6kg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.0.2.tgz", + "integrity": "sha512-ZkS2NixCxHKC4zbOnw64ztEGGDVIYP6nKkGBfOAxEPW71Sji9v8z3yaHNuae/JHPwXA+14oDefnOuVfxl59SmQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.0.2.tgz", + "integrity": "sha512-3SKjj+tvnZ0oZq2BKB+fI+DqYI83VrRzk7eed8tJkxeZ4zxJZcLSE8YDQLYGq1tZAnAX+H076RHHB4gTZXsQzw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.0.2.tgz", + "integrity": "sha512-MBdJIOxRauKkry7t2q+rTHa3aWjVez2eioWg+etRVS3dE4tChhmt5oqZYr48R6bPmcwEhxQr96gVRfeQrLbqng==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@types/buble": { "version": "0.19.2", "resolved": "https://registry.npmjs.org/@types/buble/-/buble-0.19.2.tgz", @@ -8810,26 +8966,38 @@ } }, "node_modules/rollup": { - "version": "3.29.4", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz", - "integrity": "sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.0.2.tgz", + "integrity": "sha512-MCScu4usMPCeVFaiLcgMDaBQeYi1z6vpWxz0r0hq0Hv77Y2YuOTZldkuNJ54BdYBH3e+nkrk6j0Rre/NLDBYzg==", "dev": true, "bin": { "rollup": "dist/bin/rollup" }, "engines": { - "node": ">=14.18.0", + "node": ">=18.0.0", "npm": ">=8.0.0" }, "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.0.2", + "@rollup/rollup-android-arm64": "4.0.2", + "@rollup/rollup-darwin-arm64": "4.0.2", + "@rollup/rollup-darwin-x64": "4.0.2", + "@rollup/rollup-linux-arm-gnueabihf": "4.0.2", + "@rollup/rollup-linux-arm64-gnu": "4.0.2", + "@rollup/rollup-linux-arm64-musl": "4.0.2", + "@rollup/rollup-linux-x64-gnu": "4.0.2", + "@rollup/rollup-linux-x64-musl": "4.0.2", + "@rollup/rollup-win32-arm64-msvc": "4.0.2", + "@rollup/rollup-win32-ia32-msvc": "4.0.2", + "@rollup/rollup-win32-x64-msvc": "4.0.2", "fsevents": "~2.3.2" } }, "node_modules/rollup-plugin-license": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-license/-/rollup-plugin-license-3.1.0.tgz", - "integrity": "sha512-Cny2H2hJ7K+VdcJkH1pNcYRVhqIhZNu/fPusedW53fNZQOIwpXiznJ220EFvDkJbFUEkLqIDsDB5bEr/N9qfqw==", + "resolved": "git+ssh://git@github.com/lukastaegert/rollup-plugin-license.git#71dfb8296e00864f1eb2278a6d77f8f6e978e4b1", "dev": true, + "license": "MIT", "dependencies": { "commenting": "~1.1.0", "glob": "~7.2.0", @@ -8845,7 +9013,7 @@ "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^1.0.0 || ^2.0.0 || ^3.0.0" + "rollup": "^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0" } }, "node_modules/rollup-plugin-license/node_modules/glob": { @@ -10280,6 +10448,22 @@ } } }, + "node_modules/vite/node_modules/rollup": { + "version": "3.29.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz", + "integrity": "sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==", + "dev": true, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=14.18.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, "node_modules/vitepress": { "version": "1.0.0-rc.21", "resolved": "https://registry.npmjs.org/vitepress/-/vitepress-1.0.0-rc.21.tgz", diff --git a/package.json b/package.json index cb862547c..9b40b16a2 100644 --- a/package.json +++ b/package.json @@ -120,7 +120,7 @@ "@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-replace": "^5.0.3", "@rollup/plugin-terser": "^0.4.4", - "@rollup/plugin-typescript": "11.1.4", + "@rollup/plugin-typescript": "11.1.5", "@rollup/pluginutils": "^5.0.5", "@types/estree": "1.0.2", "@types/mocha": "^10.0.2", @@ -157,7 +157,7 @@ "is-reference": "^3.0.2", "lint-staged": "^14.0.1", "locate-character": "^3.0.0", - "magic-string": "^0.30.4", + "magic-string": "^0.30.5", "mocha": "^10.2.0", "nyc": "^15.1.0", "pinia": "^2.1.6", @@ -165,8 +165,8 @@ "pretty-bytes": "^6.1.1", "pretty-ms": "^8.0.0", "requirejs": "^2.3.6", - "rollup": "^3.29.4", - "rollup-plugin-license": "^3.1.0", + "rollup": "^4.0.2", + "rollup-plugin-license": "github:lukastaegert/rollup-plugin-license", "rollup-plugin-string": "^3.0.0", "rollup-plugin-thatworks": "^1.0.4", "semver": "^7.5.4", From 72c66398cd3e8d52e6812ff94b721a1a56ad7cdd Mon Sep 17 00:00:00 2001 From: Adam Hines Date: Fri, 13 Oct 2023 23:19:54 -0600 Subject: [PATCH 36/44] perf: reducing ast node memory overhead (#5133) * perf: pack booleans in bitfield Booleans are represented by numbers and take up 4 bytes each at the time of this commit in v8. This commit packs all the boolean fields of the AST nodes into a single 32-bit integer which ammortizes the cost of the boolean fields. The end result is smaller AST nodes. * chore: use bit shifts instead of binary literals * chore: remove context wrapper accessor from node We now just access through `this.scope.context` directly. * chore: cleaning up keys assignment --------- Co-authored-by: Lukas Taegert-Atkinson --- src/ast/keys.ts | 5 +- src/ast/nodes/ArrayExpression.ts | 2 +- src/ast/nodes/ArrowFunctionExpression.ts | 3 +- src/ast/nodes/AssignmentExpression.ts | 2 +- src/ast/nodes/AssignmentPattern.ts | 2 +- src/ast/nodes/AwaitExpression.ts | 4 +- src/ast/nodes/BlockStatement.ts | 21 ++++-- src/ast/nodes/CallExpression.ts | 15 ++-- src/ast/nodes/CatchClause.ts | 8 +-- src/ast/nodes/ClassBody.ts | 11 +-- src/ast/nodes/ConditionalExpression.ts | 9 ++- src/ast/nodes/ExportAllDeclaration.ts | 2 +- src/ast/nodes/ExportDefaultDeclaration.ts | 8 +-- src/ast/nodes/ExportNamedDeclaration.ts | 2 +- src/ast/nodes/ExpressionStatement.ts | 4 +- src/ast/nodes/ForInStatement.ts | 8 +-- src/ast/nodes/ForOfStatement.ts | 17 +++-- src/ast/nodes/ForStatement.ts | 6 +- src/ast/nodes/Identifier.ts | 35 +++++++--- src/ast/nodes/IfStatement.ts | 10 +-- src/ast/nodes/ImportDeclaration.ts | 2 +- src/ast/nodes/ImportExpression.ts | 6 +- src/ast/nodes/Literal.ts | 4 +- src/ast/nodes/LogicalExpression.ts | 15 +++- src/ast/nodes/MemberExpression.ts | 61 +++++++++++++---- src/ast/nodes/MetaProperty.ts | 6 +- src/ast/nodes/NewExpression.ts | 2 +- src/ast/nodes/Program.ts | 4 +- src/ast/nodes/Property.ts | 26 +++++-- src/ast/nodes/PropertyDefinition.ts | 9 ++- src/ast/nodes/RestElement.ts | 2 +- src/ast/nodes/SpreadElement.ts | 4 +- src/ast/nodes/StaticBlock.ts | 6 +- src/ast/nodes/Super.ts | 2 +- src/ast/nodes/SwitchStatement.ts | 9 ++- src/ast/nodes/TaggedTemplateExpression.ts | 4 +- src/ast/nodes/TemplateElement.ts | 9 ++- src/ast/nodes/ThisExpression.ts | 8 ++- src/ast/nodes/TryStatement.ts | 7 +- src/ast/nodes/UnaryExpression.ts | 11 ++- src/ast/nodes/UpdateExpression.ts | 2 +- src/ast/nodes/shared/BitFlags.ts | 32 +++++++++ src/ast/nodes/shared/CallExpressionBase.ts | 2 +- src/ast/nodes/shared/ClassNode.ts | 7 +- src/ast/nodes/shared/Expression.ts | 10 ++- src/ast/nodes/shared/FunctionBase.ts | 22 ++++-- src/ast/nodes/shared/FunctionNode.ts | 3 +- src/ast/nodes/shared/MethodBase.ts | 9 ++- src/ast/nodes/shared/MultiExpression.ts | 2 - src/ast/nodes/shared/Node.ts | 80 ++++++++++++++-------- src/ast/nodes/shared/ObjectEntity.ts | 26 ++++++- src/ast/scopes/ChildScope.ts | 5 +- src/ast/scopes/ClassBodyScope.ts | 4 +- src/ast/scopes/ModuleScope.ts | 4 +- src/ast/scopes/ParameterScope.ts | 6 +- src/ast/variables/NamespaceVariable.ts | 3 +- src/utils/parseImportAttributes.ts | 6 +- 57 files changed, 411 insertions(+), 183 deletions(-) create mode 100644 src/ast/nodes/shared/BitFlags.ts diff --git a/src/ast/keys.ts b/src/ast/keys.ts index e9f9d4379..74e79f35a 100644 --- a/src/ast/keys.ts +++ b/src/ast/keys.ts @@ -7,9 +7,8 @@ export const keys: { Program: ['body'] }; -export function getAndCreateKeys(esTreeNode: GenericEsTreeNode): string[] { - keys[esTreeNode.type] = Object.keys(esTreeNode).filter( +export function createKeysForNode(esTreeNode: GenericEsTreeNode): string[] { + return Object.keys(esTreeNode).filter( key => typeof esTreeNode[key] === 'object' && key.charCodeAt(0) !== 95 /* _ */ ); - return keys[esTreeNode.type]; } diff --git a/src/ast/nodes/ArrayExpression.ts b/src/ast/nodes/ArrayExpression.ts index e82652eb9..1d731e364 100644 --- a/src/ast/nodes/ArrayExpression.ts +++ b/src/ast/nodes/ArrayExpression.ts @@ -76,7 +76,7 @@ export default class ArrayExpression extends NodeBase { element.deoptimizePath(UNKNOWN_PATH); } } - this.context.requestTreeshakingPass(); + this.scope.context.requestTreeshakingPass(); } private getObjectEntity(): ObjectEntity { diff --git a/src/ast/nodes/ArrowFunctionExpression.ts b/src/ast/nodes/ArrowFunctionExpression.ts index cb685e4a3..66135d144 100644 --- a/src/ast/nodes/ArrowFunctionExpression.ts +++ b/src/ast/nodes/ArrowFunctionExpression.ts @@ -14,7 +14,6 @@ import { OBJECT_PROTOTYPE } from './shared/ObjectPrototype'; import type { PatternNode } from './shared/Pattern'; export default class ArrowFunctionExpression extends FunctionBase { - declare async: boolean; declare body: BlockStatement | ExpressionNode; declare params: readonly PatternNode[]; declare preventChildBlockScope: true; @@ -23,7 +22,7 @@ export default class ArrowFunctionExpression extends FunctionBase { protected objectEntity: ObjectEntity | null = null; createScope(parentScope: Scope): void { - this.scope = new ReturnValueScope(parentScope, this.context); + this.scope = new ReturnValueScope(parentScope, this.scope.context); } hasEffects(): boolean { diff --git a/src/ast/nodes/AssignmentExpression.ts b/src/ast/nodes/AssignmentExpression.ts index 184ff7c32..ee5386e0e 100644 --- a/src/ast/nodes/AssignmentExpression.ts +++ b/src/ast/nodes/AssignmentExpression.ts @@ -155,6 +155,6 @@ export default class AssignmentExpression extends NodeBase { this.deoptimized = true; this.left.deoptimizePath(EMPTY_PATH); this.right.deoptimizePath(UNKNOWN_PATH); - this.context.requestTreeshakingPass(); + this.scope.context.requestTreeshakingPass(); } } diff --git a/src/ast/nodes/AssignmentPattern.ts b/src/ast/nodes/AssignmentPattern.ts index 1e138a117..e20bdb077 100644 --- a/src/ast/nodes/AssignmentPattern.ts +++ b/src/ast/nodes/AssignmentPattern.ts @@ -58,6 +58,6 @@ export default class AssignmentPattern extends NodeBase implements PatternNode { this.deoptimized = true; this.left.deoptimizePath(EMPTY_PATH); this.right.deoptimizePath(UNKNOWN_PATH); - this.context.requestTreeshakingPass(); + this.scope.context.requestTreeshakingPass(); } } diff --git a/src/ast/nodes/AwaitExpression.ts b/src/ast/nodes/AwaitExpression.ts index aafe59956..25f262c0e 100644 --- a/src/ast/nodes/AwaitExpression.ts +++ b/src/ast/nodes/AwaitExpression.ts @@ -17,13 +17,13 @@ export default class AwaitExpression extends NodeBase { if (!this.deoptimized) this.applyDeoptimizations(); if (!this.included) { this.included = true; - checkTopLevelAwait: if (!this.context.usesTopLevelAwait) { + checkTopLevelAwait: if (!this.scope.context.usesTopLevelAwait) { let parent = this.parent; do { if (parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression) break checkTopLevelAwait; } while ((parent = (parent as Node).parent as Node)); - this.context.usesTopLevelAwait = true; + this.scope.context.usesTopLevelAwait = true; } } this.argument.include(context, includeChildrenRecursively); diff --git a/src/ast/nodes/BlockStatement.ts b/src/ast/nodes/BlockStatement.ts index b2745f94a..bb7343fe2 100644 --- a/src/ast/nodes/BlockStatement.ts +++ b/src/ast/nodes/BlockStatement.ts @@ -3,9 +3,9 @@ import { type RenderOptions, renderStatementList } from '../../utils/renderHelpe import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import BlockScope from '../scopes/BlockScope'; import type ChildScope from '../scopes/ChildScope'; -import type Scope from '../scopes/Scope'; import ExpressionStatement from './ExpressionStatement'; import * as NodeType from './NodeType'; +import { Flag, isFlagSet, setFlag } from './shared/BitFlags'; import { UNKNOWN_EXPRESSION } from './shared/Expression'; import { type IncludeChildren, type Node, StatementBase, type StatementNode } from './shared/Node'; @@ -13,8 +13,19 @@ export default class BlockStatement extends StatementBase { declare body: readonly StatementNode[]; declare type: NodeType.tBlockStatement; - private declare deoptimizeBody: boolean; - private directlyIncluded = false; + private get deoptimizeBody(): boolean { + return isFlagSet(this.flags, Flag.deoptimizeBody); + } + private set deoptimizeBody(value: boolean) { + this.flags = setFlag(this.flags, Flag.deoptimizeBody, value); + } + + private get directlyIncluded(): boolean { + return isFlagSet(this.flags, Flag.directlyIncluded); + } + private set directlyIncluded(value: boolean) { + this.flags = setFlag(this.flags, Flag.directlyIncluded, value); + } addImplicitReturnExpressionToScope(): void { const lastStatement = this.body[this.body.length - 1]; @@ -23,10 +34,10 @@ export default class BlockStatement extends StatementBase { } } - createScope(parentScope: Scope): void { + createScope(parentScope: ChildScope): void { this.scope = (this.parent as Node).preventChildBlockScope ? (parentScope as ChildScope) - : new BlockScope(parentScope); + : new BlockScope(parentScope, this.scope.context); } hasEffects(context: HasEffectsContext): boolean { diff --git a/src/ast/nodes/CallExpression.ts b/src/ast/nodes/CallExpression.ts index 157859a02..3d6639151 100644 --- a/src/ast/nodes/CallExpression.ts +++ b/src/ast/nodes/CallExpression.ts @@ -13,6 +13,7 @@ import MemberExpression from './MemberExpression'; import type * as NodeType from './NodeType'; import type SpreadElement from './SpreadElement'; import type Super from './Super'; +import { Flag, isFlagSet, setFlag } from './shared/BitFlags'; import CallExpressionBase from './shared/CallExpressionBase'; import { type ExpressionEntity, UNKNOWN_RETURN_EXPRESSION } from './shared/Expression'; import type { ChainElement, ExpressionNode, IncludeChildren } from './shared/Node'; @@ -24,20 +25,26 @@ export default class CallExpression { declare arguments: (ExpressionNode | SpreadElement)[]; declare callee: ExpressionNode | Super; - declare optional: boolean; declare type: NodeType.tCallExpression; + get optional(): boolean { + return isFlagSet(this.flags, Flag.optional); + } + set optional(value: boolean) { + this.flags = setFlag(this.flags, Flag.optional, value); + } + bind(): void { super.bind(); if (this.callee instanceof Identifier) { const variable = this.scope.findVariable(this.callee.name); if (variable.isNamespace) { - this.context.log(LOGLEVEL_WARN, logCannotCallNamespace(this.callee.name), this.start); + this.scope.context.log(LOGLEVEL_WARN, logCannotCallNamespace(this.callee.name), this.start); } if (this.callee.name === 'eval') { - this.context.log(LOGLEVEL_WARN, logEval(this.context.module.id), this.start); + this.scope.context.log(LOGLEVEL_WARN, logEval(this.scope.context.module.id), this.start); } } this.interaction = { @@ -114,7 +121,7 @@ export default class CallExpression EMPTY_PATH, SHARED_RECURSION_TRACKER ); - this.context.requestTreeshakingPass(); + this.scope.context.requestTreeshakingPass(); } protected getReturnExpression( diff --git a/src/ast/nodes/CatchClause.ts b/src/ast/nodes/CatchClause.ts index 5a85f4ad1..135bacf25 100644 --- a/src/ast/nodes/CatchClause.ts +++ b/src/ast/nodes/CatchClause.ts @@ -1,5 +1,5 @@ import CatchScope from '../scopes/CatchScope'; -import type Scope from '../scopes/Scope'; +import type ChildScope from '../scopes/ChildScope'; import type BlockStatement from './BlockStatement'; import type * as NodeType from './NodeType'; import { UNKNOWN_EXPRESSION } from './shared/Expression'; @@ -13,8 +13,8 @@ export default class CatchClause extends NodeBase { declare scope: CatchScope; declare type: NodeType.tCatchClause; - createScope(parentScope: Scope): void { - this.scope = new CatchScope(parentScope, this.context); + createScope(parentScope: ChildScope): void { + this.scope = new CatchScope(parentScope, this.scope.context); } parseNode(esTreeNode: GenericEsTreeNode): void { @@ -23,7 +23,7 @@ export default class CatchClause extends NodeBase { // name instead of the variable const { param } = esTreeNode; if (param) { - (this.param as GenericEsTreeNode) = new (this.context.getNodeConstructor(param.type))( + (this.param as GenericEsTreeNode) = new (this.scope.context.getNodeConstructor(param.type))( param, this, this.scope diff --git a/src/ast/nodes/ClassBody.ts b/src/ast/nodes/ClassBody.ts index 21da58a44..325b2f327 100644 --- a/src/ast/nodes/ClassBody.ts +++ b/src/ast/nodes/ClassBody.ts @@ -1,6 +1,7 @@ import type { InclusionContext } from '../ExecutionContext'; +import type ChildScope from '../scopes/ChildScope'; import ClassBodyScope from '../scopes/ClassBodyScope'; -import type Scope from '../scopes/Scope'; + import type MethodDefinition from './MethodDefinition'; import type * as NodeType from './NodeType'; import type PropertyDefinition from './PropertyDefinition'; @@ -12,13 +13,13 @@ export default class ClassBody extends NodeBase { declare scope: ClassBodyScope; declare type: NodeType.tClassBody; - createScope(parentScope: Scope): void { - this.scope = new ClassBodyScope(parentScope, this.parent as ClassNode, this.context); + createScope(parentScope: ChildScope): void { + this.scope = new ClassBodyScope(parentScope, this.parent as ClassNode, this.scope.context); } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { this.included = true; - this.context.includeVariableInModule(this.scope.thisVariable); + this.scope.context.includeVariableInModule(this.scope.thisVariable); for (const definition of this.body) { definition.include(context, includeChildrenRecursively); } @@ -28,7 +29,7 @@ export default class ClassBody extends NodeBase { const body: NodeBase[] = (this.body = []); for (const definition of esTreeNode.body) { body.push( - new (this.context.getNodeConstructor(definition.type))( + new (this.scope.context.getNodeConstructor(definition.type))( definition, this, definition.static ? this.scope : this.scope.instanceScope diff --git a/src/ast/nodes/ConditionalExpression.ts b/src/ast/nodes/ConditionalExpression.ts index 94800c20e..5645a23f9 100644 --- a/src/ast/nodes/ConditionalExpression.ts +++ b/src/ast/nodes/ConditionalExpression.ts @@ -13,6 +13,7 @@ import type { ObjectPath, PathTracker } from '../utils/PathTracker'; import { EMPTY_PATH, SHARED_RECURSION_TRACKER, UNKNOWN_PATH } from '../utils/PathTracker'; import type * as NodeType from './NodeType'; import type SpreadElement from './SpreadElement'; +import { Flag, isFlagSet, setFlag } from './shared/BitFlags'; import type { ExpressionEntity, LiteralValueOrUnknown } from './shared/Expression'; import { UnknownValue } from './shared/Expression'; import { MultiExpression } from './shared/MultiExpression'; @@ -25,8 +26,14 @@ export default class ConditionalExpression extends NodeBase implements Deoptimiz declare test: ExpressionNode; declare type: NodeType.tConditionalExpression; + get isBranchResolutionAnalysed(): boolean { + return isFlagSet(this.flags, Flag.isBranchResolutionAnalysed); + } + set isBranchResolutionAnalysed(value: boolean) { + this.flags = setFlag(this.flags, Flag.isBranchResolutionAnalysed, value); + } + private expressionsToBeDeoptimized: DeoptimizableEntity[] = []; - private isBranchResolutionAnalysed = false; private usedBranch: ExpressionNode | null = null; deoptimizeArgumentsOnInteractionAtPath( diff --git a/src/ast/nodes/ExportAllDeclaration.ts b/src/ast/nodes/ExportAllDeclaration.ts index 271e36d7a..e4bb9f893 100644 --- a/src/ast/nodes/ExportAllDeclaration.ts +++ b/src/ast/nodes/ExportAllDeclaration.ts @@ -18,7 +18,7 @@ export default class ExportAllDeclaration extends NodeBase { } initialise(): void { - this.context.addExport(this); + this.scope.context.addExport(this); } render(code: MagicString, _options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void { diff --git a/src/ast/nodes/ExportDefaultDeclaration.ts b/src/ast/nodes/ExportDefaultDeclaration.ts index b6bf1d32b..3101bd8ce 100644 --- a/src/ast/nodes/ExportDefaultDeclaration.ts +++ b/src/ast/nodes/ExportDefaultDeclaration.ts @@ -44,7 +44,7 @@ export default class ExportDefaultDeclaration extends NodeBase { include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { super.include(context, includeChildrenRecursively); if (includeChildrenRecursively) { - this.context.includeVariableInModule(this.variable); + this.scope.context.includeVariableInModule(this.variable); } } @@ -53,11 +53,11 @@ export default class ExportDefaultDeclaration extends NodeBase { this.declarationName = (declaration.id && declaration.id.name) || (this.declaration as Identifier).name; this.variable = this.scope.addExportDefaultDeclaration( - this.declarationName || this.context.getModuleName(), + this.declarationName || this.scope.context.getModuleName(), this, - this.context + this.scope.context ); - this.context.addExport(this); + this.scope.context.addExport(this); } removeAnnotations(code: MagicString) { diff --git a/src/ast/nodes/ExportNamedDeclaration.ts b/src/ast/nodes/ExportNamedDeclaration.ts index a63ea59e2..08d457e22 100644 --- a/src/ast/nodes/ExportNamedDeclaration.ts +++ b/src/ast/nodes/ExportNamedDeclaration.ts @@ -28,7 +28,7 @@ export default class ExportNamedDeclaration extends NodeBase { } initialise(): void { - this.context.addExport(this); + this.scope.context.addExport(this); } removeAnnotations(code: MagicString) { diff --git a/src/ast/nodes/ExpressionStatement.ts b/src/ast/nodes/ExpressionStatement.ts index e1bb6847e..5f78477c2 100644 --- a/src/ast/nodes/ExpressionStatement.ts +++ b/src/ast/nodes/ExpressionStatement.ts @@ -16,10 +16,10 @@ export default class ExpressionStatement extends StatementBase { this.directive !== 'use strict' && this.parent.type === NodeType.Program ) { - this.context.log( + this.scope.context.log( LOGLEVEL_WARN, // This is necessary, because either way (deleting or not) can lead to errors. - logModuleLevelDirective(this.directive, this.context.module.id), + logModuleLevelDirective(this.directive, this.scope.context.module.id), this.start ); } diff --git a/src/ast/nodes/ForInStatement.ts b/src/ast/nodes/ForInStatement.ts index c18361512..1a32c8dd4 100644 --- a/src/ast/nodes/ForInStatement.ts +++ b/src/ast/nodes/ForInStatement.ts @@ -2,7 +2,7 @@ import type MagicString from 'magic-string'; import { NO_SEMICOLON, type RenderOptions } from '../../utils/renderHelpers'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import BlockScope from '../scopes/BlockScope'; -import type Scope from '../scopes/Scope'; +import type ChildScope from '../scopes/ChildScope'; import { EMPTY_PATH } from '../utils/PathTracker'; import type MemberExpression from './MemberExpression'; import type * as NodeType from './NodeType'; @@ -23,8 +23,8 @@ export default class ForInStatement extends StatementBase { declare right: ExpressionNode; declare type: NodeType.tForInStatement; - createScope(parentScope: Scope): void { - this.scope = new BlockScope(parentScope); + createScope(parentScope: ChildScope): void { + this.scope = new BlockScope(parentScope, this.scope.context); } hasEffects(context: HasEffectsContext): boolean { @@ -60,6 +60,6 @@ export default class ForInStatement extends StatementBase { protected applyDeoptimizations(): void { this.deoptimized = true; this.left.deoptimizePath(EMPTY_PATH); - this.context.requestTreeshakingPass(); + this.scope.context.requestTreeshakingPass(); } } diff --git a/src/ast/nodes/ForOfStatement.ts b/src/ast/nodes/ForOfStatement.ts index ea4f40795..434ca9355 100644 --- a/src/ast/nodes/ForOfStatement.ts +++ b/src/ast/nodes/ForOfStatement.ts @@ -2,11 +2,12 @@ import type MagicString from 'magic-string'; import { NO_SEMICOLON, type RenderOptions } from '../../utils/renderHelpers'; import type { InclusionContext } from '../ExecutionContext'; import BlockScope from '../scopes/BlockScope'; -import type Scope from '../scopes/Scope'; +import type ChildScope from '../scopes/ChildScope'; import { EMPTY_PATH, UNKNOWN_PATH } from '../utils/PathTracker'; import type MemberExpression from './MemberExpression'; import type * as NodeType from './NodeType'; import type VariableDeclaration from './VariableDeclaration'; +import { Flag, isFlagSet, setFlag } from './shared/BitFlags'; import { UNKNOWN_EXPRESSION } from './shared/Expression'; import { type ExpressionNode, @@ -18,14 +19,20 @@ import type { PatternNode } from './shared/Pattern'; import { includeLoopBody } from './shared/loops'; export default class ForOfStatement extends StatementBase { - declare await: boolean; declare body: StatementNode; declare left: VariableDeclaration | PatternNode | MemberExpression; declare right: ExpressionNode; declare type: NodeType.tForOfStatement; - createScope(parentScope: Scope): void { - this.scope = new BlockScope(parentScope); + get await(): boolean { + return isFlagSet(this.flags, Flag.await); + } + set await(value: boolean) { + this.flags = setFlag(this.flags, Flag.await, value); + } + + createScope(parentScope: ChildScope): void { + this.scope = new BlockScope(parentScope, this.scope.context); } hasEffects(): boolean { @@ -61,6 +68,6 @@ export default class ForOfStatement extends StatementBase { this.deoptimized = true; this.left.deoptimizePath(EMPTY_PATH); this.right.deoptimizePath(UNKNOWN_PATH); - this.context.requestTreeshakingPass(); + this.scope.context.requestTreeshakingPass(); } } diff --git a/src/ast/nodes/ForStatement.ts b/src/ast/nodes/ForStatement.ts index 4a88250c2..d3c134f35 100644 --- a/src/ast/nodes/ForStatement.ts +++ b/src/ast/nodes/ForStatement.ts @@ -2,7 +2,7 @@ import type MagicString from 'magic-string'; import { NO_SEMICOLON, type RenderOptions } from '../../utils/renderHelpers'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import BlockScope from '../scopes/BlockScope'; -import type Scope from '../scopes/Scope'; +import type ChildScope from '../scopes/ChildScope'; import type * as NodeType from './NodeType'; import type VariableDeclaration from './VariableDeclaration'; import { @@ -20,8 +20,8 @@ export default class ForStatement extends StatementBase { declare type: NodeType.tForStatement; declare update: ExpressionNode | null; - createScope(parentScope: Scope): void { - this.scope = new BlockScope(parentScope); + createScope(parentScope: ChildScope): void { + this.scope = new BlockScope(parentScope, this.scope.context); } hasEffects(context: HasEffectsContext): boolean { diff --git a/src/ast/nodes/Identifier.ts b/src/ast/nodes/Identifier.ts index 0ab953826..22d439f75 100644 --- a/src/ast/nodes/Identifier.ts +++ b/src/ast/nodes/Identifier.ts @@ -20,6 +20,7 @@ import LocalVariable from '../variables/LocalVariable'; import type Variable from '../variables/Variable'; import * as NodeType from './NodeType'; import type SpreadElement from './SpreadElement'; +import { Flag, isFlagSet, setFlag } from './shared/BitFlags'; import { type ExpressionEntity, type LiteralValueOrUnknown, @@ -42,7 +43,17 @@ export default class Identifier extends NodeBase implements PatternNode { declare name: string; declare type: NodeType.tIdentifier; variable: Variable | null = null; - private isTDZAccess: boolean | null = null; + + private get isTDZAccess(): boolean | null { + if (!isFlagSet(this.flags, Flag.tdzAccessDefined)) { + return null; + } + return isFlagSet(this.flags, Flag.tdzAccess); + } + private set isTDZAccess(value: boolean) { + this.flags = setFlag(this.flags, Flag.tdzAccessDefined, true); + this.flags = setFlag(this.flags, Flag.tdzAccess, value); + } addExportedVariables( variables: Variable[], @@ -62,10 +73,10 @@ export default class Identifier extends NodeBase implements PatternNode { declare(kind: string, init: ExpressionEntity): LocalVariable[] { let variable: LocalVariable; - const { treeshake } = this.context.options; + const { treeshake } = this.scope.context.options; switch (kind) { case 'var': { - variable = this.scope.addDeclaration(this, this.context, init, true); + variable = this.scope.addDeclaration(this, this.scope.context, init, true); if (treeshake && treeshake.correctVarValueBeforeDeclaration) { // Necessary to make sure the init is deoptimized. We cannot call deoptimizePath here. variable.markInitializersForDeoptimization(); @@ -74,13 +85,13 @@ export default class Identifier extends NodeBase implements PatternNode { } case 'function': { // in strict mode, functions are only hoisted within a scope but not across block scopes - variable = this.scope.addDeclaration(this, this.context, init, false); + variable = this.scope.addDeclaration(this, this.scope.context, init, false); break; } case 'let': case 'const': case 'class': { - variable = this.scope.addDeclaration(this, this.context, init, false); + variable = this.scope.addDeclaration(this, this.scope.context, init, false); break; } case 'parameter': { @@ -141,7 +152,8 @@ export default class Identifier extends NodeBase implements PatternNode { return true; } return ( - (this.context.options.treeshake as NormalizedTreeshakingOptions).unknownGlobalSideEffects && + (this.scope.context.options.treeshake as NormalizedTreeshakingOptions) + .unknownGlobalSideEffects && this.variable instanceof GlobalVariable && !this.isPureFunction(EMPTY_PATH) && this.variable.hasEffectsOnInteractionAtPath( @@ -184,7 +196,7 @@ export default class Identifier extends NodeBase implements PatternNode { if (!this.included) { this.included = true; if (this.variable !== null) { - this.context.includeVariableInModule(this.variable); + this.scope.context.includeVariableInModule(this.variable); } } } @@ -198,7 +210,8 @@ export default class Identifier extends NodeBase implements PatternNode { isPossibleTDZ(): boolean { // return cached value to avoid issues with the next tree-shaking pass - if (this.isTDZAccess !== null) return this.isTDZAccess; + const cachedTdzAccess = this.isTDZAccess; + if (cachedTdzAccess !== null) return cachedTdzAccess; if ( !( @@ -207,7 +220,7 @@ export default class Identifier extends NodeBase implements PatternNode { this.variable.kind in tdzVariableKinds && // we ignore possible TDZs due to circular module dependencies as // otherwise we get many false positives - this.variable.module === this.context.module + this.variable.module === this.scope.context.module ) ) { return (this.isTDZAccess = false); @@ -271,7 +284,7 @@ export default class Identifier extends NodeBase implements PatternNode { this.deoptimized = true; if (this.variable instanceof LocalVariable) { this.variable.consolidateInitializers(); - this.context.requestTreeshakingPass(); + this.scope.context.requestTreeshakingPass(); } } @@ -283,7 +296,7 @@ export default class Identifier extends NodeBase implements PatternNode { } private isPureFunction(path: ObjectPath) { - let currentPureFunction = this.context.manualPureFunctions[this.name]; + let currentPureFunction = this.scope.context.manualPureFunctions[this.name]; for (const segment of path) { if (currentPureFunction) { if (currentPureFunction[PureFunctionKey]) { diff --git a/src/ast/nodes/IfStatement.ts b/src/ast/nodes/IfStatement.ts index 47c43aa19..845cc4130 100644 --- a/src/ast/nodes/IfStatement.ts +++ b/src/ast/nodes/IfStatement.ts @@ -67,15 +67,15 @@ export default class IfStatement extends StatementBase implements DeoptimizableE } parseNode(esTreeNode: GenericEsTreeNode): void { - this.consequentScope = new TrackingScope(this.scope); - this.consequent = new (this.context.getNodeConstructor(esTreeNode.consequent.type))( + this.consequentScope = new TrackingScope(this.scope, this.scope.context); + this.consequent = new (this.scope.context.getNodeConstructor(esTreeNode.consequent.type))( esTreeNode.consequent, this, this.consequentScope ); if (esTreeNode.alternate) { - this.alternateScope = new TrackingScope(this.scope); - this.alternate = new (this.context.getNodeConstructor(esTreeNode.alternate.type))( + this.alternateScope = new TrackingScope(this.scope, this.scope.context); + this.alternate = new (this.scope.context.getNodeConstructor(esTreeNode.alternate.type))( esTreeNode.alternate, this, this.alternateScope @@ -92,7 +92,7 @@ export default class IfStatement extends StatementBase implements DeoptimizableE const testValue = this.getTestValue(); const hoistedDeclarations: Identifier[] = []; const includesIfElse = this.test.included; - const noTreeshake = !this.context.options.treeshake; + const noTreeshake = !this.scope.context.options.treeshake; if (includesIfElse) { this.test.render(code, options); } else { diff --git a/src/ast/nodes/ImportDeclaration.ts b/src/ast/nodes/ImportDeclaration.ts index 41fc90fc5..28e9b89bd 100644 --- a/src/ast/nodes/ImportDeclaration.ts +++ b/src/ast/nodes/ImportDeclaration.ts @@ -23,7 +23,7 @@ export default class ImportDeclaration extends NodeBase { } initialise(): void { - this.context.addImport(this); + this.scope.context.addImport(this); } render(code: MagicString, _options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void { diff --git a/src/ast/nodes/ImportExpression.ts b/src/ast/nodes/ImportExpression.ts index 783092e02..8ce6a9693 100644 --- a/src/ast/nodes/ImportExpression.ts +++ b/src/ast/nodes/ImportExpression.ts @@ -153,14 +153,14 @@ export default class ImportExpression extends NodeBase { include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { if (!this.included) { this.included = true; - this.context.includeDynamicImport(this); + this.scope.context.includeDynamicImport(this); this.scope.addAccessedDynamicImport(this); } this.source.include(context, includeChildrenRecursively); } initialise(): void { - this.context.addDynamicImport(this); + this.scope.context.addDynamicImport(this); } parseNode(esTreeNode: GenericEsTreeNode): void { @@ -278,7 +278,7 @@ export default class ImportExpression extends NodeBase { { customResolution: typeof this.resolution === 'string' ? this.resolution : null, format, - moduleId: this.context.module.id, + moduleId: this.scope.context.module.id, targetModuleId: this.resolution && typeof this.resolution !== 'string' ? this.resolution.id : null } diff --git a/src/ast/nodes/Literal.ts b/src/ast/nodes/Literal.ts index bc2b41ed1..9a66c7ac4 100644 --- a/src/ast/nodes/Literal.ts +++ b/src/ast/nodes/Literal.ts @@ -40,10 +40,10 @@ export default class Literal extends Node if ( path.length > 0 || // unknown literals can also be null but do not start with an "n" - (this.value === null && this.context.code.charCodeAt(this.start) !== 110) || + (this.value === null && this.scope.context.code.charCodeAt(this.start) !== 110) || typeof this.value === 'bigint' || // to support shims for regular expressions - this.context.code.charCodeAt(this.start) === 47 + this.scope.context.code.charCodeAt(this.start) === 47 ) { return UnknownValue; } diff --git a/src/ast/nodes/LogicalExpression.ts b/src/ast/nodes/LogicalExpression.ts index 25c5fa7ea..55de14861 100644 --- a/src/ast/nodes/LogicalExpression.ts +++ b/src/ast/nodes/LogicalExpression.ts @@ -18,6 +18,7 @@ import { UNKNOWN_PATH } from '../utils/PathTracker'; import type * as NodeType from './NodeType'; +import { Flag, isFlagSet, setFlag } from './shared/BitFlags'; import { type ExpressionEntity, type LiteralValueOrUnknown, @@ -34,9 +35,16 @@ export default class LogicalExpression extends NodeBase implements Deoptimizable declare right: ExpressionNode; declare type: NodeType.tLogicalExpression; + //private isBranchResolutionAnalysed = false; + private get isBranchResolutionAnalysed(): boolean { + return isFlagSet(this.flags, Flag.isBranchResolutionAnalysed); + } + private set isBranchResolutionAnalysed(value: boolean) { + this.flags = setFlag(this.flags, Flag.isBranchResolutionAnalysed, value); + } + // We collect deoptimization information if usedBranch !== null private expressionsToBeDeoptimized: DeoptimizableEntity[] = []; - private isBranchResolutionAnalysed = false; private usedBranch: ExpressionNode | null = null; deoptimizeArgumentsOnInteractionAtPath( @@ -53,7 +61,10 @@ export default class LogicalExpression extends NodeBase implements Deoptimizable const unusedBranch = this.usedBranch === this.left ? this.right : this.left; this.usedBranch = null; unusedBranch.deoptimizePath(UNKNOWN_PATH); - const { context, expressionsToBeDeoptimized } = this; + const { + scope: { context }, + expressionsToBeDeoptimized + } = this; this.expressionsToBeDeoptimized = EMPTY_ARRAY as unknown as DeoptimizableEntity[]; for (const expression of expressionsToBeDeoptimized) { expression.deoptimizeCache(); diff --git a/src/ast/nodes/MemberExpression.ts b/src/ast/nodes/MemberExpression.ts index ffb2dd487..045a0e921 100644 --- a/src/ast/nodes/MemberExpression.ts +++ b/src/ast/nodes/MemberExpression.ts @@ -35,6 +35,7 @@ import type * as NodeType from './NodeType'; import type PrivateIdentifier from './PrivateIdentifier'; import type SpreadElement from './SpreadElement'; import type Super from './Super'; +import { Flag, isFlagSet, setFlag } from './shared/BitFlags'; import { deoptimizeInteraction, type ExpressionEntity, @@ -95,19 +96,49 @@ export default class MemberExpression extends NodeBase implements DeoptimizableEntity, ChainElement { - declare computed: boolean; declare object: ExpressionNode | Super; - declare optional: boolean; declare property: ExpressionNode | PrivateIdentifier; declare propertyKey: ObjectPathKey | null; declare type: NodeType.tMemberExpression; variable: Variable | null = null; protected declare assignmentInteraction: NodeInteractionAssigned; private declare accessInteraction: NodeInteractionAccessed; - private assignmentDeoptimized = false; - private bound = false; private expressionsToBeDeoptimized: DeoptimizableEntity[] = []; - private isUndefined = false; + + get computed(): boolean { + return isFlagSet(this.flags, Flag.computed); + } + set computed(value: boolean) { + this.flags = setFlag(this.flags, Flag.computed, value); + } + + get optional(): boolean { + return isFlagSet(this.flags, Flag.optional); + } + set optional(value: boolean) { + this.flags = setFlag(this.flags, Flag.optional, value); + } + + private get assignmentDeoptimized(): boolean { + return isFlagSet(this.flags, Flag.assignmentDeoptimized); + } + private set assignmentDeoptimized(value: boolean) { + this.flags = setFlag(this.flags, Flag.assignmentDeoptimized, value); + } + + private get bound(): boolean { + return isFlagSet(this.flags, Flag.bound); + } + private set bound(value: boolean) { + this.flags = setFlag(this.flags, Flag.bound, value); + } + + private get isUndefined(): boolean { + return isFlagSet(this.flags, Flag.isUndefined); + } + private set isUndefined(value: boolean) { + this.flags = setFlag(this.flags, Flag.isUndefined, value); + } bind(): void { this.bound = true; @@ -117,7 +148,7 @@ export default class MemberExpression const resolvedVariable = resolveNamespaceVariables( baseVariable, path!.slice(1), - this.context + this.scope.context ); if (!resolvedVariable) { super.bind(); @@ -348,7 +379,7 @@ export default class MemberExpression protected applyDeoptimizations(): void { this.deoptimized = true; - const { propertyReadSideEffects } = this.context.options + const { propertyReadSideEffects } = this.scope.context.options .treeshake as NormalizedTreeshakingOptions; if ( // Namespaces are not bound and should not be deoptimized @@ -362,13 +393,13 @@ export default class MemberExpression [propertyKey], SHARED_RECURSION_TRACKER ); - this.context.requestTreeshakingPass(); + this.scope.context.requestTreeshakingPass(); } } private applyAssignmentDeoptimization(): void { this.assignmentDeoptimized = true; - const { propertyReadSideEffects } = this.context.options + const { propertyReadSideEffects } = this.scope.context.options .treeshake as NormalizedTreeshakingOptions; if ( // Namespaces are not bound and should not be deoptimized @@ -381,7 +412,7 @@ export default class MemberExpression [this.getPropertyKey()], SHARED_RECURSION_TRACKER ); - this.context.requestTreeshakingPass(); + this.scope.context.requestTreeshakingPass(); } } @@ -390,11 +421,11 @@ export default class MemberExpression const variable = this.scope.findVariable(this.object.name); if (variable.isNamespace) { if (this.variable) { - this.context.includeVariableInModule(this.variable); + this.scope.context.includeVariableInModule(this.variable); } - this.context.log( + this.scope.context.log( LOGLEVEL_WARN, - logIllegalImportReassignment(this.object.name, this.context.module.id), + logIllegalImportReassignment(this.object.name, this.scope.context.module.id), this.start ); } @@ -416,7 +447,7 @@ export default class MemberExpression } private hasAccessEffect(context: HasEffectsContext) { - const { propertyReadSideEffects } = this.context.options + const { propertyReadSideEffects } = this.scope.context.options .treeshake as NormalizedTreeshakingOptions; return ( !(this.variable || this.isUndefined) && @@ -437,7 +468,7 @@ export default class MemberExpression if (!this.included) { this.included = true; if (this.variable) { - this.context.includeVariableInModule(this.variable); + this.scope.context.includeVariableInModule(this.variable); } } this.object.include(context, includeChildrenRecursively); diff --git a/src/ast/nodes/MetaProperty.ts b/src/ast/nodes/MetaProperty.ts index e58de55d6..8d7476433 100644 --- a/src/ast/nodes/MetaProperty.ts +++ b/src/ast/nodes/MetaProperty.ts @@ -50,7 +50,7 @@ export default class MetaProperty extends NodeBase { if (!this.included) { this.included = true; if (this.meta.name === IMPORT) { - this.context.addImportMeta(this); + this.scope.context.addImportMeta(this); const parent = this.parent; const metaProperty = (this.metaProperty = parent instanceof MemberExpression && typeof parent.propertyKey === 'string' @@ -66,7 +66,9 @@ export default class MetaProperty extends NodeBase { render(code: MagicString, renderOptions: RenderOptions): void { const { format, pluginDriver, snippets } = renderOptions; const { - context: { module }, + scope: { + context: { module } + }, meta: { name }, metaProperty, parent, diff --git a/src/ast/nodes/NewExpression.ts b/src/ast/nodes/NewExpression.ts index 6c91ba90a..98e847d6f 100644 --- a/src/ast/nodes/NewExpression.ts +++ b/src/ast/nodes/NewExpression.ts @@ -67,6 +67,6 @@ export default class NewExpression extends NodeBase { EMPTY_PATH, SHARED_RECURSION_TRACKER ); - this.context.requestTreeshakingPass(); + this.scope.context.requestTreeshakingPass(); } } diff --git a/src/ast/nodes/Program.ts b/src/ast/nodes/Program.ts index a2a256c70..e170353be 100644 --- a/src/ast/nodes/Program.ts +++ b/src/ast/nodes/Program.ts @@ -32,9 +32,9 @@ export default class Program extends NodeBase { hasEffects(context: HasEffectsContext): boolean { for (const node of this.body) { if (node.hasEffects(context)) { - if (this.context.options.experimentalLogSideEffects && !this.hasLoggedEffect) { + if (this.scope.context.options.experimentalLogSideEffects && !this.hasLoggedEffect) { this.hasLoggedEffect = true; - const { code, log, module } = this.context; + const { code, log, module } = this.scope.context; log( LOGLEVEL_INFO, logFirstSideEffect(code, module.id, locate(code, node.start, { offsetLine: 1 })!), diff --git a/src/ast/nodes/Property.ts b/src/ast/nodes/Property.ts index e8d5b7d60..bc7f42706 100644 --- a/src/ast/nodes/Property.ts +++ b/src/ast/nodes/Property.ts @@ -5,6 +5,7 @@ import type { HasEffectsContext } from '../ExecutionContext'; import { UnknownKey } from '../utils/PathTracker'; import type LocalVariable from '../variables/LocalVariable'; import type * as NodeType from './NodeType'; +import { Flag, isFlagSet, setFlag } from './shared/BitFlags'; import { type ExpressionEntity, UNKNOWN_EXPRESSION } from './shared/Expression'; import MethodBase from './shared/MethodBase'; import type { ExpressionNode } from './shared/Node'; @@ -13,11 +14,25 @@ import type { PatternNode } from './shared/Pattern'; export default class Property extends MethodBase implements PatternNode { declare key: ExpressionNode; declare kind: 'init' | 'get' | 'set'; - declare method: boolean; - declare shorthand: boolean; declare type: NodeType.tProperty; private declarationInit: ExpressionEntity | null = null; + //declare method: boolean; + get method(): boolean { + return isFlagSet(this.flags, Flag.method); + } + set method(value: boolean) { + this.flags = setFlag(this.flags, Flag.method, value); + } + + //declare shorthand: boolean; + get shorthand(): boolean { + return isFlagSet(this.flags, Flag.shorthand); + } + set shorthand(value: boolean) { + this.flags = setFlag(this.flags, Flag.shorthand, value); + } + declare(kind: string, init: ExpressionEntity): LocalVariable[] { this.declarationInit = init; return (this.value as PatternNode).declare(kind, UNKNOWN_EXPRESSION); @@ -25,8 +40,9 @@ export default class Property extends MethodBase implements PatternNode { hasEffects(context: HasEffectsContext): boolean { if (!this.deoptimized) this.applyDeoptimizations(); - const propertyReadSideEffects = (this.context.options.treeshake as NormalizedTreeshakingOptions) - .propertyReadSideEffects; + const propertyReadSideEffects = ( + this.scope.context.options.treeshake as NormalizedTreeshakingOptions + ).propertyReadSideEffects; return ( (this.parent.type === 'ObjectPattern' && propertyReadSideEffects === 'always') || this.key.hasEffects(context) || @@ -49,7 +65,7 @@ export default class Property extends MethodBase implements PatternNode { this.deoptimized = true; if (this.declarationInit !== null) { this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]); - this.context.requestTreeshakingPass(); + this.scope.context.requestTreeshakingPass(); } } } diff --git a/src/ast/nodes/PropertyDefinition.ts b/src/ast/nodes/PropertyDefinition.ts index e70688436..6f15cc7c1 100644 --- a/src/ast/nodes/PropertyDefinition.ts +++ b/src/ast/nodes/PropertyDefinition.ts @@ -4,6 +4,7 @@ import type { NodeInteraction, NodeInteractionCalled } from '../NodeInteractions import type { ObjectPath, PathTracker } from '../utils/PathTracker'; import type * as NodeType from './NodeType'; import type PrivateIdentifier from './PrivateIdentifier'; +import { Flag, isFlagSet, setFlag } from './shared/BitFlags'; import { type ExpressionEntity, type LiteralValueOrUnknown, @@ -13,12 +14,18 @@ import { import { type ExpressionNode, NodeBase } from './shared/Node'; export default class PropertyDefinition extends NodeBase { - declare computed: boolean; declare key: ExpressionNode | PrivateIdentifier; declare static: boolean; declare type: NodeType.tPropertyDefinition; declare value: ExpressionNode | null; + get computed(): boolean { + return isFlagSet(this.flags, Flag.computed); + } + set computed(value: boolean) { + this.flags = setFlag(this.flags, Flag.computed, value); + } + deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, diff --git a/src/ast/nodes/RestElement.ts b/src/ast/nodes/RestElement.ts index 5493078db..17ac00da8 100644 --- a/src/ast/nodes/RestElement.ts +++ b/src/ast/nodes/RestElement.ts @@ -48,7 +48,7 @@ export default class RestElement extends NodeBase implements PatternNode { this.deoptimized = true; if (this.declarationInit !== null) { this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]); - this.context.requestTreeshakingPass(); + this.scope.context.requestTreeshakingPass(); } } } diff --git a/src/ast/nodes/SpreadElement.ts b/src/ast/nodes/SpreadElement.ts index 88c3920ec..483781572 100644 --- a/src/ast/nodes/SpreadElement.ts +++ b/src/ast/nodes/SpreadElement.ts @@ -26,7 +26,7 @@ export default class SpreadElement extends NodeBase { hasEffects(context: HasEffectsContext): boolean { if (!this.deoptimized) this.applyDeoptimizations(); - const { propertyReadSideEffects } = this.context.options + const { propertyReadSideEffects } = this.scope.context.options .treeshake as NormalizedTreeshakingOptions; return ( this.argument.hasEffects(context) || @@ -45,6 +45,6 @@ export default class SpreadElement extends NodeBase { // Only properties of properties of the argument could become subject to reassignment // This will also reassign the return values of iterators this.argument.deoptimizePath([UnknownKey, UnknownKey]); - this.context.requestTreeshakingPass(); + this.scope.context.requestTreeshakingPass(); } } diff --git a/src/ast/nodes/StaticBlock.ts b/src/ast/nodes/StaticBlock.ts index 563cda267..934009157 100644 --- a/src/ast/nodes/StaticBlock.ts +++ b/src/ast/nodes/StaticBlock.ts @@ -6,7 +6,7 @@ import { } from '../../utils/renderHelpers'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import BlockScope from '../scopes/BlockScope'; -import type Scope from '../scopes/Scope'; +import type ChildScope from '../scopes/ChildScope'; import type * as NodeType from './NodeType'; import { type IncludeChildren, StatementBase, type StatementNode } from './shared/Node'; @@ -14,8 +14,8 @@ export default class StaticBlock extends StatementBase { declare body: readonly StatementNode[]; declare type: NodeType.tStaticBlock; - createScope(parentScope: Scope): void { - this.scope = new BlockScope(parentScope); + createScope(parentScope: ChildScope): void { + this.scope = new BlockScope(parentScope, this.scope.context); } hasEffects(context: HasEffectsContext): boolean { diff --git a/src/ast/nodes/Super.ts b/src/ast/nodes/Super.ts index afbed0234..5db71aed4 100644 --- a/src/ast/nodes/Super.ts +++ b/src/ast/nodes/Super.ts @@ -27,7 +27,7 @@ export default class Super extends NodeBase { include(): void { if (!this.included) { this.included = true; - this.context.includeVariableInModule(this.variable); + this.scope.context.includeVariableInModule(this.variable); } } } diff --git a/src/ast/nodes/SwitchStatement.ts b/src/ast/nodes/SwitchStatement.ts index 9dfb0154a..6646ba52d 100644 --- a/src/ast/nodes/SwitchStatement.ts +++ b/src/ast/nodes/SwitchStatement.ts @@ -7,7 +7,6 @@ import { } from '../ExecutionContext'; import BlockScope from '../scopes/BlockScope'; import type ChildScope from '../scopes/ChildScope'; -import type Scope from '../scopes/Scope'; import type * as NodeType from './NodeType'; import type SwitchCase from './SwitchCase'; import type { ExpressionNode, GenericEsTreeNode, IncludeChildren } from './shared/Node'; @@ -21,9 +20,9 @@ export default class SwitchStatement extends StatementBase { private declare defaultCase: number | null; private declare parentScope: ChildScope; - createScope(parentScope: Scope): void { - this.parentScope = parentScope as ChildScope; - this.scope = new BlockScope(parentScope); + createScope(parentScope: ChildScope): void { + this.parentScope = parentScope; + this.scope = new BlockScope(parentScope, this.scope.context); } hasEffects(context: HasEffectsContext): boolean { @@ -94,7 +93,7 @@ export default class SwitchStatement extends StatementBase { } parseNode(esTreeNode: GenericEsTreeNode) { - this.discriminant = new (this.context.getNodeConstructor(esTreeNode.discriminant.type))( + this.discriminant = new (this.scope.context.getNodeConstructor(esTreeNode.discriminant.type))( esTreeNode.discriminant, this, this.parentScope diff --git a/src/ast/nodes/TaggedTemplateExpression.ts b/src/ast/nodes/TaggedTemplateExpression.ts index c47bc8cd7..0af7367a9 100644 --- a/src/ast/nodes/TaggedTemplateExpression.ts +++ b/src/ast/nodes/TaggedTemplateExpression.ts @@ -28,7 +28,7 @@ export default class TaggedTemplateExpression extends CallExpressionBase { const variable = this.scope.findVariable(name); if (variable.isNamespace) { - this.context.log(LOGLEVEL_WARN, logCannotCallNamespace(name), this.start); + this.scope.context.log(LOGLEVEL_WARN, logCannotCallNamespace(name), this.start); } } } @@ -87,7 +87,7 @@ export default class TaggedTemplateExpression extends CallExpressionBase { EMPTY_PATH, SHARED_RECURSION_TRACKER ); - this.context.requestTreeshakingPass(); + this.scope.context.requestTreeshakingPass(); } protected getReturnExpression( diff --git a/src/ast/nodes/TemplateElement.ts b/src/ast/nodes/TemplateElement.ts index 96dcd267a..0e45ccf53 100644 --- a/src/ast/nodes/TemplateElement.ts +++ b/src/ast/nodes/TemplateElement.ts @@ -1,14 +1,21 @@ import type * as NodeType from './NodeType'; +import { Flag, isFlagSet, setFlag } from './shared/BitFlags'; import { type GenericEsTreeNode, NodeBase } from './shared/Node'; export default class TemplateElement extends NodeBase { - declare tail: boolean; declare type: NodeType.tTemplateElement; declare value: { cooked: string | null; raw: string; }; + get tail(): boolean { + return isFlagSet(this.flags, Flag.tail); + } + set tail(value: boolean) { + this.flags = setFlag(this.flags, Flag.tail, value); + } + // Do not try to bind value bind(): void {} diff --git a/src/ast/nodes/ThisExpression.ts b/src/ast/nodes/ThisExpression.ts index 490835e58..9841fde28 100644 --- a/src/ast/nodes/ThisExpression.ts +++ b/src/ast/nodes/ThisExpression.ts @@ -45,15 +45,17 @@ export default class ThisExpression extends NodeBase { include(): void { if (!this.included) { this.included = true; - this.context.includeVariableInModule(this.variable); + this.scope.context.includeVariableInModule(this.variable); } } initialise(): void { this.alias = - this.scope.findLexicalBoundary() instanceof ModuleScope ? this.context.moduleContext : null; + this.scope.findLexicalBoundary() instanceof ModuleScope + ? this.scope.context.moduleContext + : null; if (this.alias === 'undefined') { - this.context.log(LOGLEVEL_WARN, logThisIsUndefined(), this.start); + this.scope.context.log(LOGLEVEL_WARN, logThisIsUndefined(), this.start); } } diff --git a/src/ast/nodes/TryStatement.ts b/src/ast/nodes/TryStatement.ts index 8147d47b6..851d2cdd0 100644 --- a/src/ast/nodes/TryStatement.ts +++ b/src/ast/nodes/TryStatement.ts @@ -16,15 +16,16 @@ export default class TryStatement extends StatementBase { hasEffects(context: HasEffectsContext): boolean { return ( - ((this.context.options.treeshake as NormalizedTreeshakingOptions).tryCatchDeoptimization + ((this.scope.context.options.treeshake as NormalizedTreeshakingOptions).tryCatchDeoptimization ? this.block.body.length > 0 : this.block.hasEffects(context)) || !!this.finalizer?.hasEffects(context) ); } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { - const tryCatchDeoptimization = (this.context.options.treeshake as NormalizedTreeshakingOptions) - ?.tryCatchDeoptimization; + const tryCatchDeoptimization = ( + this.scope.context.options.treeshake as NormalizedTreeshakingOptions + )?.tryCatchDeoptimization; const { brokenFlow, includedLabels } = context; if (!this.directlyIncluded || !tryCatchDeoptimization) { this.included = true; diff --git a/src/ast/nodes/UnaryExpression.ts b/src/ast/nodes/UnaryExpression.ts index 18443dd12..980b29cc2 100644 --- a/src/ast/nodes/UnaryExpression.ts +++ b/src/ast/nodes/UnaryExpression.ts @@ -6,6 +6,7 @@ import { EMPTY_PATH, type ObjectPath, type PathTracker } from '../utils/PathTrac import Identifier from './Identifier'; import type { LiteralValue } from './Literal'; import type * as NodeType from './NodeType'; +import { Flag, isFlagSet, setFlag } from './shared/BitFlags'; import { type LiteralValueOrUnknown, UnknownValue } from './shared/Expression'; import { type ExpressionNode, NodeBase } from './shared/Node'; @@ -24,9 +25,15 @@ const unaryOperators: { export default class UnaryExpression extends NodeBase { declare argument: ExpressionNode; declare operator: '!' | '+' | '-' | 'delete' | 'typeof' | 'void' | '~'; - declare prefix: boolean; declare type: NodeType.tUnaryExpression; + get prefix(): boolean { + return isFlagSet(this.flags, Flag.prefix); + } + set prefix(value: boolean) { + this.flags = setFlag(this.flags, Flag.prefix, value); + } + getLiteralValueAtPath( path: ObjectPath, recursionTracker: PathTracker, @@ -61,7 +68,7 @@ export default class UnaryExpression extends NodeBase { this.deoptimized = true; if (this.operator === 'delete') { this.argument.deoptimizePath(EMPTY_PATH); - this.context.requestTreeshakingPass(); + this.scope.context.requestTreeshakingPass(); } } } diff --git a/src/ast/nodes/UpdateExpression.ts b/src/ast/nodes/UpdateExpression.ts index 3015dd14d..21d034a6a 100644 --- a/src/ast/nodes/UpdateExpression.ts +++ b/src/ast/nodes/UpdateExpression.ts @@ -88,6 +88,6 @@ export default class UpdateExpression extends NodeBase { const variable = this.scope.findVariable(this.argument.name); variable.isReassigned = true; } - this.context.requestTreeshakingPass(); + this.scope.context.requestTreeshakingPass(); } } diff --git a/src/ast/nodes/shared/BitFlags.ts b/src/ast/nodes/shared/BitFlags.ts new file mode 100644 index 000000000..f32934306 --- /dev/null +++ b/src/ast/nodes/shared/BitFlags.ts @@ -0,0 +1,32 @@ +export const enum Flag { + included = 1 << 0, + deoptimized = 1 << 1, + tdzAccessDefined = 1 << 2, + tdzAccess = 1 << 3, + assignmentDeoptimized = 1 << 4, + bound = 1 << 5, + isUndefined = 1 << 6, + optional = 1 << 7, + async = 1 << 8, + deoptimizedReturn = 1 << 9, + computed = 1 << 10, + hasLostTrack = 1 << 11, + hasUnknownDeoptimizedInteger = 1 << 12, + hasUnknownDeoptimizedProperty = 1 << 13, + directlyIncluded = 1 << 14, + deoptimizeBody = 1 << 15, + isBranchResolutionAnalysed = 1 << 16, + await = 1 << 17, + method = 1 << 18, + shorthand = 1 << 19, + tail = 1 << 20, + prefix = 1 << 21 +} + +export function isFlagSet(flags: number, flag: Flag): boolean { + return (flags & flag) !== 0; +} + +export function setFlag(flags: number, flag: Flag, value: boolean): number { + return (flags & ~flag) | (-value & flag); +} diff --git a/src/ast/nodes/shared/CallExpressionBase.ts b/src/ast/nodes/shared/CallExpressionBase.ts index be04e2900..04c045b5d 100644 --- a/src/ast/nodes/shared/CallExpressionBase.ts +++ b/src/ast/nodes/shared/CallExpressionBase.ts @@ -72,7 +72,7 @@ export default abstract class CallExpressionBase extends NodeBase implements Deo deoptimizePath(path: ObjectPath): void { if ( path.length === 0 || - this.context.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(path, this) + this.scope.context.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(path, this) ) { return; } diff --git a/src/ast/nodes/shared/ClassNode.ts b/src/ast/nodes/shared/ClassNode.ts index b6c99e298..c9e6c9c03 100644 --- a/src/ast/nodes/shared/ClassNode.ts +++ b/src/ast/nodes/shared/ClassNode.ts @@ -3,7 +3,6 @@ import type { HasEffectsContext, InclusionContext } from '../../ExecutionContext import type { NodeInteraction, NodeInteractionCalled } from '../../NodeInteractions'; import { INTERACTION_CALLED } from '../../NodeInteractions'; import ChildScope from '../../scopes/ChildScope'; -import type Scope from '../../scopes/Scope'; import { EMPTY_PATH, type ObjectPath, @@ -29,8 +28,8 @@ export default class ClassNode extends NodeBase implements DeoptimizableEntity { private declare classConstructor: MethodDefinition | null; private objectEntity: ObjectEntity | null = null; - createScope(parentScope: Scope): void { - this.scope = new ChildScope(parentScope); + createScope(parentScope: ChildScope): void { + this.scope = new ChildScope(parentScope, this.scope.context); } deoptimizeArgumentsOnInteractionAtPath( @@ -131,7 +130,7 @@ export default class ClassNode extends NodeBase implements DeoptimizableEntity { definition.deoptimizePath(UNKNOWN_PATH); } } - this.context.requestTreeshakingPass(); + this.scope.context.requestTreeshakingPass(); } private getObjectEntity(): ObjectEntity { diff --git a/src/ast/nodes/shared/Expression.ts b/src/ast/nodes/shared/Expression.ts index 6728ca26e..b1cf9ca68 100644 --- a/src/ast/nodes/shared/Expression.ts +++ b/src/ast/nodes/shared/Expression.ts @@ -6,6 +6,7 @@ import type { ObjectPath, PathTracker, SymbolToStringTag } from '../../utils/Pat import { UNKNOWN_PATH } from '../../utils/PathTracker'; import type { LiteralValue } from '../Literal'; import type SpreadElement from '../SpreadElement'; +import { Flag, isFlagSet, setFlag } from './BitFlags'; import type { IncludeChildren } from './Node'; export const UnknownValue = Symbol('Unknown Value'); @@ -26,7 +27,14 @@ export interface InclusionOptions { } export class ExpressionEntity implements WritableEntity { - included = false; + protected flags: number = 0; + + get included(): boolean { + return isFlagSet(this.flags, Flag.included); + } + set included(value: boolean) { + this.flags = setFlag(this.flags, Flag.included, value); + } deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, diff --git a/src/ast/nodes/shared/FunctionBase.ts b/src/ast/nodes/shared/FunctionBase.ts index ec028d073..7b6124c84 100644 --- a/src/ast/nodes/shared/FunctionBase.ts +++ b/src/ast/nodes/shared/FunctionBase.ts @@ -16,6 +16,7 @@ import Identifier from '../Identifier'; import * as NodeType from '../NodeType'; import RestElement from '../RestElement'; import type SpreadElement from '../SpreadElement'; +import { Flag, isFlagSet, setFlag } from './BitFlags'; import type { ExpressionEntity, LiteralValueOrUnknown } from './Expression'; import { UNKNOWN_EXPRESSION, UNKNOWN_RETURN_EXPRESSION } from './Expression'; import { @@ -28,13 +29,26 @@ import type { ObjectEntity } from './ObjectEntity'; import type { PatternNode } from './Pattern'; export default abstract class FunctionBase extends NodeBase { - declare async: boolean; declare body: BlockStatement | ExpressionNode; declare params: readonly PatternNode[]; declare preventChildBlockScope: true; declare scope: ReturnValueScope; + + get async(): boolean { + return isFlagSet(this.flags, Flag.async); + } + set async(value: boolean) { + this.flags = setFlag(this.flags, Flag.async, value); + } + + get deoptimizedReturn(): boolean { + return isFlagSet(this.flags, Flag.deoptimizedReturn); + } + set deoptimizedReturn(value: boolean) { + this.flags = setFlag(this.flags, Flag.deoptimizedReturn, value); + } + protected objectEntity: ObjectEntity | null = null; - private deoptimizedReturn = false; deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, @@ -110,7 +124,7 @@ export default abstract class FunctionBase extends NodeBase { if (!this.deoptimizedReturn) { this.deoptimizedReturn = true; this.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH); - this.context.requestTreeshakingPass(); + this.scope.context.requestTreeshakingPass(); } return UNKNOWN_RETURN_EXPRESSION; } @@ -131,7 +145,7 @@ export default abstract class FunctionBase extends NodeBase { } if (this.async) { - const { propertyReadSideEffects } = this.context.options + const { propertyReadSideEffects } = this.scope.context.options .treeshake as NormalizedTreeshakingOptions; const returnExpression = this.scope.getReturnExpression(); if ( diff --git a/src/ast/nodes/shared/FunctionNode.ts b/src/ast/nodes/shared/FunctionNode.ts index 2d4564070..c328bd8ee 100644 --- a/src/ast/nodes/shared/FunctionNode.ts +++ b/src/ast/nodes/shared/FunctionNode.ts @@ -14,7 +14,6 @@ import { OBJECT_PROTOTYPE } from './ObjectPrototype'; import type { PatternNode } from './Pattern'; export default class FunctionNode extends FunctionBase { - declare async: boolean; declare body: BlockStatement; declare id: IdentifierWithVariable | null; declare params: readonly PatternNode[]; @@ -24,7 +23,7 @@ export default class FunctionNode extends FunctionBase { private declare constructedEntity: ObjectEntity; createScope(parentScope: FunctionScope): void { - this.scope = new FunctionScope(parentScope, this.context); + this.scope = new FunctionScope(parentScope, this.scope.context); this.constructedEntity = new ObjectEntity(Object.create(null), OBJECT_PROTOTYPE); // This makes sure that all deoptimizations of "this" are applied to the // constructed entity. diff --git a/src/ast/nodes/shared/MethodBase.ts b/src/ast/nodes/shared/MethodBase.ts index 1cb887c9d..b893dbc61 100644 --- a/src/ast/nodes/shared/MethodBase.ts +++ b/src/ast/nodes/shared/MethodBase.ts @@ -14,6 +14,7 @@ import { SHARED_RECURSION_TRACKER } from '../../utils/PathTracker'; import type PrivateIdentifier from '../PrivateIdentifier'; +import { Flag, isFlagSet, setFlag } from './BitFlags'; import { type ExpressionEntity, type LiteralValueOrUnknown, @@ -23,11 +24,17 @@ import { type ExpressionNode, NodeBase } from './Node'; import type { PatternNode } from './Pattern'; export default class MethodBase extends NodeBase implements DeoptimizableEntity { - declare computed: boolean; declare key: ExpressionNode | PrivateIdentifier; declare kind: 'constructor' | 'method' | 'init' | 'get' | 'set'; declare value: ExpressionNode | (ExpressionNode & PatternNode); + get computed(): boolean { + return isFlagSet(this.flags, Flag.computed); + } + set computed(value: boolean) { + this.flags = setFlag(this.flags, Flag.computed, value); + } + private accessedValue: [expression: ExpressionEntity, isPure: boolean] | null = null; deoptimizeArgumentsOnInteractionAtPath( diff --git a/src/ast/nodes/shared/MultiExpression.ts b/src/ast/nodes/shared/MultiExpression.ts index e5442452f..5981af20b 100644 --- a/src/ast/nodes/shared/MultiExpression.ts +++ b/src/ast/nodes/shared/MultiExpression.ts @@ -5,8 +5,6 @@ import type { ObjectPath, PathTracker } from '../../utils/PathTracker'; import { ExpressionEntity } from './Expression'; export class MultiExpression extends ExpressionEntity { - included = false; - constructor(private expressions: readonly ExpressionEntity[]) { super(); } diff --git a/src/ast/nodes/shared/Node.ts b/src/ast/nodes/shared/Node.ts index 4b3b58315..a9bbecd9b 100644 --- a/src/ast/nodes/shared/Node.ts +++ b/src/ast/nodes/shared/Node.ts @@ -16,11 +16,12 @@ import { } from '../../ExecutionContext'; import type { NodeInteractionAssigned } from '../../NodeInteractions'; import { INTERACTION_ASSIGNED } from '../../NodeInteractions'; -import { getAndCreateKeys, keys } from '../../keys'; +import { createKeysForNode, keys } from '../../keys'; import type ChildScope from '../../scopes/ChildScope'; import { EMPTY_PATH, UNKNOWN_PATH } from '../../utils/PathTracker'; import type Variable from '../../variables/Variable'; import type * as NodeType from '../NodeType'; +import { Flag, isFlagSet, setFlag } from './BitFlags'; import type { InclusionOptions } from './Expression'; import { ExpressionEntity } from './Expression'; @@ -33,13 +34,12 @@ export type IncludeChildren = boolean | typeof INCLUDE_PARAMETERS; export interface Node extends Entity { annotations?: RollupAnnotation[]; - context: AstContext; end: number; - esTreeNode: GenericEsTreeNode | null; + esTreeNode?: GenericEsTreeNode; included: boolean; - keys: string[]; needsBoundaries?: boolean; parent: Node | { type?: string }; + scope: ChildScope; preventChildBlockScope?: boolean; start: number; type: string; @@ -135,10 +135,8 @@ export class NodeBase extends ExpressionEntity implements ExpressionNode { declare annotationPure?: boolean; declare annotations?: RollupAnnotation[]; - context: AstContext; declare end: number; - esTreeNode: AstNode | null; - keys: string[]; + esTreeNode?: AstNode; parent: Node | { context: AstContext; type: string }; declare scope: ChildScope; declare start: number; @@ -147,13 +145,19 @@ export class NodeBase extends ExpressionEntity implements ExpressionNode { * This will be populated during initialise if setAssignedValue is called. */ protected declare assignmentInteraction: NodeInteractionAssigned; + /** * Nodes can apply custom deoptimizations once they become part of the * executed code. To do this, they must initialize this as false, implement * applyDeoptimizations and call this from include and hasEffects if they have * custom handlers */ - protected deoptimized = false; + protected get deoptimized(): boolean { + return isFlagSet(this.flags, Flag.deoptimized); + } + protected set deoptimized(value: boolean) { + this.flags = setFlag(this.flags, Flag.deoptimized, value); + } constructor( esTreeNode: GenericEsTreeNode, @@ -164,15 +168,21 @@ export class NodeBase extends ExpressionEntity implements ExpressionNode { super(); // Nodes can opt-in to keep the AST if needed during the build pipeline. // Avoid true when possible as large AST takes up memory. - this.esTreeNode = keepEsTreeNode ? esTreeNode : null; - this.keys = keys[esTreeNode.type] || getAndCreateKeys(esTreeNode); + + if (keepEsTreeNode) { + this.esTreeNode = esTreeNode; + } + + const { type } = esTreeNode; + keys[type] ||= createKeysForNode(esTreeNode); + this.parent = parent; - this.context = parent.context; + this.scope = parentScope; this.createScope(parentScope); this.parseNode(esTreeNode); this.initialise(); - this.context.magicString.addSourcemapLocation(this.start); - this.context.magicString.addSourcemapLocation(this.end); + this.scope.context.magicString.addSourcemapLocation(this.start); + this.scope.context.magicString.addSourcemapLocation(this.end); } addExportedVariables( @@ -185,7 +195,7 @@ export class NodeBase extends ExpressionEntity implements ExpressionNode { * that require the scopes to be populated with variables. */ bind(): void { - for (const key of this.keys) { + for (const key of keys[this.type]) { const value = (this as GenericEsTreeNode)[key]; if (Array.isArray(value)) { for (const child of value) { @@ -207,7 +217,7 @@ export class NodeBase extends ExpressionEntity implements ExpressionNode { hasEffects(context: HasEffectsContext): boolean { if (!this.deoptimized) this.applyDeoptimizations(); - for (const key of this.keys) { + for (const key of keys[this.type]) { const value = (this as GenericEsTreeNode)[key]; if (value === null) continue; if (Array.isArray(value)) { @@ -233,7 +243,7 @@ export class NodeBase extends ExpressionEntity implements ExpressionNode { ): void { if (!this.deoptimized) this.applyDeoptimizations(); this.included = true; - for (const key of this.keys) { + for (const key of keys[this.type]) { const value = (this as GenericEsTreeNode)[key]; if (value === null) continue; if (Array.isArray(value)) { @@ -262,13 +272,17 @@ export class NodeBase extends ExpressionEntity implements ExpressionNode { parseNode(esTreeNode: GenericEsTreeNode, keepEsTreeNodeKeys?: string[]): void { for (const [key, value] of Object.entries(esTreeNode)) { - // That way, we can override this function to add custom initialisation and then call super.parseNode + // Skip properties defined on the class already. + // This way, we can override this function to add custom initialisation and then call super.parseNode + // Note: this doesn't skip properties with defined getters/setters which we use to pack wrap booleans + // in bitfields. Those are still assigned from the value in the esTreeNode. if (this.hasOwnProperty(key)) continue; + if (key.charCodeAt(0) === 95 /* _ */) { if (key === ANNOTATION_KEY) { const annotations = value as RollupAnnotation[]; this.annotations = annotations; - if ((this.context.options.treeshake as NormalizedTreeshakingOptions).annotations) { + if ((this.scope.context.options.treeshake as NormalizedTreeshakingOptions).annotations) { this.annotationNoSideEffects = annotations.some( comment => comment.type === 'noSideEffects' ); @@ -276,13 +290,13 @@ export class NodeBase extends ExpressionEntity implements ExpressionNode { } } else if (key === INVALID_ANNOTATION_KEY) { for (const { start, end, type } of value as RollupAnnotation[]) { - this.context.magicString.remove(start, end); + this.scope.context.magicString.remove(start, end); if (type === 'pure' || type === 'noSideEffects') { - this.context.log( + this.scope.context.log( LOGLEVEL_WARN, logInvalidAnnotation( - this.context.code.slice(start, end), - this.context.module.id, + this.scope.context.code.slice(start, end), + this.scope.context.module.id, type ), start @@ -298,7 +312,7 @@ export class NodeBase extends ExpressionEntity implements ExpressionNode { (this as GenericEsTreeNode)[key].push( child === null ? null - : new (this.context.getNodeConstructor(child.type))( + : new (this.scope.context.getNodeConstructor(child.type))( child, this, this.scope, @@ -307,7 +321,7 @@ export class NodeBase extends ExpressionEntity implements ExpressionNode { ); } } else { - (this as GenericEsTreeNode)[key] = new (this.context.getNodeConstructor(value.type))( + (this as GenericEsTreeNode)[key] = new (this.scope.context.getNodeConstructor(value.type))( value, this, this.scope, @@ -326,7 +340,7 @@ export class NodeBase extends ExpressionEntity implements ExpressionNode { } render(code: MagicString, options: RenderOptions): void { - for (const key of this.keys) { + for (const key of keys[this.type]) { const value = (this as GenericEsTreeNode)[key]; if (value === null) continue; if (Array.isArray(value)) { @@ -354,7 +368,7 @@ export class NodeBase extends ExpressionEntity implements ExpressionNode { */ protected applyDeoptimizations(): void { this.deoptimized = true; - for (const key of this.keys) { + for (const key of keys[this.type]) { const value = (this as GenericEsTreeNode)[key]; if (value === null) continue; if (Array.isArray(value)) { @@ -365,22 +379,28 @@ export class NodeBase extends ExpressionEntity implements ExpressionNode { value.deoptimizePath(UNKNOWN_PATH); } } - this.context.requestTreeshakingPass(); + this.scope.context.requestTreeshakingPass(); } } export { NodeBase as StatementBase }; export function locateNode(node: Node): Location & { file: string } { - const location = locate(node.context.code, node.start, { offsetLine: 1 }) as Location & { + const { + start, + scope: { + context: { code, fileName } + } + } = node; + const location = locate(code, start, { offsetLine: 1 }) as Location & { file: string; }; - location.file = node.context.fileName; + location.file = fileName; location.toString = () => JSON.stringify(location); return location; } export function logNode(node: Node): string { - return node.context.code.slice(node.start, node.end); + return node.scope.context.code.slice(node.start, node.end); } diff --git a/src/ast/nodes/shared/ObjectEntity.ts b/src/ast/nodes/shared/ObjectEntity.ts index ac981bc3e..bc28f4d66 100644 --- a/src/ast/nodes/shared/ObjectEntity.ts +++ b/src/ast/nodes/shared/ObjectEntity.ts @@ -10,6 +10,7 @@ import { UnknownKey, UnknownNonAccessorKey } from '../../utils/PathTracker'; +import { Flag, isFlagSet, setFlag } from './BitFlags'; import type { LiteralValueOrUnknown } from './Expression'; import { deoptimizeInteraction, @@ -32,15 +33,34 @@ export interface PropertyMap { const INTEGER_REG_EXP = /^\d+$/; export class ObjectEntity extends ExpressionEntity { + private get hasLostTrack(): boolean { + return isFlagSet(this.flags, Flag.hasLostTrack); + } + private set hasLostTrack(value: boolean) { + this.flags = setFlag(this.flags, Flag.hasLostTrack, value); + } + + private get hasUnknownDeoptimizedInteger(): boolean { + return isFlagSet(this.flags, Flag.hasUnknownDeoptimizedInteger); + } + private set hasUnknownDeoptimizedInteger(value: boolean) { + this.flags = setFlag(this.flags, Flag.hasUnknownDeoptimizedInteger, value); + } + + private get hasUnknownDeoptimizedProperty(): boolean { + return isFlagSet(this.flags, Flag.hasUnknownDeoptimizedProperty); + } + private set hasUnknownDeoptimizedProperty(value: boolean) { + this.flags = setFlag(this.flags, Flag.hasUnknownDeoptimizedProperty, value); + } + private readonly additionalExpressionsToBeDeoptimized = new Set(); private readonly allProperties: ExpressionEntity[] = []; private readonly deoptimizedPaths: Record = Object.create(null); private readonly expressionsToBeDeoptimizedByKey: Record = Object.create(null); private readonly gettersByKey: PropertyMap = Object.create(null); - private hasLostTrack = false; - private hasUnknownDeoptimizedInteger = false; - private hasUnknownDeoptimizedProperty = false; + private readonly propertiesAndGettersByKey: PropertyMap = Object.create(null); private readonly propertiesAndSettersByKey: PropertyMap = Object.create(null); private readonly settersByKey: PropertyMap = Object.create(null); diff --git a/src/ast/scopes/ChildScope.ts b/src/ast/scopes/ChildScope.ts index ff653f930..11b177688 100644 --- a/src/ast/scopes/ChildScope.ts +++ b/src/ast/scopes/ChildScope.ts @@ -1,3 +1,4 @@ +import type { AstContext } from '../../Module'; import type { InternalModuleFormat } from '../../rollup/types'; import { getSafeName } from '../../utils/safeName'; import type ImportExpression from '../nodes/ImportExpression'; @@ -8,11 +9,13 @@ import Scope from './Scope'; export default class ChildScope extends Scope { readonly accessedOutsideVariables = new Map(); parent: Scope; + readonly context: AstContext; private declare accessedDynamicImports?: Set; - constructor(parent: Scope) { + constructor(parent: Scope, context: AstContext) { super(); this.parent = parent; + this.context = context; parent.children.push(this); } diff --git a/src/ast/scopes/ClassBodyScope.ts b/src/ast/scopes/ClassBodyScope.ts index d92e63c4b..662ade5d6 100644 --- a/src/ast/scopes/ClassBodyScope.ts +++ b/src/ast/scopes/ClassBodyScope.ts @@ -10,12 +10,12 @@ export default class ClassBodyScope extends ChildScope { readonly thisVariable: LocalVariable; constructor(parent: Scope, classNode: ClassNode, context: AstContext) { - super(parent); + super(parent, context); this.variables.set( 'this', (this.thisVariable = new LocalVariable('this', null, classNode, context)) ); - this.instanceScope = new ChildScope(this); + this.instanceScope = new ChildScope(this, context); this.instanceScope.variables.set('this', new ThisVariable(context)); } diff --git a/src/ast/scopes/ModuleScope.ts b/src/ast/scopes/ModuleScope.ts index c976e3ff2..51239bca0 100644 --- a/src/ast/scopes/ModuleScope.ts +++ b/src/ast/scopes/ModuleScope.ts @@ -10,12 +10,10 @@ import ChildScope from './ChildScope'; import type GlobalScope from './GlobalScope'; export default class ModuleScope extends ChildScope { - readonly context: AstContext; declare parent: GlobalScope; constructor(parent: GlobalScope, context: AstContext) { - super(parent); - this.context = context; + super(parent, context); this.variables.set('this', new LocalVariable('this', null, UNDEFINED_EXPRESSION, context)); } diff --git a/src/ast/scopes/ParameterScope.ts b/src/ast/scopes/ParameterScope.ts index 38c9a3ed5..b12861018 100644 --- a/src/ast/scopes/ParameterScope.ts +++ b/src/ast/scopes/ParameterScope.ts @@ -12,13 +12,11 @@ export default class ParameterScope extends ChildScope { readonly hoistedBodyVarScope: ChildScope; parameters: readonly ParameterVariable[][] = []; - private readonly context: AstContext; private hasRest = false; constructor(parent: Scope, context: AstContext) { - super(parent); - this.context = context; - this.hoistedBodyVarScope = new ChildScope(this); + super(parent, context); + this.hoistedBodyVarScope = new ChildScope(this, context); } /** diff --git a/src/ast/variables/NamespaceVariable.ts b/src/ast/variables/NamespaceVariable.ts index 94509b94a..22c8004c7 100644 --- a/src/ast/variables/NamespaceVariable.ts +++ b/src/ast/variables/NamespaceVariable.ts @@ -185,7 +185,8 @@ export default class NamespaceVariable extends Variable { this.mergedNamespaces = mergedNamespaces; const moduleExecIndex = this.context.getModuleExecIndex(); for (const identifier of this.references) { - if (identifier.context.getModuleExecIndex() <= moduleExecIndex) { + const { context } = identifier.scope; + if (context.getModuleExecIndex() <= moduleExecIndex) { this.referencedEarly = true; break; } diff --git a/src/utils/parseImportAttributes.ts b/src/utils/parseImportAttributes.ts index f2c094062..18346089a 100644 --- a/src/utils/parseImportAttributes.ts +++ b/src/utils/parseImportAttributes.ts @@ -12,7 +12,11 @@ import { logImportAttributeIsInvalid, logImportOptionsAreInvalid } from './logs' const ATTRIBUTE_KEYWORDS = new Set(['assert', 'with']); export function getAttributesFromImportExpression(node: ImportExpression): Record { - const { context, options, start } = node; + const { + scope: { context }, + options, + start + } = node; if (!(options instanceof ObjectExpression)) { if (options) { context.module.log(LOGLEVEL_WARN, logImportAttributeIsInvalid(context.module.id), start); From cb144b2be4262b3743b31983b26f7fa985be3ceb Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Sat, 14 Oct 2023 07:38:02 +0200 Subject: [PATCH 37/44] 4.1.0 --- CHANGELOG.md | 21 +++++++++++++++++++++ browser/package.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cbf95984b..d05d5157b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # rollup changelog +## 4.1.0 + +_2023-10-14_ + +### Features + +- Reduce memory usage of Rollup builds (#5133) + +### Pull Requests + +- [#5133](https://github.com/rollup/rollup/pull/5133): perf: reducing ast node memory overhead (@thebanjomatic) +- [#5177](https://github.com/rollup/rollup/pull/5177): chore: explicitly set rust toolchain channel (@cijiugechu) +- [#5179](https://github.com/rollup/rollup/pull/5179): Update migration guide for Rollup 4 (@lukastaegert) +- [#5180](https://github.com/rollup/rollup/pull/5180): Resolve clippy errors (@cijiugechu) +- [#5183](https://github.com/rollup/rollup/pull/5183): Add clippy to pipeline and fix remaining issues (@lukastaegert) +- [#5184](https://github.com/rollup/rollup/pull/5184): docs: fix code example for `onLog` (@tjenkinson) +- [#5186](https://github.com/rollup/rollup/pull/5186): Improve wording for native artifacts in migration guide (@lukastaegert) +- [#5190](https://github.com/rollup/rollup/pull/5190): test: add verifyAst type (@TrickyPi) +- [#5196](https://github.com/rollup/rollup/pull/5196): chore(deps): update dependency rollup to v4 (@renovate[bot]) +- [#5197](https://github.com/rollup/rollup/pull/5197): chore(deps): lock file maintenance minor/patch updates (@renovate[bot]) + ## 4.0.2 _2023-10-06_ diff --git a/browser/package.json b/browser/package.json index 23f4d54c2..8efe63110 100644 --- a/browser/package.json +++ b/browser/package.json @@ -1,6 +1,6 @@ { "name": "@rollup/browser", - "version": "4.0.2", + "version": "4.1.0", "description": "Next-generation ES module bundler browser build", "main": "dist/rollup.browser.js", "module": "dist/es/rollup.browser.js", diff --git a/package-lock.json b/package-lock.json index f2588972e..9e7021531 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rollup", - "version": "4.0.2", + "version": "4.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rollup", - "version": "4.0.2", + "version": "4.1.0", "license": "MIT", "bin": { "rollup": "dist/bin/rollup" diff --git a/package.json b/package.json index 9b40b16a2..5494e9067 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rollup", - "version": "4.0.2", + "version": "4.1.0", "description": "Next-generation ES module bundler", "main": "dist/rollup.js", "module": "dist/es/rollup.js", From f3eaa288b6afbb0ea5ad60b21238e950122a1766 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=A0=20/=20green?= Date: Sun, 15 Oct 2023 13:46:57 +0900 Subject: [PATCH 38/44] perf: use mimalloc for bindings_napi (#5201) --- rust/Cargo.lock | 27 +++++++++++++++++++++++++++ rust/bindings_napi/Cargo.toml | 6 ++++++ rust/bindings_napi/src/lib.rs | 7 +++++++ 3 files changed, 40 insertions(+) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index b3b07ca14..c79015fa9 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -158,6 +158,7 @@ dependencies = [ name = "bindings_napi" version = "0.0.0" dependencies = [ + "mimalloc-rust", "napi", "napi-build", "napi-derive", @@ -333,6 +334,12 @@ dependencies = [ "syn 2.0.38", ] +[[package]] +name = "cty" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" + [[package]] name = "dashmap" version = "5.5.3" @@ -681,6 +688,26 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "mimalloc-rust" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eb726c8298efb4010b2c46d8050e4be36cf807b9d9e98cb112f830914fc9bbe" +dependencies = [ + "cty", + "mimalloc-rust-sys", +] + +[[package]] +name = "mimalloc-rust-sys" +version = "1.7.9-source" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6413e13241a9809f291568133eca6694572cf528c1a6175502d090adce5dd5db" +dependencies = [ + "cc", + "cty", +] + [[package]] name = "minimal-lexical" version = "0.2.1" diff --git a/rust/bindings_napi/Cargo.toml b/rust/bindings_napi/Cargo.toml index 4ce67cd3c..bf55c38d3 100644 --- a/rust/bindings_napi/Cargo.toml +++ b/rust/bindings_napi/Cargo.toml @@ -15,5 +15,11 @@ napi-derive = "2.13.0" parse_ast = { path = "../parse_ast" } xxhash = { path = "../xxhash" } +[target.'cfg(not(target_os = "linux"))'.dependencies] +mimalloc-rust = { version = "0.2" } + +[target.'cfg(all(target_os = "linux", not(all(target_env = "musl", target_arch = "aarch64"))))'.dependencies] +mimalloc-rust = { version = "0.2", features = ["local-dynamic-tls"] } + [build-dependencies] napi-build = "2.0.1" diff --git a/rust/bindings_napi/src/lib.rs b/rust/bindings_napi/src/lib.rs index 261e82242..ce372cdac 100644 --- a/rust/bindings_napi/src/lib.rs +++ b/rust/bindings_napi/src/lib.rs @@ -2,6 +2,13 @@ use napi::bindgen_prelude::*; use napi_derive::napi; use parse_ast::parse_ast; +#[cfg(all( + not(all(target_os = "linux", target_env = "musl", target_arch = "aarch64")), + not(debug_assertions) +))] +#[global_allocator] +static ALLOC: mimalloc_rust::GlobalMiMalloc = mimalloc_rust::GlobalMiMalloc; + #[napi] pub fn parse(code: String, allow_return_outside_function: bool) -> Buffer { parse_ast(code, allow_return_outside_function).into() From d8b31a202a246758b8d67eefe77361a894d37005 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Sun, 15 Oct 2023 08:16:48 +0200 Subject: [PATCH 39/44] 4.1.1 --- CHANGELOG.md | 12 ++++++++++++ browser/package.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d05d5157b..139ca38b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # rollup changelog +## 4.1.1 + +_2023-10-15_ + +### Bug Fixes + +- Improve Node parsing performance (#5201) + +### Pull Requests + +- [#5201](https://github.com/rollup/rollup/pull/5201): perf: use mimalloc for bindings_napi (@sapphi-red) + ## 4.1.0 _2023-10-14_ diff --git a/browser/package.json b/browser/package.json index 8efe63110..a586fba2c 100644 --- a/browser/package.json +++ b/browser/package.json @@ -1,6 +1,6 @@ { "name": "@rollup/browser", - "version": "4.1.0", + "version": "4.1.1", "description": "Next-generation ES module bundler browser build", "main": "dist/rollup.browser.js", "module": "dist/es/rollup.browser.js", diff --git a/package-lock.json b/package-lock.json index 9e7021531..842e0616b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rollup", - "version": "4.1.0", + "version": "4.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rollup", - "version": "4.1.0", + "version": "4.1.1", "license": "MIT", "bin": { "rollup": "dist/bin/rollup" diff --git a/package.json b/package.json index 5494e9067..ff8fb84dd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rollup", - "version": "4.1.0", + "version": "4.1.1", "description": "Next-generation ES module bundler", "main": "dist/rollup.js", "module": "dist/es/rollup.js", From ee0639e711672b552fcd2928a700bc5541a564f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=A0=20/=20green?= Date: Sun, 15 Oct 2023 16:23:23 +0900 Subject: [PATCH 40/44] fix: export xxhashBase64Url from wasm (#5203) * fix: export xxhashBase64Url from wasm * fix: set js_name for xxhash_base64_url function from wasm --------- Co-authored-by: Lukas Taegert-Atkinson --- browser/src/wasm.ts | 2 +- native.wasm.js | 4 ++++ package.json | 5 +++-- rust/bindings_wasm/src/lib.rs | 2 +- scripts/lint-native-js.js | 29 ++++++++++++++++++++++++++++ scripts/publish-wasm-node-package.js | 9 +++------ wasm/bindings_wasm.d.ts | 4 ++-- wasm/bindings_wasm_bg.wasm.d.ts | 2 +- 8 files changed, 44 insertions(+), 13 deletions(-) create mode 100644 native.wasm.js create mode 100644 scripts/lint-native-js.js diff --git a/browser/src/wasm.ts b/browser/src/wasm.ts index d57a0c823..03bf6168f 100644 --- a/browser/src/wasm.ts +++ b/browser/src/wasm.ts @@ -1,2 +1,2 @@ // eslint-disable-next-line import/no-unresolved -export { parse, xxhash_base64_url as xxhashBase64Url } from '../../wasm/bindings_wasm.js'; +export { parse, xxhashBase64Url } from '../../wasm/bindings_wasm.js'; diff --git a/native.wasm.js b/native.wasm.js new file mode 100644 index 000000000..7af1fe756 --- /dev/null +++ b/native.wasm.js @@ -0,0 +1,4 @@ +const { parse, xxhashBase64Url } = require('./wasm-node/bindings_wasm.js'); + +exports.parse = parse; +exports.xxhashBase64Url = xxhashBase64Url; diff --git a/package.json b/package.json index ff8fb84dd..eb9ac0478 100644 --- a/package.json +++ b/package.json @@ -49,13 +49,14 @@ "build:docs": "vitepress build docs", "preview:docs": "vitepress preview docs", "ci:artifacts": "napi artifacts", - "ci:lint": "concurrently -c red,green,blue 'npm:lint:js:nofix' 'npm:lint:markdown:nofix' 'npm:lint:rust:nofix'", + "ci:lint": "concurrently -c red,yellow,green,blue 'npm:lint:js:nofix' 'npm:lint:native-js' 'npm:lint:markdown:nofix' 'npm:lint:rust:nofix'", "ci:test:only": "npm run build:cjs && npm run build:copy-native && npm run build:bootstrap && npm run build:copy-native && npm run test:only", "ci:test:all": "npm run build:cjs && npm run build:copy-native && npm run build:bootstrap && npm run build:copy-native && concurrently --kill-others-on-fail -c green,blue,magenta,cyan 'npm:test:only' 'npm:test:typescript' 'npm:test:leak' 'npm:test:browser'", "ci:coverage": "npm run build:cjs && npm run build:copy-native && npm run build:bootstrap && npm run build:copy-native && nyc --reporter lcovonly mocha", - "lint": "concurrently -c red,green,blue 'npm:lint:js' 'npm:lint:markdown' 'npm:lint:rust'", + "lint": "concurrently -c red,yellow,green,blue 'npm:lint:js' 'npm:lint:native-js' 'npm:lint:markdown' 'npm:lint:rust'", "lint:js": "eslint . --fix --cache", "lint:js:nofix": "eslint . --cache", + "lint:native-js": "node scripts/lint-native-js.js", "lint:markdown": "prettier --write \"**/*.md\"", "lint:markdown:nofix": "prettier --check \"**/*.md\"", "lint:rust": "cd rust && cargo fmt && cargo clippy --fix --allow-dirty", diff --git a/rust/bindings_wasm/src/lib.rs b/rust/bindings_wasm/src/lib.rs index 500176068..d84eb52ff 100644 --- a/rust/bindings_wasm/src/lib.rs +++ b/rust/bindings_wasm/src/lib.rs @@ -7,7 +7,7 @@ pub fn parse(code: String, allow_return_outside_function: bool) -> Vec { parse_ast(code, allow_return_outside_function) } -#[wasm_bindgen] +#[wasm_bindgen(js_name=xxhashBase64Url)] pub fn xxhash_base64_url(input: Uint8Array) -> String { xxhash::xxhash_base64_url(&input.to_vec()) } diff --git a/scripts/lint-native-js.js b/scripts/lint-native-js.js new file mode 100644 index 000000000..87936a901 --- /dev/null +++ b/scripts/lint-native-js.js @@ -0,0 +1,29 @@ +import fs from 'node:fs/promises'; +import path from 'node:path'; +import url from 'node:url'; + +const __dirname = path.dirname(url.fileURLToPath(import.meta.url)); +const NATIVE_JS_PATH = path.resolve(__dirname, '../native.js'); +const NATIVE_WASM_JS_PATH = path.resolve(__dirname, '../native.wasm.js'); + +const [nativeJsContent, nativeWasmJsContent] = await Promise.all([ + fs.readFile(NATIVE_JS_PATH, 'utf8'), + fs.readFile(NATIVE_WASM_JS_PATH, 'utf8') +]); + +const nativeJsExportsMatches = nativeJsContent.matchAll(/exports\.(\w+)\s*=/g); +const notFoundExports = []; +for (const match of nativeJsExportsMatches) { + const exportName = match[1]; + if (!nativeWasmJsContent.includes(`exports.${exportName}`)) { + notFoundExports.push(exportName); + } +} + +if (notFoundExports.length > 0) { + throw new Error( + `${JSON.stringify( + notFoundExports.join(',') + )} was exported from native.js but not exported from native.wasm.js.` + ); +} diff --git a/scripts/publish-wasm-node-package.js b/scripts/publish-wasm-node-package.js index 45426fa88..11f342baa 100644 --- a/scripts/publish-wasm-node-package.js +++ b/scripts/publish-wasm-node-package.js @@ -10,11 +10,6 @@ const WASM_NODE_PACKAGE_INFO = { }; const COPIED_FILES_OR_DIRS = ['LICENSE.md', 'dist']; const PACKAGE_DIR = 'wasm-node-package'; -const NATIVE_JS_CONTENT = ` -const { parse } = require('./wasm-node/bindings_wasm.js'); - -exports.parse = parse -`; function getPath(...arguments_) { return resolve(PACKAGE_DIR, ...arguments_); @@ -43,8 +38,10 @@ export default async function publishWasmNodePackage() { ) ]); + const nativeJsContent = await fs.readFile(resolve(__dirname, '../native.wasm.js'), 'utf8'); + await Promise.all([ - fs.writeFile(getPath('dist', 'native.js'), NATIVE_JS_CONTENT.trimStart()), + fs.writeFile(getPath('dist', 'native.js'), nativeJsContent.trimStart()), fs.cp('artifacts/bindings-wasm-node/wasm-node', getPath('dist', 'wasm-node'), { recursive: true }) diff --git a/wasm/bindings_wasm.d.ts b/wasm/bindings_wasm.d.ts index 8823988c4..0f969452a 100644 --- a/wasm/bindings_wasm.d.ts +++ b/wasm/bindings_wasm.d.ts @@ -10,7 +10,7 @@ export function parse(code: string, allow_return_outside_function: boolean): Uin * @param {Uint8Array} input * @returns {string} */ -export function xxhash_base64_url(input: Uint8Array): string; +export function xxhashBase64Url(input: Uint8Array): string; /** * @param {string} query * @param {any} opts @@ -23,7 +23,7 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl export interface InitOutput { readonly memory: WebAssembly.Memory; readonly parse: (a: number, b: number, c: number, d: number) => void; - readonly xxhash_base64_url: (a: number, b: number) => void; + readonly xxhashBase64Url: (a: number, b: number) => void; readonly browserslist: (a: number, b: number, c: number, d: number) => void; readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; diff --git a/wasm/bindings_wasm_bg.wasm.d.ts b/wasm/bindings_wasm_bg.wasm.d.ts index 08c257c79..14398a0b6 100644 --- a/wasm/bindings_wasm_bg.wasm.d.ts +++ b/wasm/bindings_wasm_bg.wasm.d.ts @@ -2,7 +2,7 @@ /* eslint-disable */ export const memory: WebAssembly.Memory; export function parse(a: number, b: number, c: number, d: number): void; -export function xxhash_base64_url(a: number, b: number): void; +export function xxhashBase64Url(a: number, b: number): void; export function browserslist(a: number, b: number, c: number, d: number): void; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; From ebd96c447bab292e33b05628ec8e7d0e61bb59b8 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Sun, 15 Oct 2023 16:19:38 +0200 Subject: [PATCH 41/44] 4.1.2 --- CHANGELOG.md | 12 ++++++++++++ browser/package.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 139ca38b3..e1408c254 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # rollup changelog +## 4.1.2 + +_2023-10-15_ + +### Bug Fixes + +- Fix WASM build as hash function was not exported (#5203) + +### Pull Requests + +- [#5203](https://github.com/rollup/rollup/pull/5203): fix: export xxhashBase64Url from wasm (@sapphi-red) + ## 4.1.1 _2023-10-15_ diff --git a/browser/package.json b/browser/package.json index a586fba2c..591d57880 100644 --- a/browser/package.json +++ b/browser/package.json @@ -1,6 +1,6 @@ { "name": "@rollup/browser", - "version": "4.1.1", + "version": "4.1.2", "description": "Next-generation ES module bundler browser build", "main": "dist/rollup.browser.js", "module": "dist/es/rollup.browser.js", diff --git a/package-lock.json b/package-lock.json index 842e0616b..142c92fee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rollup", - "version": "4.1.1", + "version": "4.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rollup", - "version": "4.1.1", + "version": "4.1.2", "license": "MIT", "bin": { "rollup": "dist/bin/rollup" diff --git a/package.json b/package.json index eb9ac0478..e1138c48c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rollup", - "version": "4.1.1", + "version": "4.1.2", "description": "Next-generation ES module bundler", "main": "dist/rollup.js", "module": "dist/es/rollup.js", From 70f79ad2f11a45524fcb89cbbb7138d8bb828b68 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Sun, 15 Oct 2023 19:25:15 +0200 Subject: [PATCH 42/44] Fix publish script --- scripts/publish-wasm-node-package.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/publish-wasm-node-package.js b/scripts/publish-wasm-node-package.js index 11f342baa..b48c6a556 100644 --- a/scripts/publish-wasm-node-package.js +++ b/scripts/publish-wasm-node-package.js @@ -1,6 +1,6 @@ -import fs from 'node:fs/promises'; +import { cp, mkdir, readFile, writeFile } from 'node:fs/promises'; import { resolve } from 'node:path'; - +import { fileURLToPath } from 'node:url'; import { readJson, runWithEcho } from './helpers.js'; import { MAIN_PACKAGE } from './release-constants.js'; @@ -9,14 +9,14 @@ const WASM_NODE_PACKAGE_INFO = { name: '@rollup/wasm-node' }; const COPIED_FILES_OR_DIRS = ['LICENSE.md', 'dist']; -const PACKAGE_DIR = 'wasm-node-package'; +const PACKAGE_DIR = fileURLToPath(new URL('../wasm-node-package', import.meta.url)); -function getPath(...arguments_) { +function getOutputPath(...arguments_) { return resolve(PACKAGE_DIR, ...arguments_); } export default async function publishWasmNodePackage() { - await fs.mkdir(PACKAGE_DIR); + await mkdir(PACKAGE_DIR); const mainPackage = await readJson(MAIN_PACKAGE); mainPackage.files.unshift('dist/wasm-node/*.wasm'); @@ -24,9 +24,9 @@ export default async function publishWasmNodePackage() { delete mainPackage.scripts; await Promise.all([ - ...COPIED_FILES_OR_DIRS.map(file => fs.cp(file, getPath(file), { recursive: true })), - fs.writeFile( - getPath('package.json'), + ...COPIED_FILES_OR_DIRS.map(file => cp(file, getOutputPath(file), { recursive: true })), + writeFile( + getOutputPath('package.json'), JSON.stringify( { ...mainPackage, @@ -38,11 +38,11 @@ export default async function publishWasmNodePackage() { ) ]); - const nativeJsContent = await fs.readFile(resolve(__dirname, '../native.wasm.js'), 'utf8'); + const nativeJsContent = await readFile(new URL('../native.wasm.js', import.meta.url), 'utf8'); await Promise.all([ - fs.writeFile(getPath('dist', 'native.js'), nativeJsContent.trimStart()), - fs.cp('artifacts/bindings-wasm-node/wasm-node', getPath('dist', 'wasm-node'), { + writeFile(getOutputPath('dist', 'native.js'), nativeJsContent.trimStart()), + cp('artifacts/bindings-wasm-node/wasm-node', getOutputPath('dist', 'wasm-node'), { recursive: true }) ]); From c61a1507a88fc71be431550642b040da4b9422b0 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Sun, 15 Oct 2023 19:30:32 +0200 Subject: [PATCH 43/44] 4.1.3 --- CHANGELOG.md | 8 +++++++- browser/package.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1408c254..3c0cc0baa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # rollup changelog -## 4.1.2 +## 4.1.3 _2023-10-15_ @@ -12,6 +12,12 @@ _2023-10-15_ - [#5203](https://github.com/rollup/rollup/pull/5203): fix: export xxhashBase64Url from wasm (@sapphi-red) +## 4.1.2 + +_2023-10-15_ + +_Release did not finish successfully_ + ## 4.1.1 _2023-10-15_ diff --git a/browser/package.json b/browser/package.json index 591d57880..6060c18d5 100644 --- a/browser/package.json +++ b/browser/package.json @@ -1,6 +1,6 @@ { "name": "@rollup/browser", - "version": "4.1.2", + "version": "4.1.3", "description": "Next-generation ES module bundler browser build", "main": "dist/rollup.browser.js", "module": "dist/es/rollup.browser.js", diff --git a/package-lock.json b/package-lock.json index 142c92fee..b0c774940 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rollup", - "version": "4.1.2", + "version": "4.1.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rollup", - "version": "4.1.2", + "version": "4.1.3", "license": "MIT", "bin": { "rollup": "dist/bin/rollup" diff --git a/package.json b/package.json index e1138c48c..667391b7a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rollup", - "version": "4.1.2", + "version": "4.1.3", "description": "Next-generation ES module bundler", "main": "dist/rollup.js", "module": "dist/es/rollup.js", From 51c974d0463d9c5638afd3b2620cf5cd6f657890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=A0=20/=20green?= Date: Mon, 16 Oct 2023 04:42:13 +0900 Subject: [PATCH 44/44] perf: shrink wasm size by avoid importing browserslist (#5204) --- rust/Cargo.lock | 864 ++------------------ rust/bindings_wasm/Cargo.toml | 1 + rust/parse_ast/Cargo.toml | 5 +- rust/parse_ast/src/convert_ast/converter.rs | 2 +- rust/parse_ast/src/lib.rs | 70 +- wasm/bindings_wasm.d.ts | 9 +- wasm/bindings_wasm_bg.wasm.d.ts | 3 +- 7 files changed, 87 insertions(+), 867 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index c79015fa9..5804c2e1e 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -36,7 +36,6 @@ dependencies = [ "cfg-if", "getrandom", "once_cell", - "serde", "version_check", ] @@ -49,21 +48,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - [[package]] name = "anyhow" version = "1.0.75" @@ -170,6 +154,7 @@ dependencies = [ name = "bindings_wasm" version = "0.0.0" dependencies = [ + "getrandom", "js-sys", "parse_ast", "wasm-bindgen", @@ -188,40 +173,6 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "browserslist-rs" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bda9b4595376bf255f68dafb5dcc5b0e2842b38dc2a7b52c4e0bfe9fd1c651" -dependencies = [ - "ahash", - "anyhow", - "chrono", - "either", - "getrandom", - "itertools", - "js-sys", - "nom", - "once_cell", - "quote", - "serde", - "serde-wasm-bindgen", - "serde_json", - "string_cache", - "string_cache_codegen", - "thiserror", - "wasm-bindgen", -] - [[package]] name = "bumpalo" version = "3.14.0" @@ -243,20 +194,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chrono" -version = "0.4.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "wasm-bindgen", - "windows-targets", -] - [[package]] name = "convert_case" version = "0.6.0" @@ -266,21 +203,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "core-foundation-sys" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" - -[[package]] -name = "cpufeatures" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" -dependencies = [ - "libc", -] - [[package]] name = "crossbeam-deque" version = "0.8.3" @@ -314,16 +236,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - [[package]] name = "ctor" version = "0.2.5" @@ -369,16 +281,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", -] - [[package]] name = "either" version = "1.9.0" @@ -418,16 +320,6 @@ dependencies = [ "syn 2.0.38", ] -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - [[package]] name = "getrandom" version = "0.2.10" @@ -453,15 +345,6 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - [[package]] name = "hashbrown" version = "0.14.1" @@ -483,29 +366,6 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" -[[package]] -name = "iana-time-zone" -version = "0.1.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - [[package]] name = "idna" version = "0.4.0" @@ -530,7 +390,6 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", - "serde", ] [[package]] @@ -562,15 +421,6 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb" -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.9" @@ -586,15 +436,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "jsonc-parser" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b56a20e76235284255a09fcd1f45cf55d3c524ea657ebd3854735925c57743d" -dependencies = [ - "serde_json", -] - [[package]] name = "lazy_static" version = "1.4.0" @@ -633,15 +474,6 @@ version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" -[[package]] -name = "lru" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718e8fae447df0c7e1ba7f5189829e63fd536945c8988d61444c19039f16b670" -dependencies = [ - "hashbrown 0.13.2", -] - [[package]] name = "memchr" version = "2.6.4" @@ -708,12 +540,6 @@ dependencies = [ "cty", ] -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - [[package]] name = "miniz_oxide" version = "0.7.1" @@ -786,25 +612,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "normpath" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a9da8c9922c35a1033d76f7272dfc2e7ee20392083d75aeea6ced23c6266578" -dependencies = [ - "winapi", -] - [[package]] name = "num-bigint" version = "0.4.4" @@ -896,8 +703,9 @@ version = "0.0.0" dependencies = [ "anyhow", "parking_lot", - "swc", + "swc_atoms", "swc_common", + "swc_compiler_base", "swc_ecma_ast", "swc_ecma_lints", "swc_ecma_parser", @@ -906,12 +714,6 @@ dependencies = [ "swc_error_reporters", ] -[[package]] -name = "path-clean" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecba01bf2678719532c5e3059e0b5f0811273d94b397088b82e3bd0a78c78fdd" - [[package]] name = "pathdiff" version = "0.2.1" @@ -1007,24 +809,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" -[[package]] -name = "preset_env_base" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae83c5857727636a1f2c7188632c8a57986d2f1d2e2cf45f2642f5856c5b8e85" -dependencies = [ - "ahash", - "anyhow", - "browserslist-rs", - "dashmap", - "from_variant", - "once_cell", - "semver 1.0.20", - "serde", - "st-map", - "tracing", -] - [[package]] name = "proc-macro-error" version = "1.0.4" @@ -1149,9 +933,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d119d7c7ca818f8a53c300863d4f87566aac09943aef5b355bb83969dae75d87" +checksum = "aaac441002f822bc9705a681810a4dd2963094b9ca0ddc41cb963a4c189189ea" dependencies = [ "aho-corasick", "memchr", @@ -1161,9 +945,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "465c6fc0621e4abc4187a2bda0937bfd4f722c2730b29562e19689ea796c9a4b" +checksum = "5011c7e263a695dc8ca064cddb722af1be54e517a280b12a5356f98366899e5d" dependencies = [ "aho-corasick", "memchr", @@ -1172,9 +956,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56d84fdd47036b038fc80dd333d10b6aab10d5d31f4a366e20014def75328d33" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rustc-demangle" @@ -1205,9 +989,9 @@ checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "ryu-js" -version = "0.2.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6518fc26bced4d53678a22d6e423e9d8716377def84545fe328236e3af070e7f" +checksum = "4950d85bc52415f8432144c97c4791bd0c4f7954de32a7270ee9cccd3c22b12b" [[package]] name = "scoped-tls" @@ -1235,9 +1019,6 @@ name = "semver" version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" -dependencies = [ - "serde", -] [[package]] name = "semver-parser" @@ -1254,17 +1035,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde-wasm-bindgen" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" -dependencies = [ - "js-sys", - "serde", - "wasm-bindgen", -] - [[package]] name = "serde_derive" version = "1.0.189" @@ -1287,17 +1057,6 @@ dependencies = [ "serde", ] -[[package]] -name = "sha-1" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - [[package]] name = "siphasher" version = "0.3.11" @@ -1343,16 +1102,6 @@ dependencies = [ "url", ] -[[package]] -name = "st-map" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f352d5d14be5a1f956d76ae0c8060c3487aaa2a080f10a4b4ff023c7c05a9047" -dependencies = [ - "arrayvec", - "static-map-macro", -] - [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -1372,18 +1121,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "static-map-macro" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7628ae0bd92555d3de4303da41a5c8b1c5363e892001325f34e4be9ed024d0d7" -dependencies = [ - "pmutil", - "proc-macro2", - "quote", - "syn 2.0.38", -] - [[package]] name = "static_assertions" version = "1.1.0" @@ -1457,54 +1194,6 @@ dependencies = [ "atty", ] -[[package]] -name = "swc" -version = "0.268.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c0f38e760a7427682f38ee4b3a1454e7fffefb8bf899feea00d993fd80c3ac6" -dependencies = [ - "anyhow", - "base64 0.13.1", - "dashmap", - "either", - "indexmap 1.9.3", - "jsonc-parser", - "lru", - "once_cell", - "parking_lot", - "pathdiff", - "regex", - "rustc-hash", - "serde", - "serde_json", - "sourcemap", - "swc_atoms", - "swc_cached", - "swc_common", - "swc_compiler_base", - "swc_config", - "swc_ecma_ast", - "swc_ecma_codegen", - "swc_ecma_ext_transforms", - "swc_ecma_lints", - "swc_ecma_loader", - "swc_ecma_minifier", - "swc_ecma_parser", - "swc_ecma_preset_env", - "swc_ecma_transforms", - "swc_ecma_transforms_base", - "swc_ecma_transforms_compat", - "swc_ecma_transforms_optimization", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_error_reporters", - "swc_node_comments", - "swc_timer", - "swc_visit", - "tracing", - "url", -] - [[package]] name = "swc_atoms" version = "0.6.0" @@ -1564,9 +1253,9 @@ dependencies = [ [[package]] name = "swc_compiler_base" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d6a44aa824c4c572bef137ee61009d7c90565f52bd3165e3a8d6db519f8b80e" +checksum = "0c9c750cfc2b37779dfc50a37311b0c5a13155453ec80eaa9c2b94da9e7c3dd8" dependencies = [ "anyhow", "base64 0.13.1", @@ -1659,281 +1348,53 @@ dependencies = [ ] [[package]] -name = "swc_ecma_compat_bugfixes" -version = "0.1.1" +name = "swc_ecma_lints" +version = "0.89.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8492fecb7c39e7c03e85adb39c1493dbe59127b148c68d88d58a56a986edb9d" +checksum = "93a2678e9fbc05f984eb7eba63e1e447fc87fac962689a650c440be9cf684a56" dependencies = [ + "auto_impl", + "dashmap", + "parking_lot", + "rayon", + "regex", + "serde", "swc_atoms", "swc_common", + "swc_config", "swc_ecma_ast", - "swc_ecma_compat_es2015", - "swc_ecma_transforms_base", "swc_ecma_utils", "swc_ecma_visit", - "swc_trace_macro", - "tracing", ] [[package]] -name = "swc_ecma_compat_common" -version = "0.1.1" +name = "swc_ecma_minifier" +version = "0.188.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50245762634ec219fb233f15763d95e875be18ee144637b1fb8287ff8047a672" +checksum = "4e15ead8e8a1f7e84b15c8800fc27f9b578544c6086396a06a8e58104fffbbd7" dependencies = [ + "arrayvec", + "indexmap 1.9.3", + "num-bigint", + "num_cpus", + "once_cell", + "parking_lot", + "radix_fmt", + "regex", + "rustc-hash", + "ryu-js", + "serde", + "serde_json", + "swc_atoms", + "swc_cached", "swc_common", + "swc_config", "swc_ecma_ast", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_trace_macro", -] - -[[package]] -name = "swc_ecma_compat_es2015" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aee936ff031706c11c3314aa47f1e408b979f2cb8eb657d133e5cc5359595eb" -dependencies = [ - "arrayvec", - "indexmap 1.9.3", - "is-macro", - "serde", - "serde_derive", - "smallvec", - "swc_atoms", - "swc_common", - "swc_config", - "swc_ecma_ast", - "swc_ecma_compat_common", - "swc_ecma_transforms_base", - "swc_ecma_transforms_classes", - "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_trace_macro", - "tracing", -] - -[[package]] -name = "swc_ecma_compat_es2016" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edd059dbf29c7be2258a1c5ed4b66d62cd5742b7eb3ccb3c87be124d7ff95e4f" -dependencies = [ - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_trace_macro", - "tracing", -] - -[[package]] -name = "swc_ecma_compat_es2017" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e6fd80a8afbe78b250a57d824238f3b94def9a2951e58ea802fa1670d70b00" -dependencies = [ - "serde", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_trace_macro", - "tracing", -] - -[[package]] -name = "swc_ecma_compat_es2018" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e48750104863e93ba82487f18513f677bcd6b14fcc6e56bccc98c66f64eb275" -dependencies = [ - "serde", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_compat_common", - "swc_ecma_transforms_base", - "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_trace_macro", - "tracing", -] - -[[package]] -name = "swc_ecma_compat_es2019" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "607de96545c73c5d1bab3dee0954e706dedcf36ff90882cd3168731eb1a49924" -dependencies = [ - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_trace_macro", - "tracing", -] - -[[package]] -name = "swc_ecma_compat_es2020" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760ff522431fb9124fbe7d499171044df8375354fcd856779fdc8473df7f8d2b" -dependencies = [ - "serde", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_trace_macro", - "tracing", -] - -[[package]] -name = "swc_ecma_compat_es2021" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f2d1251f0e309a61f0e8bedb6e2554c822e5091584e538f65a850a4aa1a52ba" -dependencies = [ - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_trace_macro", - "tracing", -] - -[[package]] -name = "swc_ecma_compat_es2022" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd3c1b75b0cb6e1f41a0872831c56543790366dcb3868299bb39f9696c194825" -dependencies = [ - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_compat_common", - "swc_ecma_transforms_base", - "swc_ecma_transforms_classes", - "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_trace_macro", - "tracing", -] - -[[package]] -name = "swc_ecma_compat_es3" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3627d26b77f3fe1496d7910cc8acbdc840c7a16eac0de2e99102673112bc8f97" -dependencies = [ - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_trace_macro", - "tracing", -] - -[[package]] -name = "swc_ecma_ext_transforms" -version = "0.110.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba15f88295428c69e3fd2cf80306432c87476abba09c8fe2e4880afa931a01e0" -dependencies = [ - "phf", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_lints" -version = "0.89.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93a2678e9fbc05f984eb7eba63e1e447fc87fac962689a650c440be9cf684a56" -dependencies = [ - "auto_impl", - "dashmap", - "parking_lot", - "rayon", - "regex", - "serde", - "swc_atoms", - "swc_common", - "swc_config", - "swc_ecma_ast", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_loader" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7fe06d942fe20a5a81cc14f4a53e64a5efdc851fa895a869224b2d41df73276" -dependencies = [ - "anyhow", - "dashmap", - "lru", - "normpath", - "once_cell", - "parking_lot", - "path-clean", - "pathdiff", - "serde", - "serde_json", - "swc_cached", - "swc_common", - "tracing", -] - -[[package]] -name = "swc_ecma_minifier" -version = "0.188.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6058566588988a7463bab250215e6205d258184a0c23e38da96ce92d88079ee" -dependencies = [ - "arrayvec", - "indexmap 1.9.3", - "num-bigint", - "num_cpus", - "once_cell", - "parking_lot", - "radix_fmt", - "regex", - "rustc-hash", - "ryu-js", - "serde", - "serde_json", - "swc_atoms", - "swc_cached", - "swc_common", - "swc_config", - "swc_ecma_ast", - "swc_ecma_codegen", - "swc_ecma_parser", - "swc_ecma_transforms_base", - "swc_ecma_transforms_optimization", - "swc_ecma_usage_analyzer", + "swc_ecma_codegen", + "swc_ecma_parser", + "swc_ecma_transforms_base", + "swc_ecma_transforms_optimization", + "swc_ecma_usage_analyzer", "swc_ecma_utils", "swc_ecma_visit", "swc_timer", @@ -1960,51 +1421,6 @@ dependencies = [ "typed-arena", ] -[[package]] -name = "swc_ecma_preset_env" -version = "0.202.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d86d2220a18c9c274ba992283e2de283c9c74a0fb8c666376d2bf8f7737fd4" -dependencies = [ - "anyhow", - "dashmap", - "indexmap 1.9.3", - "once_cell", - "preset_env_base", - "rustc-hash", - "semver 1.0.20", - "serde", - "serde_json", - "st-map", - "string_enum", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_transforms" -version = "0.225.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0518045c2961b20428f05167bc8e6337e856fd028a2dedb2e707f42d4187c8f" -dependencies = [ - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_transforms_compat", - "swc_ecma_transforms_module", - "swc_ecma_transforms_optimization", - "swc_ecma_transforms_proposal", - "swc_ecma_transforms_react", - "swc_ecma_transforms_typescript", - "swc_ecma_utils", - "swc_ecma_visit", -] - [[package]] name = "swc_ecma_transforms_base" version = "0.134.3" @@ -2028,56 +1444,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "swc_ecma_transforms_classes" -version = "0.123.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f69f5ef8b7fe7660f201d32058e82011747c25f57ee3a2012d23a06cf88df65" -dependencies = [ - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_transforms_compat" -version = "0.160.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fab79951f3198d10dfe88483403eac05e72776716fa789bd1de5162305ff0a9d" -dependencies = [ - "arrayvec", - "indexmap 1.9.3", - "is-macro", - "num-bigint", - "serde", - "smallvec", - "swc_atoms", - "swc_common", - "swc_config", - "swc_ecma_ast", - "swc_ecma_compat_bugfixes", - "swc_ecma_compat_common", - "swc_ecma_compat_es2015", - "swc_ecma_compat_es2016", - "swc_ecma_compat_es2017", - "swc_ecma_compat_es2018", - "swc_ecma_compat_es2019", - "swc_ecma_compat_es2020", - "swc_ecma_compat_es2021", - "swc_ecma_compat_es2022", - "swc_ecma_compat_es3", - "swc_ecma_transforms_base", - "swc_ecma_transforms_classes", - "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_trace_macro", - "tracing", -] - [[package]] name = "swc_ecma_transforms_macros" version = "0.5.3" @@ -2091,33 +1457,6 @@ dependencies = [ "syn 2.0.38", ] -[[package]] -name = "swc_ecma_transforms_module" -version = "0.177.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5c5e796333fb4a7c4e066e0402685d3d1ac008802e012f51d8579935fe03f4b" -dependencies = [ - "Inflector", - "anyhow", - "bitflags 2.4.0", - "indexmap 1.9.3", - "is-macro", - "path-clean", - "pathdiff", - "regex", - "serde", - "swc_atoms", - "swc_cached", - "swc_common", - "swc_ecma_ast", - "swc_ecma_loader", - "swc_ecma_parser", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", - "tracing", -] - [[package]] name = "swc_ecma_transforms_optimization" version = "0.194.6" @@ -2142,67 +1481,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "swc_ecma_transforms_proposal" -version = "0.168.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "333698d903d15fb4689d38dff2bd5b42323b9649b549cfa8da9fd778a4c202f1" -dependencies = [ - "either", - "rustc-hash", - "serde", - "smallvec", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_transforms_classes", - "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_transforms_react" -version = "0.180.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a2c78d2983bfe9fef24011ca84e043f21fa0062eb456313709e08336818c4cb" -dependencies = [ - "base64 0.13.1", - "dashmap", - "indexmap 1.9.3", - "once_cell", - "serde", - "sha-1", - "string_enum", - "swc_atoms", - "swc_common", - "swc_config", - "swc_ecma_ast", - "swc_ecma_parser", - "swc_ecma_transforms_base", - "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_transforms_typescript" -version = "0.184.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c96270280171c483bb4ba07c86d632fdad972e166218b8bf7d318e973a0b8d7e" -dependencies = [ - "ryu-js", - "serde", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_transforms_react", - "swc_ecma_utils", - "swc_ecma_visit", -] - [[package]] name = "swc_ecma_usage_analyzer" version = "0.20.3" @@ -2301,17 +1579,6 @@ dependencies = [ "syn 2.0.38", ] -[[package]] -name = "swc_node_comments" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf250afa389a40c4856a250d63f5b1f8d46b513446299b72166c870c7641c365" -dependencies = [ - "dashmap", - "swc_atoms", - "swc_common", -] - [[package]] name = "swc_timer" version = "0.21.0" @@ -2321,17 +1588,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "swc_trace_macro" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff9719b6085dd2824fd61938a881937be14b08f95e2d27c64c825a9f65e052ba" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.38", -] - [[package]] name = "swc_visit" version = "0.5.7" @@ -2436,11 +1692,10 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "ee2ef2af84856a50c1d430afce2fdded0a4ec7eda868db86409b4543df0797f9" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -2448,9 +1703,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", @@ -2459,9 +1714,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] @@ -2482,12 +1737,6 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - [[package]] name = "unicode-bidi" version = "0.3.13" @@ -2638,15 +1887,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/rust/bindings_wasm/Cargo.toml b/rust/bindings_wasm/Cargo.toml index a596a4824..8a9ea1255 100644 --- a/rust/bindings_wasm/Cargo.toml +++ b/rust/bindings_wasm/Cargo.toml @@ -8,6 +8,7 @@ wasm-bindgen = "0.2.87" parse_ast = { path = "../parse_ast" } xxhash = { path = "../xxhash" } js-sys = "0.3.64" +getrandom = { version = "0.2.10", features = ["js"] } [lib] crate-type = ["cdylib", "rlib"] diff --git a/rust/parse_ast/Cargo.toml b/rust/parse_ast/Cargo.toml index 14435b5db..6b7914250 100644 --- a/rust/parse_ast/Cargo.toml +++ b/rust/parse_ast/Cargo.toml @@ -7,8 +7,9 @@ edition = "2021" [dependencies] anyhow = "1.0.75" -swc = "0.268.7" -swc_common = "0.33.0" +swc_atoms = "0.6.0" +swc_compiler_base = "0.2.8" +swc_common = { version = "0.33.0", features = ["ahash", "parking_lot"] } swc_ecma_ast = "0.110.0" swc_ecma_parser = "0.141.1" swc_error_reporters = "0.17.0" diff --git a/rust/parse_ast/src/convert_ast/converter.rs b/rust/parse_ast/src/convert_ast/converter.rs index fa183cca2..8339c96d6 100644 --- a/rust/parse_ast/src/convert_ast/converter.rs +++ b/rust/parse_ast/src/convert_ast/converter.rs @@ -1,4 +1,4 @@ -use swc::atoms::JsWord; +use swc_atoms::JsWord; use swc_common::Span; use swc_ecma_ast::{ ArrayLit, ArrayPat, ArrowExpr, AssignExpr, AssignOp, AssignPat, AssignPatProp, AwaitExpr, BigInt, diff --git a/rust/parse_ast/src/lib.rs b/rust/parse_ast/src/lib.rs index 21b6effeb..59bf9caf0 100644 --- a/rust/parse_ast/src/lib.rs +++ b/rust/parse_ast/src/lib.rs @@ -2,10 +2,10 @@ use std::sync::Arc; use convert_ast::converter::AstConverter; -use swc::config::IsModule::Unknown; -use swc::{config::ParseOptions, Compiler}; use swc_common::sync::Lrc; use swc_common::{FileName, FilePathMapping, Globals, SourceMap, GLOBALS}; +use swc_compiler_base::parse_js; +use swc_compiler_base::IsModule; use swc_ecma_ast::EsVersion; use swc_ecma_parser::{EsConfig, Syntax}; @@ -17,52 +17,38 @@ use error_emit::try_with_handler; mod error_emit; -fn get_compiler() -> Arc { +pub fn parse_ast(code: String, allow_return_outside_function: bool) -> Vec { let cm = Arc::new(SourceMap::new(FilePathMapping::empty())); - Arc::new(Compiler::new(cm)) -} + let target = EsVersion::EsNext; + let syntax = Syntax::Es(EsConfig { + allow_return_outside_function, + import_attributes: true, + ..Default::default() + }); -pub fn parse_ast(code: String, allow_return_outside_function: bool) -> Vec { - let compiler = get_compiler(); - let compiler_options = ParseOptions { - syntax: Syntax::Es(EsConfig { - allow_return_outside_function, - import_attributes: true, - ..Default::default() - }), - target: EsVersion::EsNext, - is_module: Unknown, - comments: false, - }; let filename = FileName::Anon; - let file = compiler.cm.new_source_file(filename, code); + let file = cm.new_source_file(filename, code); let code_reference = Lrc::clone(&file.src); let comments = SequentialComments::default(); GLOBALS.set(&Globals::default(), || { - compiler.run(|| { - let result = try_with_handler( - &code_reference, - &compiler.cm, - compiler_options.target, - |handler| { - compiler.parse_js( - file, - handler, - compiler_options.target, - compiler_options.syntax, - compiler_options.is_module, - Some(&comments), - ) - }, - ); - match result { - Err(buffer) => buffer, - Ok(program) => { - let annotations = comments.take_annotations(); - let converter = AstConverter::new(&code_reference, &annotations); - converter.convert_ast_to_buffer(&program) - } + let result = try_with_handler(&code_reference, &cm.clone(), target, |handler| { + parse_js( + cm, + file, + handler, + target, + syntax, + IsModule::Unknown, + Some(&comments), + ) + }); + match result { + Err(buffer) => buffer, + Ok(program) => { + let annotations = comments.take_annotations(); + let converter = AstConverter::new(&code_reference, &annotations); + converter.convert_ast_to_buffer(&program) } - }) + } }) } diff --git a/wasm/bindings_wasm.d.ts b/wasm/bindings_wasm.d.ts index 0f969452a..9f50667b5 100644 --- a/wasm/bindings_wasm.d.ts +++ b/wasm/bindings_wasm.d.ts @@ -11,12 +11,6 @@ export function parse(code: string, allow_return_outside_function: boolean): Uin * @returns {string} */ export function xxhashBase64Url(input: Uint8Array): string; -/** -* @param {string} query -* @param {any} opts -* @returns {any} -*/ -export function browserslist(query: string, opts: any): any; export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; @@ -24,10 +18,9 @@ export interface InitOutput { readonly memory: WebAssembly.Memory; readonly parse: (a: number, b: number, c: number, d: number) => void; readonly xxhashBase64Url: (a: number, b: number) => void; - readonly browserslist: (a: number, b: number, c: number, d: number) => void; + readonly __wbindgen_add_to_stack_pointer: (a: number) => number; readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; - readonly __wbindgen_add_to_stack_pointer: (a: number) => number; readonly __wbindgen_free: (a: number, b: number, c: number) => void; readonly __wbindgen_exn_store: (a: number) => void; } diff --git a/wasm/bindings_wasm_bg.wasm.d.ts b/wasm/bindings_wasm_bg.wasm.d.ts index 14398a0b6..7bcafe200 100644 --- a/wasm/bindings_wasm_bg.wasm.d.ts +++ b/wasm/bindings_wasm_bg.wasm.d.ts @@ -3,9 +3,8 @@ export const memory: WebAssembly.Memory; export function parse(a: number, b: number, c: number, d: number): void; export function xxhashBase64Url(a: number, b: number): void; -export function browserslist(a: number, b: number, c: number, d: number): void; +export function __wbindgen_add_to_stack_pointer(a: number): number; export function __wbindgen_malloc(a: number, b: number): number; export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; -export function __wbindgen_add_to_stack_pointer(a: number): number; export function __wbindgen_free(a: number, b: number, c: number): void; export function __wbindgen_exn_store(a: number): void;